Catching exceptions in FDORDBMS Unit Tests
mateusz at loskot.net
Tue Sep 5 16:26:54 EDT 2006
Recently, I started to play with Unit Tests in details and
I'm not sure I understand how they are expected work.
First, I see the main() function, in file UnitTest/Common/UnitTest.cpp,
is *not* wrapped with try-catch.
Hmm, so where exceptions (most of them) are supposed to be
caught, for example to print some meaningful message
(e.g. using FdoException::GetExceptionMessage())
and terminate execution?
AFAIK, the try-catch in main() is must-have if any of used components by
program is supposed to throw anything.
Is this a kind of CppUnit 'magic'?
Every time I run RDBMS Unit Test program, it aborts:
Test ID: 120121415
.F.F.F.F.F.F.F.F.F.F.F..F.F.F.Test is in group 'rollback', skipping test
.Initializing Connection ...
terminate called after throwing an instance of 'FdoException*'
I've not analysed how UT programs are compiled and linked, but
I suppose there some compilation flags missing.
BTW, here is interesting thread about exceptions + shared libraries:
Please, could you refer it to current configuration of FDORDBMS
Unit Test build?
More information about the Fdo-internals