This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

What does 'test' in testcases do?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]