diff --git a/CMakeLists.txt b/CMakeLists.txt index a45848930efb22da64ee1c37877e973dca3559bf..4a72860358d8d0aea09339706ee6000de3015c66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,9 @@ target_include_directories(dhtnet PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include> ) +if (BUILD_TESTING) + target_compile_definitions(dhtnet PUBLIC DHTNET_TESTABLE) +endif() target_compile_definitions(dhtnet PUBLIC PJ_AUTOCONF=1) # set_target_properties(dhtnet PROPERTIES PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/include/${dhtnet_HEADERS}") diff --git a/include/multiplexed_socket.h b/include/multiplexed_socket.h index 1d37166150dd4f2aa757972f06825dad6eb99e74..a090a8c9a03830dcf18b27af054c7c8a5f44102e 100644 --- a/include/multiplexed_socket.h +++ b/include/multiplexed_socket.h @@ -162,7 +162,7 @@ public: void eraseChannel(uint16_t channel); -#ifdef LIBJAMI_TESTABLE +#ifdef DHTNET_TESTABLE /** * Check if we can send beacon on the socket */ @@ -341,7 +341,7 @@ public: */ std::shared_ptr<dht::crypto::Certificate> peerCertificate() const; -#ifdef LIBJAMI_TESTABLE +#ifdef DHTNET_TESTABLE std::shared_ptr<MultiplexedSocket> underlyingSocket() const; #endif diff --git a/src/multiplexed_socket.cpp b/src/multiplexed_socket.cpp index 9c6d59d07b162f687006658cb6ee9212130418fb..97c9e1cd707137741f5430279f48a87319121b12 100644 --- a/src/multiplexed_socket.cpp +++ b/src/multiplexed_socket.cpp @@ -718,7 +718,7 @@ MultiplexedSocket::peerCertificate() const return pimpl_->endpoint->peerCertificate(); } -#ifdef LIBJAMI_TESTABLE +#ifdef DHTNET_TESTABLE bool MultiplexedSocket::canSendBeacon() const { @@ -1038,7 +1038,7 @@ ChannelSocket::onRecv(std::vector<uint8_t>&& pkt) pimpl_->cv.notify_all(); } -#ifdef LIBJAMI_TESTABLE +#ifdef DHTNET_TESTABLE std::shared_ptr<MultiplexedSocket> ChannelSocket::underlyingSocket() const {