[test] assert fails - all tests passing

This doesn't make a lot of sense to me and seems like new behavior in .35:
Running 1 test case...
commands: commands.cpp:5: void test_construct(): Assertion `false' failed.
*** No errors detected
PASS: commands
==================
All 1 tests passed
==================
Previously, the use of BOOST_ASSERT(xxx) was the method of testing. Is
that different now?
Previously, I didn't return anything from the function, I just assert.
Is that different now?
Boost.Test isn't listed in the updated libraries for .35 but this is
definitely not the behavior I was getting in .34
Code:
#include

Noah Roberts wrote:
This doesn't make a lot of sense to me and seems like new behavior in .35:
Running 1 test case... commands: commands.cpp:5: void test_construct(): Assertion `false' failed.
*** No errors detected PASS: commands ================== All 1 tests passed ==================
Previously, the use of BOOST_ASSERT(xxx) was the method of testing. Is that different now?
Hmm..maybe I'm mistaken and have been using BOOST_CHECK. I switched to that and now I get a linker error for: undefined reference to `boost::test_tools::tt_detail::check_impl I'm liking to the unit-test-framework-s library. Is there another req? I tried to link to the only other test library I could find and that was obviously a conflict. Thanks.

Noah Roberts wrote:
Noah Roberts wrote:
This doesn't make a lot of sense to me and seems like new behavior in .35:
Running 1 test case... commands: commands.cpp:5: void test_construct(): Assertion `false' failed.
*** No errors detected PASS: commands ================== All 1 tests passed ==================
Previously, the use of BOOST_ASSERT(xxx) was the method of testing. Is that different now?
Hmm..maybe I'm mistaken and have been using BOOST_CHECK. I switched to that and now I get a linker error for:
undefined reference to `boost::test_tools::tt_detail::check_impl
I'm liking to the unit-test-framework-s library. Is there another req? I tried to link to the only other test library I could find and that was obviously a conflict.
Check your link line. The only way to get this kind of error is to either link with wrong library or no library at all. Gennadiy

Noah Roberts
Check your link line. The only way to get this kind of error is to either link with wrong library or no library at all.
Sorry, I must be imagining things again. It must be building and I just can't see past my own delusion to see that.
So, it works now? Gennadiy

Gennadiy Rozental wrote:
Noah Roberts
writes: Check your link line. The only way to get this kind of error is to either link with wrong library or no library at all. Sorry, I must be imagining things again. It must be building and I just can't see past my own delusion to see that.
So, it works now?
Well, since it can't possibly not...it must. I just can't see it. From my OP: "I'm liking to the unit-test-framework-s library."

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 16 May 2008 13:46 pm, Noah Roberts wrote:
Gennadiy Rozental wrote:
Noah Roberts
writes: Check your link line. The only way to get this kind of error is to either link with wrong library or no library at all.
Sorry, I must be imagining things again. It must be building and I just can't see past my own delusion to see that.
So, it works now?
Well, since it can't possibly not...it must. I just can't see it.
From my OP: "I'm liking to the unit-test-framework-s library."
I'd avoid relying on sarcasm to communicate via email. We can't hear your tone of voice or see your eyes rolling, so it's pretty difficult to pick up on. - -- Frank -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFILdCr5vihyNWuA4URAnGpAJ9GlnSylxAZ7Go+Xpqs3qMbQ6kr7gCfX60J 9Byr/aQGtZOdpWln5erigvw= =LLUo -----END PGP SIGNATURE-----

