Yah, we are aware of this. It has been a tough decision as CppUTest is designed to not depend on exception handling.
However, in the latest version, this should have been fixed already. Which version were you using?
In the latest version, what we did is that whenever you compile CppUTest with StdC++ library, then it will ASSUME exceptions are supported (as C++ library must use exceptions). However, when you decide to compile CppUTest without the StdC++ library THEN it will assume no exceptions are supported and will use setjmp/longjmp instead.
So, could you check whether this is still relevant with the latest version?
Thanks!
Bas
Thanks a lot for your response. It's great to hear there is (or will
be) a way to avoid setjmp/longjmp. I am running Subversion trunk HEAD
(r714) (https://cpputest.svn.sourceforge.net/svnroot/cpputest/trunk)
and my failing CHECK() keeps ending up in
src/Platforms/Gcc/UtestPlatform.cpp line 116, inside
executePlatformSpecificExitCurrentTest(), which contains a longjmp().
So it would seem that the changes you are referring to, have not yet
found their way into Subversion trunk. However, I am quite new to
CppUTest, so if I am missing something essential here, I hope you can
point me in the right direction.
Thanks again.
--
Knut Aksel
2012/4/15 Bas Vodde <ba...@odd-e.com>:
You are right, the functionality I was talking about doesn't seem to be implemented. I must have either dreamt it or reverted it, but I was very sure it was there :)
That is very amusing.
Anyways, the catching is already there. So, if you change the longjmp to "throw CppUTestFailedException();" then it actually ought to work.
I'll need to spend some work to actually implement that proper. I think I probably skipped it due to the PlatformSpecific code.
I'll try to do that later this week and will let you know when its done. It should be there as I do agree with your argument :P
Bas