astitcher commented on a change in pull request #1267:
URL: https://github.com/apache/qpid-dispatch/pull/1267#discussion_r655407202
##########
File path: src/server.c
##########
@@ -1738,7 +1738,7 @@ void qd_connector_decref(qd_connector_t* connector)
}
}
-__attribute__((noinline)) // permit replacement by dummy implementation in
unit_tests
+__attribute__((weak)) // permit replacement by dummy implementation in
unit_tests
Review comment:
[Not a comment on this PR really!]
This whole replacing a function by redefining in the unit tests without an
injection API makes me queazy! I'm not entirely sure why - it just seems
error-prone.
##########
File path: tests/CMakeLists.txt
##########
@@ -40,8 +40,8 @@ set(unit_test_SOURCES
thread_test.c
)
-add_executable(unit_tests ${unit_test_SOURCES})
-target_link_libraries(unit_tests qpid-dispatch)
+add_executable(unit_tests ${unit_test_SOURCES} $<TARGET_OBJECTS:qpid-dispatch>)
+target_link_libraries(unit_tests qpid-dispatch-libraries)
Review comment:
In this and the subsequent similar changes I don't understand why you
need both to add the object files and to add a static library. Surely you are
just effectively adding the same object twice like this? I think you only need
to do the add_executable() change and remove the target_link_libraries() unless
there is another library to add.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]