Noah Roberts
Gennadiy Rozental wrote:
Noah Roberts
writes: Check your link line. The only way to get this kind of error is to either link with wrong library or no library at all. Sorry, I must be imagining things again. It must be building and I just can't see past my own delusion to see that.
So, it works now?
Well, since it can't possibly not...it must. I just can't see it.
From my OP: "I'm liking to the unit-test-framework-s library."
Your attempts to being sarcastic are in no way productive. I can assure you that I personally have no problem linking your example. An error like
undefined reference to `boost::test_tools::tt_detail::check_impl
means the reference is undefined, which means no one defined it. Unit Test framework does define it (it's implemented in test_tools.ipp). So either you are not linking to it (check again your makefile), or you are linking to wrong library (for example built for different version of boost, or with different compiler) HTH, Gennadiy

Gennadiy Rozental wrote:
undefined reference to `boost::test_tools::tt_detail::check_impl
means the reference is undefined, which means no one defined it. Unit Test framework does define it (it's implemented in test_tools.ipp). So either you are not linking to it (check again your makefile), or you are linking to wrong library (for example built for different version of boost, or with different compiler)
Well, again, I will inform you that I am both linking to the unit-test-framework-s library AND getting the undefined reference error (and yes, I know what an undefined reference is). Furthermore, until using BOOST_CHECK instead of BOOST_ASSERT, the unit test ran just fine...and this would not be possible without a main() or a link to that library! I mean, all you need to do is follow the conversation to see that. You can claim it is not happening all you want, that doesn't change the facts of what I am experiencing. Your insistence that I'm not seeing the problem I am seeing is likewise non-productive. Just say you don't know what the hell is going on, don't tell me I'm imagining things! You're assuming I'm an idiot, requiring me to constantly reiterate and justify what I see, and I don't see how that helps anyone.

Noah,
Your language and tone are abusive. Gennadiy is not saying that you
are not seeing a problem: he is telling you what is the only possible
reason why you are seeing this problem (and he is right).
There are two things you can try:
1) tell us what platform and compiler you use, print out the linker
command issued by your build system and let us see it, and ask nicely
for help.
2) don't link to the library, instead #include
Gennadiy Rozental wrote:
undefined reference to `boost::test_tools::tt_detail::check_impl
means the reference is undefined, which means no one defined it. Unit Test framework does define it (it's implemented in test_tools.ipp). So either you are not linking to it (check again your makefile), or you are linking to wrong library (for example built for different version of boost, or with different compiler)
Well, again, I will inform you that I am both linking to the unit-test-framework-s library AND getting the undefined reference error (and yes, I know what an undefined reference is).
Furthermore, until using BOOST_CHECK instead of BOOST_ASSERT, the unit test ran just fine...and this would not be possible without a main() or a link to that library! I mean, all you need to do is follow the conversation to see that.
You can claim it is not happening all you want, that doesn't change the facts of what I am experiencing. Your insistence that I'm not seeing the problem I am seeing is likewise non-productive. Just say you don't know what the hell is going on, don't tell me I'm imagining things!
You're assuming I'm an idiot, requiring me to constantly reiterate and justify what I see, and I don't see how that helps anyone.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Pierre-Jules Tremblay wrote:
Noah,
Your language and tone are abusive. Gennadiy is not saying that you are not seeing a problem: he is telling you what is the only possible reason why you are seeing this problem (and he is right).
Obviously not, but whatever.
There are two things you can try:
1) tell us what platform and compiler you use, print out the linker command issued by your build system and let us see it, and ask nicely for help. 2) don't link to the library, instead #include
at the top of your source file.
You do realize that only works in some environments?

Noah Roberts
Pierre-Jules Tremblay wrote:
2) don't link to the library, instead #include
at the top of your source file. You do realize that only works in some environments?
I am not aware about configuration that fail to compile this, but I am sure you will enlighten me, Gennadiy

Pierre-Jules Tremblay wrote:
Noah,
Your language and tone are abusive. Gennadiy is not saying that you are not seeing a problem: he is telling you what is the only possible reason why you are seeing this problem (and he is right).
There are two things you can try:
1) tell us what platform and compiler you use, print out the linker command issued by your build system and let us see it, and ask nicely for help.
g++ -I../include -g -O2 -lboost_unit_test_framework-s -o commands
commands.o command.o
commands.o: In function `test_construct()':
/home/nroberts/projects/ai/wumpus2/tests/commands.cpp:11: undefined
reference to
`boost::test_tools::tt_detail::check_impl(boost::test_tools::predicate_result
const&, boost::basic_wrap_stringstream<char>&,
boost::unit_test::basic_cstring<char const>, unsigned long,
boost::test_tools::tt_detail::tool_level,
boost::test_tools::tt_detail::check_type, unsigned long, ...)'
#include

Noah Roberts wrote:
Pierre-Jules Tremblay wrote:
Noah,
Your language and tone are abusive. Gennadiy is not saying that you are not seeing a problem: he is telling you what is the only possible reason why you are seeing this problem (and he is right).
There are two things you can try:
1) tell us what platform and compiler you use, print out the linker command issued by your build system and let us see it, and ask nicely for help.
g++ -I../include -g -O2 -lboost_unit_test_framework-s -o commands commands.o command.o commands.o: In function `test_construct()': /home/nroberts/projects/ai/wumpus2/tests/commands.cpp:11: undefined reference to `boost::test_tools::tt_detail::check_impl(boost::test_tools::predicate_result const&, boost::basic_wrap_stringstream<char>&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)'
I've found the error. It has to do with ordering of command line arguments. Don't know why it only complains about that function and works otherwise but whatever. Hopefully I can find a different way to inform automake of my need to link.

Hi Noah ! On Thursday 15 May 2008, Noah Roberts wrote:
This doesn't make a lot of sense to me and seems like new behavior in .35:
Running 1 test case... commands: commands.cpp:5: void test_construct(): Assertion `false' failed.
*** No errors detected PASS: commands ================== All 1 tests passed ==================
Previously, the use of BOOST_ASSERT(xxx) was the method of testing. Is that different now?
Previously, I didn't return anything from the function, I just assert. Is that different now?
This bug was fixed in trunk in r45160. See http://lists.boost.org/Archives/boost/2008/04/136805.php for the complete thread.
Boost.Test isn't listed in the updated libraries for .35 but this is definitely not the behavior I was getting in .34
Yes, this was a regression :-(( Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! Ingenieurgesellschaft für * voice: ++49 511 262926 57 ! Verkehrs- und Eisenbahnwesen mbH * fax : ++49 511 262926 99 ! Lister Straße 15 * juergen.hunold@ivembh.de ! www.ivembh.de * * Geschäftsführer: ! Sitz des Unternehmens: Hannover * Prof. Dr.-Ing. Thomas Siefer ! Amtsgericht Hannover, HRB 56965 * PD Dr.-Ing. Alfons Radtke !

Noah Roberts wrote:
This doesn't make a lot of sense to me and seems like new behavior in .35:
Running 1 test case... commands: commands.cpp:5: void test_construct(): Assertion `false' failed.
*** No errors detected PASS: commands ================== All 1 tests passed ==================
Yeah. This was fixed recently.
Previously, the use of BOOST_ASSERT(xxx) was the method of testing. Is that different now?
Why? You are better of using BOOST_CHECK_... kind of tools.
Previously, I didn't return anything from the function, I just assert. Is that different now?
You can use assert
Boost.Test isn't listed in the updated libraries for .35 but this is definitely not the behavior I was getting in .34
There was quite some number of changes. I just did not have a chance to put them into release notes. Gennadiy
participants (5)
-
Frank Mori Hess
-
Gennadiy Rozental
-
Juergen Hunold
-
Noah Roberts
-
Pierre-Jules Tremblay