Addresses test failures in release mode #75
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These tests were behaving differently under release mode than debug mode, which is how they were originally tested and evaluated. I'm not entirely sure of the full cause of the issue or why it worked in debug mode but not release. As far as I can tell the functions defined in
test_type_support.c
andtest_type_support.cpp
were simple void functions, but after loading their librariestype_support_dispatch
called those functions and assigned their result to a pointer which was then returned, and that always returned null on gcc release. Even stranger, printing out the address of sym with std::cout intype_support_dispatch
allowed the test to pass. It seems likely to me that the original code was causing undefined behavior and gcc's optimizations caused a different result than debug mode.Signed-off-by: Stephen Brawner stephenbrawner@verbsurgical.com