Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed NDEBUG tracking for compiling tests in Release mode #287

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

twdragon
Copy link

@twdragon twdragon commented Jan 2, 2025

I am preparing this implementation to be distributed as a Debian package. It requires running all the available tests despite the Debug or Release build type being selected for CMake. The presence of NDEBUG definition tracking in the code removes this possibility because the absence of the _DUMMY_PROTO_ section in multiaddress_protocol_list.h allows successful compilation only when the tests are not compiled. Otherwise, the following error occurs:

/home/twdragon/src/libp2p-cpp/test/libp2p/transport/upgrader_test.cpp:76:38: error: no member named '_DUMMY_PROTO_1' in 'libp2p::multi::Protocol::Code'
      libp2p::multi::Protocol::Code::_DUMMY_PROTO_1,
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/twdragon/src/libp2p-cpp/test/libp2p/transport/upgrader_test.cpp:77:38: error: no member named '_DUMMY_PROTO_2' in 'libp2p::multi::Protocol::Code'
      libp2p::multi::Protocol::Code::_DUMMY_PROTO_2,
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
2 errors generated.

This PR proposes removing NDEBUG tracking from the code so the tests would be compiled and run when CMAKE_BUILD_TYPE is set to Release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant