[Cppunit-devel] assert* macros, revisited
Brought to you by:
blep
From: Steve M. R. <ste...@vi...> - 2001-05-23 13:35:56
|
Hi, I have come to the conclusion that grabbing global name space with assert(), assertEqual(), etc, is a Bad Idea. Besides clashing with the standard C assert() macro, it is just plain rude. ;-) Other libraries prefix their macros with a standard identifier. CGAL, for one <www.cgal.org> uses CGAL_assert(). In that tradition, I wonder if CppUnit should move to CppUnit_assert()? I should hasten to add that I only suggest to do this gradually. One plan I came up with is to #define the CppUnit_assert version, and use #define assert(cond) CppUnit_assert(cond) for backwards compatibility. In fact, we could make it a configure option (--with-toplevel-assert ?). Those who wish to make sure they are writing "clean" test cases will be able to disable the old macro names ("./configure --without-toplevel-assert"). Comments? I see now that there are some other macros with a "CU_" prefix. If that is the desired prefix for CppUnit, then we'd go with CU_assert() and CU_assertEqual(). -Steve -- by Rocket to the Moon, by Airplane to the Rocket, by Taxi to the Airport, by Frontdoor to the Taxi, by throwing back the blanket and laying down the legs ... - They Might Be Giants |