This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
What does 'test' in testcases do?
- From: Christopher Jefferson <chris at bubblescope dot net>
- To: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 20 Oct 2013 11:09:49 +0100
- Subject: What does 'test' in testcases do?
- Authentication-results: sourceware.org; auth=none
I decided to try to trace the reason for adding:
bool test __attribute__((unused)) = true;
into tests. It seems to be from the following piece of code in
util/testsuite_hooks.h:
#ifdef _GLIBCXX_ASSERT
# include <cassert>
# define VERIFY(fn) assert(fn)
#else
# define VERIFY(fn) test &= bool(fn)
#endif
So, if we have assert we call it, else we do 'test &= bool(fn)'.
However, as far as I can see, no test does anything with 'test', so I
think this is ignoring any failing tests on any platform which does
not have 'assert'?
If I am understanding correctly, this should probably be fixed. I'm
not sure what the intention was.. probably returning 'test' from main?
Is there still platforms without assert where this matters?
Chris