Added a nice macro to the metawrap testing framework that allows a simple unit test to be put in one line in C and C++ with exception handling and failover reporting.
#define MW_UNIT “MwNativeString“
MW_UNIT_TEST_ASSERT(“Constructor1“,l_string.emptystring(),“Ensure that constructor starts with an empty string“);
MW_UNIT_TEST_ASSERT(“Constructor2“,l_string2.is(“Hello”),“Ensure that constructor populates.“);
Nice and simple. The individual unit test is not segregated from others – so it would not be wise to rely on the results of testcases.
Good articles on “Good OO Design” are rare. This is one of them.