mockpp-commits Mailing List for Mock Objects for C++ (Page 20)
Brought to you by:
ewald-arnold
You can subscribe to this list here.
2005 |
Jan
|
Feb
(17) |
Mar
(178) |
Apr
(119) |
May
(60) |
Jun
(3) |
Jul
(60) |
Aug
(16) |
Sep
(55) |
Oct
(156) |
Nov
(136) |
Dec
(255) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(98) |
Feb
(8) |
Mar
(57) |
Apr
(43) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/mockpp/mockpp/mockpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24721/mockpp/tests Modified Files: AssertMo_test.cpp Assert_test.cpp Exception_test.cpp ResponseVector_test.cpp ThrowableList_test.cpp Throwable_test.cpp TrackingCounter_test.cpp VerifyingTestCase_test.cpp VisitableMockMethod_1_test.cpp VisitableMockMethod_2_test.cpp VisitableMockMethod_test.cpp VisitableMockObject_1_test.cpp VisitableMockObject_1_void_test.cpp VisitableMockObject_2_test.cpp VisitableMockObject_2_void_test.cpp VisitableMockObject_3_test.cpp VisitableMockObject_3_void_test.cpp VisitableMockObject_4_test.cpp VisitableMockObject_4_void_test.cpp VisitableMockObject_5_test.cpp VisitableMockObject_5_void_test.cpp VisitableMockObject_test.cpp VisitableMockObject_void_test.cpp readability_test.cpp Log Message: optionally disable exceptions Index: readability_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/readability_test.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- readability_test.cpp 26 Nov 2005 17:57:49 -0000 1.4 +++ readability_test.cpp 28 Nov 2005 19:03:09 -0000 1.5 @@ -88,14 +88,16 @@ eq(false)) .will(returnValue(123)); - try + MOCKPP_TRY { mmo.chain(CA(), CB(), "hallo", 12, true); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(std::exception &ex) { std::cout << ex.what() << std::endl; } +#endif } @@ -105,14 +107,16 @@ mmo.void_visit(CA(), CB(), "hallo", 12, true); mmo.activate(); - try + MOCKPP_TRY { mmo.visit(CA(), CB(), "hallo", 12, false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(std::exception &ex) { std::cout << ex.what() << std::endl; } +#endif } @@ -122,14 +126,16 @@ mmo.void_visit(CA(), CB(), "hallo", 12, true); mmo.activate(); - try + MOCKPP_TRY { mmo.void_visit(CA(), CB(), "hallo", 21, false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(std::exception &ex) { std::cout << ex.what() << std::endl; } +#endif } @@ -137,14 +143,16 @@ { mockpp::ConstraintList<MOCKPP_STL::string> list(MOCKPP_PCHAR("ConstraintListInstance")); list.addExpected(eq(MOCKPP_STL::string("string"))); - try + MOCKPP_TRY { list.addActual(MOCKPP_STL::string("no-string")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(std::exception &ex) { std::cout << ex.what() << std::endl; } +#endif } @@ -152,14 +160,16 @@ { mockpp::ExpectationList<MOCKPP_STL::string> list(MOCKPP_PCHAR("ExpectationListInstance")); list.addExpected(MOCKPP_STL::string("string")); - try + MOCKPP_TRY { list.addActual(MOCKPP_STL::string("no-string")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(std::exception &ex) { std::cout << ex.what() << std::endl; } +#endif } @@ -168,14 +178,16 @@ mockpp::ExpectationList<MOCKPP_STL::string> list(MOCKPP_PCHAR("ExpectationListInstance") ); list.addExpected(MOCKPP_STL::string("string")); list.addActual(MOCKPP_STL::string("string")); - try + MOCKPP_TRY { list.addActual(MOCKPP_STL::string("no-string")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(std::exception &ex) { std::cout << ex.what() << std::endl; } +#endif } @@ -184,7 +196,7 @@ unsigned result = 0; std::cout << "Starting readability tests..\n"; - try + MOCKPP_TRY { std::cout << "--\n"; @@ -207,11 +219,13 @@ std::cout << "--\n"; } +#ifndef MOCKPP_NO_EXCEPTIONS catch(...) { std::cout << "Caught unexpected exception\n"; result = 1; } +#endif std::cout << "Finishing readability tests\n"; return result; Index: ResponseVector_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ResponseVector_test.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ResponseVector_test.cpp 2 Nov 2005 20:57:30 -0000 1.4 +++ ResponseVector_test.cpp 28 Nov 2005 19:03:09 -0000 1.5 @@ -72,13 +72,15 @@ rtv.add(long(654), 31, 21, 11, MOCKPP_UNLIMITED); mockpp::Throwable *t; - + MOCKPP_ASSERT_TRUE(rtv.find(t, 30, 20, 10)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(t->throw_me(), MOCKPP_PCHAR("321"), int, int(321)); - +#endif + long r; MOCKPP_ASSERT_FALSE(rtv.find(r, 32, 22, 12)); MOCKPP_ASSERT_TRUE(rtv.find(r, 31, 21, 11)); @@ -113,34 +115,40 @@ void ResponseVector_Test::test_thrower() { mockpp::ResponseThrowableVector3<int, int, int> rtv(MOCKPP_PCHAR("rtv3"), 0); - + rtv.add(mockpp::make_throwable(int(123)), 10, 20, 30, 1); rtv.add(mockpp::make_throwable(int(321)), 30, 20, 10, MOCKPP_UNLIMITED); rtv.add(0, 10, 10, 10, MOCKPP_UNLIMITED); - + mockpp::Throwable *t; - + MOCKPP_ASSERT_TRUE(rtv.find(t, 30, 20, 10)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(t->throw_me(), MOCKPP_PCHAR("321"), int, int(321)); - +#endif + MOCKPP_ASSERT_TRUE(rtv.find(t, 10, 20, 30)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(t->throw_me(), MOCKPP_PCHAR("123"), int, int(123)); - +#endif + MOCKPP_ASSERT_FALSE(rtv.find(t, 10, 10, 10)); MOCKPP_ASSERT_FALSE(rtv.find(t, 10, 20, 30)); MOCKPP_ASSERT_TRUE(rtv.find(t, 30, 20, 10)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(t->throw_me(), MOCKPP_PCHAR("321"), int, int(321)); +#endif } Index: TrackingCounter_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/TrackingCounter_test.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- TrackingCounter_test.cpp 26 Nov 2005 17:57:48 -0000 1.8 +++ TrackingCounter_test.cpp 28 Nov 2005 19:03:09 -0000 1.9 @@ -337,16 +337,20 @@ ec.setExpected(2); ec.setFailOnVerify(); ec.inc(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING_COND(ec.verify(), MOCKPP_PCHAR("test_client_verify()"), mockpp::AssertionFailedError, exception_object.getMessage().find(MOCKPP_PCHAR("tagged with 1 which is less ")) != MOCKPP_STL::string::npos); +#endif ec.inc(); ec.inc(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING_COND(ec.verify(), MOCKPP_PCHAR("test_client_verify()"), mockpp::AssertionFailedError, exception_object.getMessage().find(MOCKPP_PCHAR("tagged with 3 which is more")) != MOCKPP_STL::string::npos); +#endif } @@ -368,16 +372,20 @@ master.setExpected(2); master.setFailOnVerify(); ec.inc(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING_COND(master.verify(), MOCKPP_PCHAR("test_master_verify()"), mockpp::AssertionFailedError, exception_object.getMessage().find(MOCKPP_PCHAR("tagged 1 times which is less ")) != MOCKPP_STL::string::npos); +#endif ec.inc(); ec.inc(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING_COND(master.verify(), MOCKPP_PCHAR("test_master_verify()"), mockpp::AssertionFailedError, exception_object.getMessage().find(MOCKPP_PCHAR("tagged 3 times which is more")) != MOCKPP_STL::string::npos); +#endif } Index: ThrowableList_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ThrowableList_test.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- ThrowableList_test.cpp 26 Nov 2005 17:57:48 -0000 1.15 +++ ThrowableList_test.cpp 28 Nov 2005 19:03:09 -0000 1.16 @@ -74,11 +74,12 @@ tl.push_back(mockpp::make_throwable(MOCKPP_STL::string("my-item 1"))); tl.addObjectToThrow(MOCKPP_STL::string("my-item 2")); - try + MOCKPP_TRY { tl.nextThrowableObject()->throw_me(); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &s) { MOCKPP_ASSERT_TRUE(s == "my-item 1"); @@ -87,12 +88,14 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif - try + MOCKPP_TRY { tl.nextThrowableObject()->throw_me(); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &s) { MOCKPP_ASSERT_TRUE(s == "my-item 2"); @@ -101,6 +104,8 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif + MOCKPP_ASSERT_TRUE(tl.hasMoreObjects() == false); tl.verify(); } Index: VisitableMockObject_5_void_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockObject_5_void_test.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- VisitableMockObject_5_void_test.cpp 26 Nov 2005 17:57:49 -0000 1.24 +++ VisitableMockObject_5_void_test.cpp 28 Nov 2005 19:03:09 -0000 1.25 @@ -533,6 +533,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable5(2, 2, 3, 4, 5), MOCKPP_PCSTRING("1"), MOCKPP_STL::string, "exceptional string 1"); @@ -541,7 +542,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable5(222, 2, 3, 4, 5), MOCKPP_PCSTRING("3"), MOCKPP_STL::string, "exceptional string 2"); - +#endif mvo.visitable5(2222, 2, 3, 4, 5); mvo.visitable5(22222, 2, 3, 4, 5); mvo.visitable5(222222, 2, 3, 4, 5); @@ -688,6 +689,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable5(922, 2, 3, 4, 5), MOCKPP_PCHAR("response 1"), MOCKPP_STL::string, MOCKPP_STL::string("throw me 2")); @@ -699,7 +701,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable5(2, 2, 3, 4, 5), MOCKPP_PCHAR("default response"), MOCKPP_STL::string, MOCKPP_STL::string("throw default")); - +#endif mvo.verify(); } @@ -784,6 +786,7 @@ mockpp::eq<unsigned>(52)); mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable5(8, 18, 28, 38, 48), MOCKPP_PCHAR("mvo.visitable5(8, 18, 28, 38, 48)"), int, @@ -793,7 +796,7 @@ MOCKPP_PCHAR("mvo.visitable5(12, 22, 32, 42, 52)"), int, 1); - +#endif mvo.visitable5(1, 1, 1, 1, 1); mvo.verify(); } @@ -851,10 +854,12 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.abc_visitable5(CA(10), CB(20), CC(30), CD(40), CE(50)), MOCKPP_PCHAR("mvo.abc_visitable5(CA(10), CB(20), CC(30), CD(40), CE(50))"), int, 2); +#endif mvo.abc_visitable5(CA(10), CB(20), CC(30), CD(40), CF(50)); Index: VisitableMockObject_4_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockObject_4_test.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- VisitableMockObject_4_test.cpp 26 Nov 2005 17:57:48 -0000 1.19 +++ VisitableMockObject_4_test.cpp 28 Nov 2005 19:03:09 -0000 1.20 @@ -219,6 +219,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(1, 2, 3, 4), MOCKPP_PCSTRING("1"), MOCKPP_STL::string, "exceptional string 1"); @@ -230,6 +231,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable(1, 2, 3, 4), MOCKPP_PCSTRING("4"), MOCKPP_STL::string, "exceptional string 3"); +#endif } @@ -422,6 +424,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(922, 2, 3, 4), MOCKPP_PCHAR("response 1"), MOCKPP_STL::string, MOCKPP_STL::string("throw me 2")); @@ -433,6 +436,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable(2, 2, 3, 4), MOCKPP_PCHAR("default response"), MOCKPP_STL::string, MOCKPP_STL::string("throw default")); +#endif } @@ -462,11 +466,13 @@ MOCKPP_ASSERT_TRUE(321 == mvo.visitable(654, 2, 3, 4)); MOCKPP_ASSERT_TRUE(111 == mvo.visitable(1, 2, 3, 4)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(922, 2, 3, 4), MOCKPP_PCHAR("response 1"), MOCKPP_STL::string, MOCKPP_STL::string("throw me 2")); MOCKPP_ASSERT_THROWING(mvo.visitable(911, 2, 3, 4), MOCKPP_PCHAR("response 2"), MOCKPP_STL::string, MOCKPP_STL::string("throw me 1")); +#endif MOCKPP_ASSERT_TRUE(111 == mvo.visitable(2, 2, 3, 4)); MOCKPP_ASSERT_TRUE(111 == mvo.visitable(3, 2, 3, 4)); @@ -530,25 +536,29 @@ mvo.unsetThrowablesInline(); // old pre-1.2 mode mvo.activate(); - try + MOCKPP_TRY { mvo.visitable(1, 2, 3, 4); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 1")); } +#endif - try + MOCKPP_TRY { mvo.visitable(1, 2, 3, 4); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 2")); } +#endif MOCKPP_ASSERT_TRUE(111 == mvo.visitable(1, 2, 3, 4)); MOCKPP_ASSERT_TRUE(222 == mvo.visitable(1, 2, 3, 4)); @@ -569,28 +579,30 @@ MOCKPP_ASSERT_TRUE(111 == mvo.visitable(1, 2, 3, 4)); - try + MOCKPP_TRY { mvo.visitable(1, 2, 3, 4); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 1")); } - +#endif MOCKPP_ASSERT_TRUE(222 == mvo.visitable(1, 2, 3, 4)); - try + MOCKPP_TRY { mvo.visitable(1, 2, 3, 4); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 2")); } - +#endif mvo.verify(); } @@ -666,6 +678,7 @@ MOCKPP_ASSERT_TRUE(1 == mvo.visitable(11, 21, 31, 51)); MOCKPP_ASSERT_TRUE(2 == mvo.visitable(9, 19, 29, 49)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(8, 18, 28, 48), MOCKPP_PCHAR("mvo.visitable(8, 18, 28, 48)"), int, @@ -675,6 +688,7 @@ MOCKPP_PCHAR("mvo.visitable(12, 22, 32, 52)"), int, 1); +#endif MOCKPP_ASSERT_TRUE(123 == mvo.visitable(1, 1, 1, 1)); mvo.verify(); Index: VisitableMockObject_1_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockObject_1_test.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- VisitableMockObject_1_test.cpp 26 Nov 2005 17:57:48 -0000 1.21 +++ VisitableMockObject_1_test.cpp 28 Nov 2005 19:03:09 -0000 1.22 @@ -200,6 +200,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(1), MOCKPP_PCSTRING("1"), MOCKPP_STL::string, "exceptional string 1"); @@ -211,6 +212,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable(1), MOCKPP_PCSTRING("4"), MOCKPP_STL::string, "exceptional string 3"); +#endif } @@ -388,6 +390,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(922), MOCKPP_PCHAR("response 1"), MOCKPP_STL::string, MOCKPP_STL::string("throw me 1")); @@ -399,6 +402,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable(2), MOCKPP_PCHAR("default response"), MOCKPP_STL::string, MOCKPP_STL::string("throw default")); +#endif } @@ -428,11 +432,13 @@ MOCKPP_ASSERT_TRUE(321 == mvo.visitable(654)); MOCKPP_ASSERT_TRUE(111 == mvo.visitable(1)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(922), MOCKPP_PCHAR("response 1"), MOCKPP_STL::string, MOCKPP_STL::string("throw me 1")); MOCKPP_ASSERT_THROWING(mvo.visitable(911), MOCKPP_PCHAR("response 2"), MOCKPP_STL::string, MOCKPP_STL::string("throw me 2")); +#endif MOCKPP_ASSERT_TRUE(111 == mvo.visitable(2)); MOCKPP_ASSERT_TRUE(111 == mvo.visitable(3)); @@ -496,25 +502,29 @@ mvo.unsetThrowablesInline(); // old pre-1.2 mode mvo.activate(); - try + MOCKPP_TRY { mvo.visitable(1); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 1")); } +#endif - try + MOCKPP_TRY { mvo.visitable(1); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 2")); } +#endif MOCKPP_ASSERT_TRUE(111 == mvo.visitable(3)); MOCKPP_ASSERT_TRUE(222 == mvo.visitable(3)); @@ -535,28 +545,31 @@ MOCKPP_ASSERT_TRUE(111 == mvo.visitable(3)); - try + MOCKPP_TRY { mvo.visitable(1); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 1")); } +#endif MOCKPP_ASSERT_TRUE(222 == mvo.visitable(3)); - try + MOCKPP_TRY { mvo.visitable(1); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 2")); } - +#endif mvo.verify(); } @@ -607,6 +620,7 @@ MOCKPP_ASSERT_TRUE(1 == mvo.visitable(11)); MOCKPP_ASSERT_TRUE(2 == mvo.visitable(9)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(8), MOCKPP_PCHAR("mvo.visitable(8)"), int, @@ -616,6 +630,7 @@ MOCKPP_PCHAR("mvo.visitable(12)"), int, 1); +#endif MOCKPP_ASSERT_TRUE(123 == mvo.visitable(1)); mvo.verify(); Index: VisitableMockObject_1_void_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockObject_1_void_test.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- VisitableMockObject_1_void_test.cpp 26 Nov 2005 17:57:48 -0000 1.21 +++ VisitableMockObject_1_void_test.cpp 28 Nov 2005 19:03:09 -0000 1.22 @@ -177,6 +177,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(2), MOCKPP_PCSTRING("1"), MOCKPP_STL::string, "exceptional string 1"); @@ -185,7 +186,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable(222), MOCKPP_PCSTRING("3"), MOCKPP_STL::string, "exceptional string 2"); - +#endif mvo.visitable(2222); mvo.visitable(22222); mvo.visitable(222222); @@ -295,6 +296,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(922), MOCKPP_PCHAR("response 1"), MOCKPP_STL::string, MOCKPP_STL::string("throw me 1")); @@ -306,7 +308,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable(2), MOCKPP_PCHAR("default response"), MOCKPP_STL::string, MOCKPP_STL::string("throw default")); - +#endif mvo.verify(); } @@ -374,6 +376,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(8), MOCKPP_PCHAR("mvo.visitable(8)"), int, @@ -383,7 +386,7 @@ MOCKPP_PCHAR("mvo.visitable(12)"), int, 1); - +#endif mvo.visitable(1); mvo.verify(); } Index: VisitableMockObject_2_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockObject_2_test.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- VisitableMockObject_2_test.cpp 26 Nov 2005 17:57:48 -0000 1.20 +++ VisitableMockObject_2_test.cpp 28 Nov 2005 19:03:09 -0000 1.21 @@ -206,6 +206,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(1, 2), MOCKPP_PCSTRING("1"), MOCKPP_STL::string, "exceptional string 1"); @@ -217,6 +218,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable(1, 2), MOCKPP_PCSTRING("4"), MOCKPP_STL::string, "exceptional string 3"); +#endif } @@ -399,6 +401,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(922, 2), MOCKPP_PCHAR("response 1"), MOCKPP_STL::string, MOCKPP_STL::string("throw me 2")); @@ -410,6 +413,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable(2, 2), MOCKPP_PCHAR("default response"), MOCKPP_STL::string, MOCKPP_STL::string("throw default")); +#endif } @@ -439,11 +443,13 @@ MOCKPP_ASSERT_TRUE(321 == mvo.visitable(654, 2)); MOCKPP_ASSERT_TRUE(111 == mvo.visitable(1, 2)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(922, 2), MOCKPP_PCHAR("response 1"), MOCKPP_STL::string, MOCKPP_STL::string("throw me 2")); MOCKPP_ASSERT_THROWING(mvo.visitable(911, 2), MOCKPP_PCHAR("response 2"), MOCKPP_STL::string, MOCKPP_STL::string("throw me 1")); +#endif MOCKPP_ASSERT_TRUE(111 == mvo.visitable(2, 2)); MOCKPP_ASSERT_TRUE(111 == mvo.visitable(3, 2)); @@ -507,25 +513,29 @@ mvo.unsetThrowablesInline(); // old pre-1.2 mode mvo.activate(); - try + MOCKPP_TRY { mvo.visitable(1, 2); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 1")); } +#endif - try + MOCKPP_TRY { mvo.visitable(1, 2); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 2")); } +#endif MOCKPP_ASSERT_TRUE(111 == mvo.visitable(1, 2)); MOCKPP_ASSERT_TRUE(222 == mvo.visitable(1, 2)); @@ -546,27 +556,31 @@ MOCKPP_ASSERT_TRUE(111 == mvo.visitable(1, 2)); - try + MOCKPP_TRY { mvo.visitable(1, 2); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 1")); } +#endif MOCKPP_ASSERT_TRUE(222 == mvo.visitable(1, 2)); - try + MOCKPP_TRY { mvo.visitable(1, 2); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 2")); } +#endif mvo.verify(); } @@ -625,6 +639,7 @@ MOCKPP_ASSERT_TRUE(1 == mvo.visitable(11, 51)); MOCKPP_ASSERT_TRUE(2 == mvo.visitable(9, 49)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(8, 48), MOCKPP_PCHAR("mvo.visitable(8, 48)"), int, @@ -634,6 +649,7 @@ MOCKPP_PCHAR("mvo.visitable(12, 52)"), int, 1); +#endif MOCKPP_ASSERT_TRUE(123 == mvo.visitable(1, 1)); mvo.verify(); Index: VisitableMockObject_2_void_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockObject_2_void_test.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- VisitableMockObject_2_void_test.cpp 26 Nov 2005 17:57:48 -0000 1.20 +++ VisitableMockObject_2_void_test.cpp 28 Nov 2005 19:03:09 -0000 1.21 @@ -183,6 +183,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(2, 2), MOCKPP_PCSTRING("1"), MOCKPP_STL::string, "exceptional string 1"); @@ -191,7 +192,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable(222, 2), MOCKPP_PCSTRING("3"), MOCKPP_STL::string, "exceptional string 2"); - +#endif mvo.visitable(2222, 2); mvo.visitable(22222, 2); mvo.visitable(222222, 2); @@ -304,6 +305,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(922, 2), MOCKPP_PCHAR("response 1"), MOCKPP_STL::string, MOCKPP_STL::string("throw me 2")); @@ -315,7 +317,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable(2, 2), MOCKPP_PCHAR("default response"), MOCKPP_STL::string, MOCKPP_STL::string("throw default")); - +#endif mvo.verify(); } @@ -386,6 +388,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(8, 48), MOCKPP_PCHAR("mvo.visitable(8, 48)"), int, @@ -395,7 +398,7 @@ MOCKPP_PCHAR("mvo.visitable(12, 52)"), int, 1); - +#endif mvo.visitable(1, 1); mvo.verify(); } Index: VisitableMockObject_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockObject_test.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- VisitableMockObject_test.cpp 26 Nov 2005 17:57:49 -0000 1.24 +++ VisitableMockObject_test.cpp 28 Nov 2005 19:03:09 -0000 1.25 @@ -200,6 +200,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(), MOCKPP_PCSTRING("1"), MOCKPP_STL::string, "exceptional string 1"); @@ -211,6 +212,8 @@ MOCKPP_ASSERT_THROWING(mvo.visitable(), MOCKPP_PCSTRING("4"), MOCKPP_STL::string, "exceptional string 3"); +#endif + mvo.verify(); } @@ -237,10 +240,12 @@ mvo.activate(); mvo.visitable(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING_COND(mvo.verify(), MOCKPP_PCSTRING("mvo.verify()"), mockpp::AssertionFailedError, exception_object.getMessage().find(MOCKPP_PCHAR("did not receive the expected item list")) != mockpp::String::npos); +#endif } @@ -384,25 +389,29 @@ mvo.unsetThrowablesInline(); // old pre-1.2 mode mvo.activate(); - try + MOCKPP_TRY { mvo.visitable(); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 1")); } +#endif - try + MOCKPP_TRY { mvo.visitable(); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 2")); } +#endif MOCKPP_ASSERT_TRUE(111 == mvo.visitable()); MOCKPP_ASSERT_TRUE(222 == mvo.visitable()); @@ -423,27 +432,31 @@ MOCKPP_ASSERT_TRUE(111 == mvo.visitable()); - try + MOCKPP_TRY { mvo.visitable(); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 1")); } MOCKPP_ASSERT_TRUE(222 == mvo.visitable()); +#endif - try + MOCKPP_TRY { mvo.visitable(); MOCKPP_FAIL(MOCKPP_PCHAR("should have thrown here")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(MOCKPP_STL::string &ex) { MOCKPP_ASSERT_EQUALS(ex, MOCKPP_STL::string("throw 2")); } +#endif mvo.verify(); } Index: VisitableMockObject_3_void_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockObject_3_void_test.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- VisitableMockObject_3_void_test.cpp 26 Nov 2005 17:57:48 -0000 1.19 +++ VisitableMockObject_3_void_test.cpp 28 Nov 2005 19:03:09 -0000 1.20 @@ -189,6 +189,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(2, 2, 3), MOCKPP_PCSTRING("1"), MOCKPP_STL::string, "exceptional string 1"); @@ -197,7 +198,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable(222, 2, 3), MOCKPP_PCSTRING("3"), MOCKPP_STL::string, "exceptional string 2"); - +#endif mvo.visitable(2222, 2, 3); mvo.visitable(22222, 2, 3); mvo.visitable(222222, 2, 3); @@ -313,6 +314,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(922, 2, 3), MOCKPP_PCHAR("response 1"), MOCKPP_STL::string, MOCKPP_STL::string("throw me 2")); @@ -324,7 +326,7 @@ MOCKPP_ASSERT_THROWING(mvo.visitable(2, 2, 3), MOCKPP_PCHAR("default response"), MOCKPP_STL::string, MOCKPP_STL::string("throw default")); - +#endif mvo.verify(); } @@ -400,6 +402,7 @@ mvo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(mvo.visitable(8, 18, 48), MOCKPP_PCHAR("mvo.visitable(8, 18, 48)"), int, @@ -409,7 +412,7 @@ MOCKPP_PCHAR("mvo.visitable(12, 22, 52)"), int, 1); - +#endif mvo.visitable(1, 1, 1); mvo.verify(); } Index: VisitableMockMethod_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockMethod_test.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- VisitableMockMethod_test.cpp 24 Nov 2005 19:46:10 -0000 1.16 +++ VisitableMockMethod_test.cpp 28 Nov 2005 19:03:09 -0000 1.17 @@ -193,6 +193,7 @@ vmb.setDefaultThrowable(mockpp::make_throwable(321u)); vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmb.throwAvailableException(), MOCKPP_PCHAR("vmb.throwAvailableException()"), unsigned, @@ -217,6 +218,7 @@ MOCKPP_PCHAR("vmb.throwAvailableException()"), unsigned, unsigned(321)); +#endif vmo.verify(); vmb.verify(); @@ -227,10 +229,12 @@ vmb.setDefaultThrowable(mockpp::make_throwable(321u)); vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING_COND(vmo.verify(), MOCKPP_PCHAR("vmo.verify()"), mockpp::AssertionFailedError, exception_object.getMessage().find(MOCKPP_PCHAR("/defaultThrowable is unused")) != mockpp::String::npos); +#endif } @@ -282,10 +286,12 @@ vmb.throwAvailableException(); vmb.throwAvailableException(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmb.throwAvailableException(), MOCKPP_PCHAR("vmb.throwAvailableException()-1"), unsigned, unsigned(123)); +#endif vmo.verify(); vmb.verify(); @@ -299,10 +305,12 @@ vmb.addThrowable(mockpp::make_throwable(123u)); vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmb.throwAvailableException(), MOCKPP_PCHAR("vmb.throwAvailableException()-2"), unsigned, unsigned(123)); +#endif MOCKPP_ASSERT_EQUALS(321, vmb.determineReturnValue()); MOCKPP_ASSERT_EQUALS(321, vmb.determineReturnValue()); @@ -315,10 +323,12 @@ vmo.reset(); vmb.setDefaultReturnValue(123); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING_COND(vmo.verify(), MOCKPP_PCHAR("vmo.verify()"), mockpp::AssertionFailedError, exception_object.getMessage().find(MOCKPP_PCHAR("/defaultReturnValueUsed is unused")) != mockpp::String::npos); +#endif } @@ -351,17 +361,21 @@ MOCKPP_ASSERT_EQUALS(321, vmo.visitable()); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitable(), MOCKPP_PCHAR("vmo.visitable()-1a"), unsigned, unsigned(123)); +#endif MOCKPP_ASSERT_EQUALS(432, vmo.visitable()); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitable(), MOCKPP_PCHAR("vmo.visitable()-1b"), unsigned, unsigned(321)); +#endif MOCKPP_ASSERT_EQUALS(123, vmo.visitable()); @@ -388,6 +402,7 @@ vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitable(), MOCKPP_PCHAR("vmo.visitable()-2a"), unsigned, @@ -397,6 +412,7 @@ MOCKPP_PCHAR("vmo.visitable()-2b"), unsigned, unsigned(321)); +#endif MOCKPP_ASSERT_EQUALS(321, vmo.visitable()); MOCKPP_ASSERT_EQUALS(432, vmo.visitable()); @@ -417,6 +433,7 @@ vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitable(), MOCKPP_PCHAR("vmo.visitable()-3a"), unsigned, @@ -431,6 +448,7 @@ MOCKPP_PCHAR("vmo.visitable()-3c"), unsigned, unsigned(111)); +#endif vmo.verify(); vmb.verify(); @@ -463,6 +481,7 @@ vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitablev(), MOCKPP_PCHAR("vmo.visitablev()-1a"), unsigned, @@ -472,6 +491,7 @@ MOCKPP_PCHAR("vmo.visitablev()-1b"), unsigned, unsigned(321)); +#endif vmo.visitablev(); vmo.visitable(); @@ -497,6 +517,7 @@ vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitablev(), MOCKPP_PCHAR("vmo.visitablev()-2a"), unsigned, @@ -506,6 +527,7 @@ MOCKPP_PCHAR("vmo.visitablev()-2b"), unsigned, unsigned(321)); +#endif vmo.visitablev(); vmo.visitablev(); @@ -525,6 +547,7 @@ vmo.visitablev(); vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitablev(), MOCKPP_PCHAR("vmo.visitablev()-3a"), unsigned, @@ -539,6 +562,7 @@ MOCKPP_PCHAR("vmo.visitablev()-3c"), unsigned, unsigned(111)); +#endif vmo.verify(); vmb.verify(); Index: Assert_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/Assert_test.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Assert_test.cpp 26 Nov 2005 17:57:48 -0000 1.18 +++ Assert_test.cpp 28 Nov 2005 19:03:09 -0000 1.19 @@ -103,132 +103,152 @@ bool thrown; thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR("equals 1==2"), 1, 2); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("equals 1==2") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS(123, 321); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("invalid: 123 == 321") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_DELTA_MESSAGE(MOCKPP_PCHAR("range 1 +- 2 == 4"), 1, 4, 2); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("range 1 +- 2 == 4") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_DELTA(123, 321, 3); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("invalid: 123 +- 3 == 321") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_BOUNDARY(123, 321, 789); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("invalid: 123 < 789 < 321") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_BOUNDARY_MESSAGE(MOCKPP_PCHAR("123 321 789"), 123, 321, 789); } - catch (mockpp::AssertionFailedError &ae) +#ifndef MOCKPP_NO_EXCEPTIONS +catch (mockpp::AssertionFailedError &ae) { thrown = true; MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("123 321 789") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("condition true == false"), true == false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("condition true == false") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_TRUE( true == false ); // some spaces AROUND the expression } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("!true: true == false") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_FALSE_MESSAGE(MOCKPP_PCHAR("condition true != false"), true != false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("condition true != false") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_FALSE( true != false ); // some spaces AROUND the expression } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("!false: true != false") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -242,27 +262,31 @@ bool thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR("assertEquals \"123\" == \"321\""), MOCKPP_STL::string("123"), MOCKPP_STL::string("321")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR(""), MOCKPP_STL::string("123"), MOCKPP_STL::string("321")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -278,27 +302,31 @@ bool thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR("assertEquals \"123\" == \"321\""), MOCKPP_STL::basic_string<wchar_t>(L"123"), MOCKPP_STL::basic_string<wchar_t>(L"321")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR(""), MOCKPP_STL::basic_string<wchar_t>(L"123"), MOCKPP_STL::basic_string<wchar_t>(L"321")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -313,27 +341,31 @@ bool thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR("assertEquals \"123\" == \"321\""), "123", "321"); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR(""), "123", "321"); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -348,27 +380,31 @@ bool thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR("assertEquals \"123\" == \"321\""), L"123", L"321"); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR(""), L"123", L"321"); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -382,26 +418,30 @@ MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR(""), (long) -12345678, (long) -12345678); bool thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR("assertEquals 12345678 == 876543321"), (long) 12345678, (long) 87654321); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR(""), (long) -12345678, (long) -87654321); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -415,27 +455,31 @@ bool thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR(""), (short) -1234, (short) -4321); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR("assertEquals 1234 != 4321"), (short) -1234, (short) -4321); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -448,27 +492,31 @@ MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR(""), (int) -1234, (int) -1234); bool thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR("assertEquals 1234 == 4321"), (int) 1234, (int) 4321); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR(""), (int) 1234, (int) 4321); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -482,27 +530,31 @@ bool thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR("assertEquals 'x' == 'u'"), MOCKPP_CHAR('x'), MOCKPP_CHAR('u')); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR(""), MOCKPP_CHAR('x'), MOCKPP_CHAR('u')); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -516,27 +568,31 @@ bool thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR("assertEquals true == false"), (bool)true, (bool)false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR(""), (bool)true, (bool)false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -562,27 +618,31 @@ bool thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_DELTA_MESSAGE(MOCKPP_PCHAR("assertEquals 12.5 +- 0.5 == 13.1"), (double)12.5, (double)13.1, (double)0.5); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_DELTA((double)12.5, (double)13.1, (double)-0.5); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -608,27 +668,31 @@ bool thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_DELTA_MESSAGE(MOCKPP_PCHAR("assertEquals 12.5 +- 0.5 == 11.9"), (float)12.5, (float)11.9, (float)0.5); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_DELTA((float)12.5, (float)11.9, (float)0.5); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -645,50 +709,58 @@ bool thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("assertTrue 1 != 1"), 1 != 1); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR(""), 1 != 1); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_FALSE_MESSAGE(MOCKPP_PCHAR("assertTrue 1 == 1"), 1 == 1); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_FALSE_MESSAGE(MOCKPP_PCHAR(""), 1 == 1); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -715,26 +787,30 @@ bool thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_BOUNDARY(2, 4, 1); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_BOUNDARY(2, 4, 5); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &) { thrown = true; } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } Index: Exception_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/Exception_test.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Exception_test.cpp 26 Nov 2005 17:57:48 -0000 1.12 +++ Exception_test.cpp 28 Nov 2005 19:03:09 -0000 1.13 @@ -64,11 +64,12 @@ bool thrown = false; unsigned l = 0; const char* f = 0; - try + MOCKPP_TRY { // keep on the same line l = __LINE__; f = __FILE__; MOCKPP_FAIL(MOCKPP_PCHAR("test-assert\n\rline 2")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_EQUALS_MESSAGE(MOCKPP_PCHAR("error line parameter"), (int)l, (int)ex.getSrcLine()); @@ -83,6 +84,7 @@ MOCKPP_STL::string("test-assert\n\rline 2"), MOCKPP_STL::string(ex.what())); thrown = true; } +#endif MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("Should have thrown"), thrown); } Index: VisitableMockMethod_2_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockMethod_2_test.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- VisitableMockMethod_2_test.cpp 18 Nov 2005 10:49:31 -0000 1.9 +++ VisitableMockMethod_2_test.cpp 28 Nov 2005 19:03:09 -0000 1.10 @@ -151,17 +151,21 @@ MOCKPP_ASSERT_EQUALS(321, vmo.visitable(1, 2)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitable(2, 3), MOCKPP_PCHAR("vmo.visitable()-1a"), unsigned, unsigned(123)); +#endif MOCKPP_ASSERT_EQUALS(432, vmo.visitable(3, 4)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitable(4, 5), MOCKPP_PCHAR("vmo.visitable()-1b"), unsigned, unsigned(321)); +#endif MOCKPP_ASSERT_EQUALS(123, vmo.visitable(5, 6)); @@ -169,6 +173,7 @@ MOCKPP_ASSERT_EQUALS(666, vmo.visitable(3, 21)); MOCKPP_ASSERT_EQUALS(333, vmo.visitable(3, 3)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitable(4, 4), MOCKPP_PCHAR("vmo.visitable()-2"), unsigned, @@ -183,6 +188,7 @@ MOCKPP_PCHAR("vmo.visitable()-3"), unsigned, unsigned(666)); +#endif vmo.verify(); vmb.verify(); @@ -206,6 +212,7 @@ vmo.visitable(3, 4); vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitable(9, 9), MOCKPP_PCHAR("vmo.visitable()-2a"), unsigned, @@ -215,6 +222,7 @@ MOCKPP_PCHAR("vmo.visitable()-2b"), unsigned, unsigned(321)); +#endif MOCKPP_ASSERT_EQUALS(321, vmo.visitable(1, 2)); MOCKPP_ASSERT_EQUALS(432, vmo.visitable(2, 3)); @@ -234,6 +242,7 @@ vmo.visitable(3, 4); vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitable(1, 2), MOCKPP_PCHAR("vmo.visitable()-3a"), unsigned, @@ -248,6 +257,7 @@ MOCKPP_PCHAR("vmo.visitable()-3c"), unsigned, unsigned(111)); +#endif vmo.verify(); vmb.verify(); @@ -288,6 +298,7 @@ vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitablev(2, 3), MOCKPP_PCHAR("vmo.visitablev()-1a"), unsigned, @@ -297,6 +308,7 @@ MOCKPP_PCHAR("vmo.visitablev()-1b"), unsigned, unsigned(321)); +#endif vmo.visitablev(2, 2); vmo.visitablev(1, 19); @@ -304,6 +316,7 @@ MOCKPP_ASSERT_EQUALS(999, vmo.visitable(200, 300)); vmo.visitablev(3, 3); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitablev(4, 4), MOCKPP_PCHAR("vmo.visitablev()-2"), unsigned, @@ -313,6 +326,7 @@ MOCKPP_PCHAR("vmo.visitablev()-3"), unsigned, unsigned(555)); +#endif vmo.verify(); vmb.verify(); @@ -332,6 +346,7 @@ vmo.visitablev(3, 4); vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitablev(9, 9), MOCKPP_PCHAR("vmo.visitablev()-2a"), unsigned, @@ -341,6 +356,7 @@ MOCKPP_PCHAR("vmo.visitablev()-2b"), unsigned, unsigned(321)); +#endif vmo.visitablev(1, 2); vmo.visitablev(2, 3); @@ -360,6 +376,7 @@ vmo.visitablev(3, 4); vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitablev(1, 2), MOCKPP_PCHAR("vmo.visitablev()-3a"), unsigned, @@ -374,6 +391,7 @@ MOCKPP_PCHAR("vmo.visitablev()-3c"), unsigned, unsigned(111)); +#endif vmo.verify(); vmb.verify(); Index: VerifyingTestCase_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VerifyingTestCase_test.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- VerifyingTestCase_test.cpp 15 Oct 2005 15:40:59 -0000 1.16 +++ VerifyingTestCase_test.cpp 28 Nov 2005 19:03:09 -0000 1.17 @@ -124,15 +124,17 @@ mockpp::VerifyingTestCase mtc("dummy"); - try + MOCKPP_TRY { mtc.verify(); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("no sub-objects to verify")) != mockpp::String::npos); } +#endif } Index: AssertMo_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/AssertMo_test.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- AssertMo_test.cpp 26 Nov 2005 17:57:48 -0000 1.25 +++ AssertMo_test.cpp 28 Nov 2005 19:03:09 -0000 1.26 @@ -114,83 +114,95 @@ bool thrown; thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_INCLUDES_MESSAGE(MOCKPP_PCHAR("includes abc xyz"), MOCKPP_PCHAR("abc"), MOCKPP_PCHAR("xyz") ); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("includes abc xyz") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_INCLUDES(MOCKPP_PCHAR("abc"), MOCKPP_PCHAR("xyz") ); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; // use \042 instead of \" because m$vc is too stupid to escape correctly MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("MOCKPP_PCHAR(\042abc\042) <in> MOCKPP_PCHAR(\042xyz\042)") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EXCLUDES_MESSAGE(MOCKPP_PCHAR("excludes abc abc"), MOCKPP_PCHAR("abc"), MOCKPP_PCHAR("abc") ); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("excludes abc abc") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_EXCLUDES(MOCKPP_PCHAR("abc"), MOCKPP_PCHAR("abc") ); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; // use \042 instead of \" because m$vc is too stupid to escape correctly MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("MOCKPP_PCHAR(\042abc\042) <!in> MOCKPP_PCHAR(\042abc\042)") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_STARTSWITH_MESSAGE(MOCKPP_PCHAR("starts with abc xyz"), MOCKPP_PCHAR("abc"), MOCKPP_PCHAR("xyz") ); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("starts with abc xyz") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); thrown = false; - try + MOCKPP_TRY { MOCKPP_ASSERT_STARTSWITH(MOCKPP_PCHAR("abc"), MOCKPP_PCHAR("xyz") ); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ae) { thrown = true; // use \042 instead of \" because m$vc is too stupid to escape correctly MOCKPP_ASSERT_TRUE(MOCKPP_PCHAR("MOCKPP_PCHAR(\042abc\042) <starts> MOCKPP_PCHAR(\042xyz\042)") == ae.getMessage()); } +#endif MOCKPP_ASSERT_TRUE(thrown == true); } @@ -330,25 +342,30 @@ } +#ifndef MOCKPP_NO_EXCEPTIONS static void do_a_throw(unsigned val) { - throw (unsigned) val; + MOCKPP_THROW((unsigned) val); } - +#endif void AssertMo_test::test_throwing() { unsigned ret = 0; +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(do_a_throw(123), MOCKPP_PCHAR("throw 123"), unsigned, 123); +#endif ret = 0; +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING_COND(do_a_throw(321), MOCKPP_PCHAR("throw 321"), unsigned, (ret = exception_object) == 321); +#endif MOCKPP_ASSERT_TRUE(ret == 321); } Index: VisitableMockMethod_1_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockMethod_1_test.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- VisitableMockMethod_1_test.cpp 14 Nov 2005 19:20:35 -0000 1.4 +++ VisitableMockMethod_1_test.cpp 28 Nov 2005 19:03:09 -0000 1.5 @@ -144,17 +144,21 @@ MOCKPP_ASSERT_EQUALS(321, vmo.visitable(1)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitable(2), MOCKPP_PCHAR("vmo.visitable()-1a"), unsigned, unsigned(123)); +#endif MOCKPP_ASSERT_EQUALS(432, vmo.visitable(3)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitable(4), MOCKPP_PCHAR("vmo.visitable()-1b"), unsigned, unsigned(321)); +#endif MOCKPP_ASSERT_EQUALS(123, vmo.visitable(5)); @@ -162,6 +166,7 @@ MOCKPP_ASSERT_EQUALS(666, vmo.visitable(11)); MOCKPP_ASSERT_EQUALS(333, vmo.visitable(13)); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitable(14), MOCKPP_PCHAR("vmo.visitable()-1a"), unsigned, @@ -176,6 +181,7 @@ MOCKPP_PCHAR("vmo.visitable()-1c"), unsigned, unsigned(666)); +#endif vmo.verify(); vmb.verify(); @@ -199,6 +205,7 @@ vmo.visitable(3); vmo.activate(); +#ifndef MOCKPP_NO_EXCEPTIONS MOCKPP_ASSERT_THROWING(vmo.visitable(9), MOCKPP_PCHAR("vmo.visitable()-2a"), unsigned, @@ -208,6 +215,7 @@ MOCKPP_... [truncated message content] |
From: Ewald A. <ewa...@us...> - 2005-11-28 19:03:20
|
Update of /cvsroot/mockpp/mockpp/mockpp/docs/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24721/mockpp/docs/en Modified Files: appendix.docbook Log Message: optionally disable exceptions Index: appendix.docbook =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/docs/en/appendix.docbook,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- appendix.docbook 19 Nov 2005 19:14:29 -0000 1.11 +++ appendix.docbook 28 Nov 2005 19:03:09 -0000 1.12 @@ -53,6 +53,37 @@ </listitem> </varlistentry> + <varlistentry> + <term>--enable-doxygen</term> + <listitem>This option generates and installs the api documentation. + <application>doxygen</application> must be installed in this case. + </listitem> + </varlistentry> + + <varlistentry> + <term>--enable-docbook</term> + <listitem>If you what to generate and install the handbook, you must + provide this parameter. + <application>docbook</application> must be installed in this case. + </listitem> + </varlistentry> + + <varlistentry> + <term>--disable-rtti</term> + <listitem>Some environments don't use runtime type information + to reduce the size of the footprint of the binaries. In this case + the according debugging information is omitted. + </listitem> + </varlistentry> + + <varlistentry> + <term>--disable-exceptions</term> + <listitem>Some environments don't use exceptions for similar reasons. + All features based on try and catch statements don't work in this case + and you must provide your own way to collect the test results. + </listitem> + </varlistentry> + </variablelist> |
From: Ewald A. <ewa...@us...> - 2005-11-27 17:37:18
|
Update of /cvsroot/mockpp/mockpp/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9686/config Added Files: ac_cxx_except.m4 .cvsignore Makefile.am Log Message: new --- NEW FILE: .cvsignore --- Makefile.in --- NEW FILE: Makefile.am --- EXTRA_DIST = ac_cxx_rtti.m4 ac_cxx_except.m4 --- NEW FILE: ac_cxx_except.m4 --- dnl @synopsis AC_CXX_exception from CppUnit dnl dnl If the compiler supports Run-Time Type Identification (typeinfo dnl header and typeid keyword), define HAVE_exception. dnl dnl @version $Id: ac_cxx_except.m4,v 1.1 2005/11/27 17:36:55 ewald-arnold Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN([EA_DISABLE_EXCEPTIONS],[ AC_ARG_ENABLE(exceptions, [ --disable-exceptions disable exception support (no)], [ disable_exceptions=yes ], [ disable_exceptions=no ]) if test "x$disable_exceptions" = xyes; then echo "*******************************************************" echo "** EXCEPTIONS are disabled" echo "*******************************************************" AC_DEFINE(MOCKPP_NO_EXCEPTIONS, 1, [Define to disable exception support.]) CXXFLAGS="$CXXFLAGS -fno-exceptions" else echo "*******************************************************" echo "** EXCEPTIONS are enabled" echo "*******************************************************" AH_TEMPLATE([MOCKPP_NO_EXCEPTIONS], [Define to disable exception support.]) fi # AC_SUBST(MOCKPP_NO_EXCEPTION) ]) |
From: Ewald A. <ewa...@us...> - 2005-11-27 17:35:21
|
Update of /cvsroot/mockpp/mockpp/3party In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9405/3party Added Files: .cvsignore Log Message: import from www.mico.org --- NEW FILE: .cvsignore --- *.xmi Makefile .directory Makefile.in *.~* .libs .deps *.lo *.la *.loT *.old |
From: Ewald A. <ewa...@us...> - 2005-11-27 17:35:18
|
Update of /cvsroot/mockpp/mockpp/3party/ministl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9405/3party/ministl Added Files: .cvsignore algo.h algorithm bool.h bstring.h defalloc.h function function.h list list.h map map.h ministl.h pair pair.h set set.h simplevec.h string vector vector.h Log Message: import from www.mico.org --- NEW FILE: pair.h --- /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * */ #ifndef PAIR_H #define PAIR_H #ifndef __GNUG__ #include <ministl/bool.h> #endif template <class T1, class T2> struct pair { T1 first; T2 second; #if defined(_AIX) && !defined(__GNUG__) // if T? is const xlC goofes about first/second not beeing inited pair() : first (T1()), second (T2()) {} #else pair() {} #endif pair(const T1& a, const T2& b) : first(a), second(b) {} }; template <class T1, class T2> inline bool operator==(const pair<T1, T2>& x, const pair<T1, T2>& y) { return x.first == y.first && x.second == y.second; } template <class T1, class T2> inline bool operator<(const pair<T1, T2>& x, const pair<T1, T2>& y) { return x.first < y.first || (!(y.first < x.first) && x.second < y.second); } template <class T1, class T2> inline pair<T1, T2> make_pair(const T1& x, const T2& y) { return pair<T1, T2>(x, y); } #endif --- NEW FILE: vector.h --- // -*- c++ -*- /* * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send comments and/or bug reports to: * mi...@in... */ #ifndef __ministl_vector_h__ #define __ministl_vector_h__ #include <ministl/ministl.h> #ifndef __GNUG__ #include <ministl/bool.h> #endif #include <ministl/defalloc.h> namespace ministl { template<class T> class vector { public: typedef T* iterator; typedef const T* const_iterator; typedef unsigned long size_type; private: size_type _last, _size; T *_buf; public: const_iterator begin () const { return &_buf[0]; } iterator begin () { return &_buf[0]; } const_iterator end () const { return &_buf[_last]; } iterator end () { return &_buf[_last]; } size_type capacity () const { return _size; } size_type size () const { return _last; } private: static T *alloc (size_type n) { return (T *)::operator new ((size_t)(n * sizeof (T))); } static void dealloc (T *buf) { if (buf) ::operator delete (buf); } // overlapping move to the right static void copy_forward (T* d, const T* sstart, const T* send) { d += send - sstart; while (send != sstart) *--d = *--send; } // overlapping move to the left static void copy_backward (T* d, const T* sstart, const T* send) { for ( ; send != sstart; ++d, ++sstart) *d = *sstart; } static void construct (T *d, const T &t) { new (d) T(t); } static void construct (T *d, const T *sstart, const T *send) { for ( ; sstart != send; ++sstart, ++d) construct (d, *sstart); } static void fill (iterator d, size_type n, const T &t) { for (size_type i = 0; i < n; ++i, ++d) construct (d, t); } void reserve (iterator where, size_type n) { if (_last + n <= _size) { if (where+n < end()) { construct (end(), end()-n, end()); copy_forward (where+n, where, end()-n); destroy (where, where+n); } else { construct (where+n, where, end()); destroy (where, end()); } } else { long sz = _last+n; sz = (_size == 0) ? _max_(sz, 5) : _max_(sz, 2*_size); T *nbuf = alloc (sz); if (_buf) { construct (nbuf, begin(), where); construct (nbuf + (where-begin()) + n, where, end()); destroy (begin(), end()); dealloc (_buf); } _buf = nbuf; _size = sz; } } public: void reserve (size_type sz) { if (_size < sz) { sz = (_size == 0) ? _max_(sz, 5) : _max_(sz, 2*_size); T *nbuf = alloc (sz); if (_buf) { construct (nbuf, begin(), end()); destroy (begin(), end()); dealloc (_buf); } _buf = nbuf; _size = sz; } } vector () : _last (0), _size (0), _buf (0) {} vector (size_type n, const T& t = T()) : _last (0), _size (0), _buf (0) { insert (begin(), n, t); } vector (const_iterator first, const_iterator last) : _last (0), _size (0), _buf (0) { insert (begin(), first, last); } vector (const vector<T> &v) : _last (0), _size (0), _buf (0) { reserve (v._last); construct (begin(), v.begin(), v.end()); _last = v._last; } vector<T> &operator= (const vector<T> &v) { if (this != &v) { destroy (begin(), end()); _last = 0; reserve (v._last); construct (begin(), v.begin(), v.end()); _last = v._last; } return *this; } ~vector () { destroy (begin(), end()); dealloc (_buf); } const T &front () const { ministl_assert (size() > 0); return _buf[0]; } T &front () { ministl_assert (size() > 0); return _buf[0]; } const T &back () const { ministl_assert (size() > 0); return _buf[_last-1]; } T &back () { ministl_assert (size() > 0); return _buf[_last-1]; } bool empty () const { return _last == 0; } void clear () { destroy (begin(), end()); _last = 0; } void push_back (const T &t) { reserve (_last+1); construct (end(), t); ++_last; } void pop_back () { ministl_assert (size() > 0); --_last; destroy (end()); } const T &operator[] (size_type idx) const { ministl_assert (idx < size()); return _buf[idx]; } T &operator[] (size_type idx) { ministl_assert (idx < size()); return _buf[idx]; } iterator insert (iterator pos, const T &t) { ministl_assert (pos <= end()); long at = pos - begin(); reserve (pos, 1); pos = begin()+at; construct (pos, t); ++_last; return pos; } iterator insert (iterator pos, const_iterator first, const_iterator last) { ministl_assert (pos <= end()); long n = last - first; long at = pos - begin(); if (n > 0) { reserve (pos, n); pos = begin()+at; construct (pos, first, last); _last += n; } return pos; } iterator insert (iterator pos, size_type n, const T &t) { ministl_assert (pos <= end()); long at = pos - begin(); if (n > 0) { reserve (pos, n); pos = begin()+at; fill (pos, n, t); _last += n; } return pos; } void erase (iterator first, iterator last) { if (last != first) { copy_backward (first, last, end()); destroy (end() - (last-first), end()); _last -= last - first; } } void erase (iterator pos) { if (pos != end()) { copy_backward (pos, pos+1, end()); destroy (end()-1); --_last; } } }; template<class T> bool operator== (const vector<T> &v1, const vector<T> &v2) { if (v1.size() != v2.size()) return false; for (unsigned long i = 0; i < v1.size(); ++i) { if (!(v1[i] == v2[i])) return false; } return true; } template<class T> bool operator< (const vector<T> &v1, const vector<T> &v2) { unsigned long minlast = _min_ (v1.size(), v2.size()); for (unsigned long i = 0; i < minlast; ++i) { if (v1[i] < v2[i]) return true; if (v2[i] < v1[i]) return false; } return v1.size() < v2.size(); } } // namespace ministl #endif --- NEW FILE: set --- /* * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send comments and/or bug reports to: * mi...@in... */ #include <ministl/set.h> --- NEW FILE: string --- /* * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send comments and/or bug reports to: * mi...@in... */ #include <ministl/bstring.h> --- NEW FILE: algorithm --- /* * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send comments and/or bug reports to: * mi...@in... */ #include <ministl/algo.h> --- NEW FILE: set.h --- // -*- c++ -*- /* * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send comments and/or bug reports to: * mi...@in... */ #ifndef __ministl_set_h__ #define __ministl_set_h__ #include <ministl/ministl.h> #include <ministl/simplevec.h> #include <ministl/function> #include <ministl/pair> #ifndef __GNUG__ #include <ministl/bool.h> #endif template<class vT, class cT> class set; template<class vT, class cT> class setConstIterator; template<class vT, class cT> class setIterator { friend class set<vT,cT>; friend class setConstIterator<vT,cT>; typedef setIterator<vT,cT> my_type; typedef vT value_type; typedef simplevec<value_type *> rep_type; typedef typename rep_type::iterator repiterator; repiterator n; setIterator (repiterator _n) : n (_n) { } public: setIterator () : n (0) { } bool operator== (const my_type &it) const { return it.n == n; } bool operator!= (const my_type &it) const { return !(it.n == n); } my_type operator++ () { ++n; return *this; } my_type operator++ (int) { my_type tmp = *this; ++n; return tmp; } my_type operator-- () { --n; return *this; } my_type operator-- (int) { my_type tmp = *this; --n; return tmp; } value_type &operator* () { return **n; } }; template<class vT, class cT> class setConstIterator { friend class set<vT,cT>; typedef setConstIterator<vT,cT> my_type; typedef vT value_type; typedef simplevec<value_type *> rep_type; typedef typename rep_type::const_iterator repiterator; repiterator n; setConstIterator (repiterator _n) : n (_n) { } public: setConstIterator () : n (0) { } setConstIterator (const setIterator<vT,cT> &i) : n (i.n) { } bool operator== (const my_type &it) const { return it.n == n; } bool operator!= (const my_type &it) const { return !(it.n == n); } my_type operator++ () { ++n; return *this; } my_type operator++ (int) { my_type tmp = *this; ++n; return tmp; } my_type operator-- () { --n; return *this; } my_type operator-- (int) { my_type tmp = *this; --n; return tmp; } const value_type &operator* () const { return **n; } }; template<class valT, class cmpT> class set { public: typedef valT value_type; typedef unsigned long size_type; typedef simplevec<value_type *> rep_type; typedef setIterator<valT, cmpT> iterator; typedef setConstIterator<valT, cmpT> const_iterator; // XXX typedefs done to work around g++ bug typedef pair<iterator, bool> pair_iterator_bool; private: rep_type _ents; cmpT _comp; public: iterator begin () { return iterator (_ents.begin()); } const_iterator begin () const { return const_iterator (_ents.begin()); } iterator end () { return iterator (_ents.end()); } const_iterator end () const { return const_iterator (_ents.end()); } set (const cmpT &comp = cmpT()) : _comp (comp) { } set (const_iterator first, const_iterator last, const cmpT &comp = cmpT()) : _comp (comp) { insert (first, last); } set (const set<valT, cmpT> &m) : _comp (m._comp) { insert (m.begin(), m.end()); } set<valT, cmpT> &operator= (const set<valT, cmpT> &m) { if (this != &m) { _comp = m._comp; erase (begin(), end()); insert (m.begin(), m.end()); } return *this; } ~set () { erase (begin(), end()); } bool empty () const { return _ents.empty (); } size_type size () const { return _ents.size (); } private: // find the iterator position where k should be inserted ... bool lookup (const value_type &k, iterator &it); public: pair_iterator_bool insert (const value_type &v) { iterator i = end(); if (size() > 0 && lookup (v, i)) return pair_iterator_bool (i, false); i = iterator (_ents.insert (i.n, new value_type (v))); return pair_iterator_bool (i, true); } #if 0 iterator insert (iterator pos, const value_type &v) { } #endif void insert (const_iterator first, const_iterator last) { for ( ; first != last; ++first) insert (*first); } void insert (const value_type *first, const value_type *last) { for ( ; first != last; ++first) insert (*first); } void erase (iterator pos) { if (pos != end()) { delete *(pos.n); _ents.erase (pos.n); } } size_type erase (const value_type &k) { iterator i = find (k); if (i == end()) return 0; erase (i); return 1; } void erase (iterator first, iterator last) { for (iterator i = first; i != last; ++i) delete *(i.n); _ents.erase (first.n, last.n); } void clear () { erase (begin(), end()); } iterator find (const value_type &k) { if (size() > 0) { int l = 0; int r = size()-1; do { int m = (l+r) >> 1; if (_comp (*_ents[m], k)) { l = m+1; } else { // if (k == *_ents[m]) if (!_comp (k, *_ents[m])) return iterator (_ents.begin()+m); r = m-1; } } while (l <= r); } return end(); } const_iterator find (const value_type &k) const { if (size() > 0) { int l = 0; int r = size()-1; do { int m = (l+r) >> 1; if (_comp (*_ents[m], k)) { l = m+1; } else { // if (k == *_ents[m]) if (!_comp (k, *_ents[m])) return const_iterator (_ents.begin()+m); r = m-1; } } while (l <= r); } return end(); } size_type count (const value_type &k) const { return find (k) != end() ? 1 : 0; } }; template<class vT, class cT> inline bool set<vT, cT>::lookup (const vT &k, setIterator<vT,cT> &it) { int l = 0; int r = size(); while (l < r) { int m = (l+r) >> 1; ministl_assert (m < r); if (_comp (*_ents[m], k)) { l = m+1; } else { // if (k == *_ents[m]) { if (!_comp (k, *_ents[m])) { it = setIterator<vT,cT> (_ents.begin()+m); return true; } r = m; } } ministl_assert (l == r); it = setIterator<vT,cT> (_ents.begin()+l); return l < (int)size() && // k == *it !_comp (*it, k) && !_comp (k, *it); } template<class vT, class cT> bool operator== (const set<vT,cT> &v1, const set<vT,cT> &v2) { if (v1.size() != v2.size()) return false; typename set<vT,cT>::const_iterator i1 = v1.begin(); typename set<vT,cT>::const_iterator i2 = v2.begin(); for ( ;i1 != v1.end() && i2 != v2.end(); ++i1, ++i2) { if (!(*i1 == *i2)) return false; } return true; } template<class vT, class cT> bool operator< (const set<vT,cT> &v1, const set<vT,cT> &v2) { long minlast = _min_ (v1.size(), v2.size()); typename set<vT,cT>::const_iterator i1 = v1.begin(); typename set<vT,cT>::const_iterator i2 = v2.begin(); for ( ;i1 != v1.end() && i2 != v2.end(); ++i1, ++i2) { if (*i1 < *i2) return true; if (*i2 < *i1) return false; } return v1.size() < v2.size(); } #endif // __ministl_set_h__ --- NEW FILE: function --- /* * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send comments and/or bug reports to: * mi...@in... */ #include <ministl/function.h> --- NEW FILE: list --- /* * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send comments and/or bug reports to: * mi...@in... */ #include <ministl/list.h> --- NEW FILE: bstring.h --- /** ** Copyright (c) 1994-1995 Modena Software Inc., ** ** Permission to use, copy, modify, distribute and sell this software ** and its documentation for any purpose is hereby granted without fee, ** provided that the above copyright notice appear in all copies and ** that both that copyright notice and this permission notice appear ** in supporting documentation. Modena Software, Inc. makes no ** representations about the suitability of this software for any ** purpose. It is provided "as is" without express or implied warranty. ** **/ #ifndef __cplusplus #error Must use C++ for BSTRING.H #endif #ifndef __MBSTRING_H #define __MBSTRING_H [...2575 lines suppressed...] typedef basic_string<char> cstring; typedef basic_string<char> string; //typedef basic_string<wchar_t> wstring; /* The following is a workaround for a compiler bug in some versions of the Apogee compiler. This looks pretty weird, and it shouldn't work, but more obvious constructs cause other error messages.---DRM */ #if 0 inline void destroy(string* pointer) { pointer->~basic_string(); } #endif } // namespace ministl #endif --- NEW FILE: list.h --- // -*- c++ -*- /* * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send comments and/or bug reports to: * mi...@in... */ #ifndef __ministl_list_h__ #define __ministl_list_h__ #include <ministl/ministl.h> #ifndef __GNUG__ #include <ministl/bool.h> #endif template<class T> class listNode { listNode<T> *_prev, *_next; T _data; public: listNode (const T &data = T(), listNode<T> *next = 0, listNode<T> *prev = 0) : _prev (prev), _next (next), _data (data) { } ~listNode () { ministl_assert (!_next && !_prev); } void remove () { if (_prev) _prev->_next = _next; if (_next) _next->_prev = _prev; _next = _prev = 0; } void insert_after (listNode<T> *ln) { ministl_assert (ln); _next = _prev = 0; if (ln->_next) ln->_next->_prev = this; _next = ln->_next; ln->_next = this; _prev = ln; } void insert_before (listNode<T> *ln) { ministl_assert (ln); _next = _prev = 0; if (ln->_prev) ln->_prev->_next = this; _prev = ln->_prev; ln->_prev = this; _next = ln; } const T &data () const { return _data; } T &data () { return _data; } listNode<T> *next () { return _next; } listNode<T> *prev () { return _prev; } }; template<class T> class list; template<class T> class listConstIterator; template<class T> class listIterator { friend class list<T>; friend class listConstIterator<T>; typedef listNode<T> node; node *n; listIterator (node *_n) : n (_n) { } public: listIterator () : n (0) { } bool operator== (const listIterator<T> &it) const { return it.n == n; } bool operator!= (const listIterator<T> &it) const { return !(it.n == n); } listIterator<T> operator++ () { n = n->next(); ministl_assert (n); return *this; } listIterator<T> operator++ (int) { listIterator<T> tmp = *this; n = n->next(); ministl_assert (n); return tmp; } listIterator<T> operator-- () { n = n->prev(); ministl_assert (n); return *this; } listIterator<T> operator-- (int) { listIterator<T> tmp = *this; n = n->prev(); ministl_assert (n); return tmp; } T &operator* () { return n->data(); } }; template<class T> class listConstIterator { friend class list<T>; typedef listNode<T> node; node *n; listConstIterator (node *_n) : n (_n) { } public: listConstIterator () : n (0) { } listConstIterator (const listIterator<T> &i) : n (i.n) { } bool operator== (const listConstIterator<T> &it) const { return it.n == n; } bool operator!= (const listConstIterator<T> &it) const { return !(it.n == n); } listConstIterator<T> operator++ () { n = n->next(); ministl_assert (n); return *this; } listConstIterator<T> operator++ (int) { listConstIterator<T> tmp = *this; n = n->next(); ministl_assert (n); return tmp; } listConstIterator<T> operator-- () { n = n->prev(); ministl_assert (n); return *this; } listConstIterator<T> operator-- (int) { listConstIterator<T> tmp = *this; n = n->prev(); ministl_assert (n); return tmp; } const T &operator* () const { return n->data(); } }; template<class T> class list { typedef listNode<T> node; public: typedef unsigned long size_type; typedef listIterator<T> iterator; typedef listConstIterator<T> const_iterator; private: node *_begin; node *_end; size_type _length; public: #if 0 void __check () { node *n = _begin; while (n->next()) n = n->next(); assert (n == _end); } #endif iterator begin () { return iterator (_begin); } const_iterator begin () const { return const_iterator (_begin); } iterator end () { return iterator (_end); } const_iterator end () const { return const_iterator (_end); } list () : _length (0) { _begin = _end = new node (); } list (size_type n, const T &t = T()) : _length (0) { _begin = _end = new node (); insert (begin(), n, t); } list (const T *first, const T *last) : _length (0) { _begin = _end = new node (); insert (begin(), first, last); } list (const_iterator first, const_iterator last) : _length (0) { _begin = _end = new node (); insert (begin(), first, last); } typedef list<T> list_T; list (const list_T &list_) : _length (0) { _begin = _end = new node (); insert (begin(), list_.begin(), list_.end()); } list<T> &operator= (const list<T> &list_) { if (this != &list_) { erase (begin(), end()); insert (begin(), list_.begin(), list_.end()); } return *this; } ~list () { erase (begin(), end()); delete _end; } T &front () { return _begin->data(); } const T &front () const { return _begin->data(); } T &back () { ministl_assert (_end->prev()); return _end->prev()->data(); } const T &back () const { ministl_assert (_end->prev()); return _end->prev()->data(); } bool empty () const { return _length == 0; } void clear () { erase (begin(), end()); } size_type size () const { return _length; } void push_front (const T &t) { insert (begin(), t); } void pop_front () { ministl_assert (size() > 0); erase (begin()); } void push_back (const T &t) { insert (end(), t); } void pop_back () { ministl_assert (size() > 0); erase (--end()); } iterator insert (iterator pos, const T &t) { node *n = new node (t); n->insert_before (pos.n); if (pos.n == _begin) _begin = n; ++_length; return iterator (n); } void insert (iterator pos, size_type n, const T &t) { for (size_type i = 0; i < n; ++i) insert (pos, t); } void insert (iterator pos, const T *first, const T *last) { for ( ; first != last; ++first) insert (pos, *first); } void insert (iterator pos, const_iterator first, const_iterator last) { for ( ; first != last; ++first) insert (pos, *first); } void erase (iterator pos) { if (pos != end()) { ministl_assert (pos.n != _end); if (pos.n == _begin) _begin = _begin->next(); pos.n->remove (); delete pos.n; pos.n = 0; --_length; } } void erase (iterator first, iterator last) { iterator next; while (first != last) { next = first; ++next; // XXX first must be incremented before erasing! erase (first); first = next; } } }; template<class T> bool operator== (const list<T> &v1, const list<T> &v2) { if (v1.size() != v2.size()) return false; typename list<T>::const_iterator i1 = v1.begin(); typename list<T>::const_iterator i2 = v2.begin(); for ( ;i1 != v1.end() && i2 != v2.end(); ++i1, ++i2) { if (!(*i1 == *i2)) return false; } return true; } template<class T> bool operator< (const list<T> &v1, const list<T> &v2) { long minlast = _min_ (v1.size(), v2.size()); typename list<T>::const_iterator i1 = v1.begin(); typename list<T>::const_iterator i2 = v2.begin(); for ( ;i1 != v1.end() && i2 != v2.end(); ++i1, ++i2) { if (!(*i1 == *i2)) return *i1 < *i2; } return v1.size() < v2.size(); } #endif // __ministl_list_h__ --- NEW FILE: function.h --- /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * */ #ifndef FUNCTION_H #define FUNCTION_H #ifndef __GNUG__ #include <ministl/bool.h> #endif #if 0 template <class T1, class T2> inline bool operator!=(const T1& x, const T2& y) { return !(x == y); } #endif template <class T1, class T2> inline bool operator>(const T1& x, const T2& y) { return y < x; } template <class T1, class T2> inline bool operator<=(const T1& x, const T2& y) { return !(y < x); } template <class T1, class T2> inline bool operator>=(const T1& x, const T2& y) { return !(x < y); } template <class Arg, class Result> struct unary_function { typedef Arg argument_type; typedef Result result_type; }; template <class Arg1, class Arg2, class Result> struct binary_function { typedef Arg1 first_argument_type; typedef Arg2 second_argument_type; typedef Result result_type; }; template <class T> struct plus : binary_function<T, T, T> { T operator()(const T& x, const T& y) const { return x + y; } }; template <class T> struct minus : binary_function<T, T, T> { T operator()(const T& x, const T& y) const { return x - y; } }; template <class T> struct multiplies : binary_function<T, T, T> { T operator()(const T& x, const T& y) const { return x * y; } }; template <class T> struct divides : binary_function<T, T, T> { T operator()(const T& x, const T& y) const { return x / y; } }; template <class T> #ifdef __GNU__ struct modulus { typedef T first_argument_type; typedef T second_argument_type; typedef T result_type; T operator()(const T& x, const T& y) const { return x % y; } }; #else struct modulus : binary_function<T, T, T> { T operator()(const T& x, const T& y) const { return x % y; } }; #endif template <class T> struct negate : unary_function<T, T> { T operator()(const T& x) const { return -x; } }; template <class T> struct equal_to : binary_function<T, T, bool> { bool operator()(const T& x, const T& y) const { return x == y; } }; template <class T> struct not_equal_to : binary_function<T, T, bool> { bool operator()(const T& x, const T& y) const { return x != y; } }; template <class T> struct greater : binary_function<T, T, bool> { bool operator()(const T& x, const T& y) const { return x > y; } }; template <class T> struct less : binary_function<T, T, bool> { bool operator()(const T& x, const T& y) const { return x < y; } }; template <class T> struct greater_equal : binary_function<T, T, bool> { bool operator()(const T& x, const T& y) const { return x >= y; } }; template <class T> struct less_equal : binary_function<T, T, bool> { bool operator()(const T& x, const T& y) const { return x <= y; } }; template <class T> struct logical_and : binary_function<T, T, bool> { bool operator()(const T& x, const T& y) const { return x && y; } }; template <class T> struct logical_or : binary_function<T, T, bool> { bool operator()(const T& x, const T& y) const { return x || y; } }; template <class T> struct logical_not : unary_function<T, bool> { bool operator()(const T& x) const { return !x; } }; template <class Predicate> class unary_negate : public unary_function<typename Predicate::argument_type, bool> { protected: Predicate pred; public: unary_negate(const Predicate& x) : pred(x) {} bool operator()(const typename Predicate::argument_type& x) const { return !pred(x); } }; template <class Predicate> unary_negate<Predicate> not1(const Predicate& pred) { return unary_negate<Predicate>(pred); } template <class Predicate> class binary_negate : public binary_function<typename Predicate::first_argument_type, typename Predicate::second_argument_type, bool> { protected: Predicate pred; public: binary_negate(const Predicate& x) : pred(x) {} bool operator()(const typename Predicate::first_argument_type& x, const typename Predicate::second_argument_type& y) const { return !pred(x, y); } }; template <class Predicate> binary_negate<Predicate> not2(const Predicate& pred) { return binary_negate<Predicate>(pred); } template <class Operation> class binder1st : public unary_function<typename Operation::second_argument_type, typename Operation::result_type> { protected: Operation op; typename Operation::first_argument_type value; public: binder1st(const Operation& x, const typename Operation::first_argument_type& y) : op(x), value(y) {} typename Operation::result_type operator()(const typename Operation::argument_type& x) const { return op(value, x); } }; template <class Operation, class T> binder1st<Operation> bind1st(const Operation& op, const T& x) { return binder1st<Operation>(op, Operation::first_argument_type(x)); } template <class Operation> class binder2nd : public unary_function<typename Operation::first_argument_type, typename Operation::result_type> { protected: Operation op; typename Operation::second_argument_type value; public: binder2nd(const Operation& x, const typename Operation::second_argument_type& y) : op(x), value(y) {} typename Operation::result_type operator()(const typename Operation::argument_type& x) const { return op(x, value); } }; template <class Operation, class T> binder2nd<Operation> bind2nd(const Operation& op, const T& x) { return binder2nd<Operation>(op, Operation::second_argument_type(x)); } template <class Operation1, class Operation2> class unary_compose : public unary_function<typename Operation2::argument_type, typename Operation1::result_type> { protected: Operation1 op1; Operation2 op2; public: unary_compose(const Operation1& x, const Operation2& y) : op1(x), op2(y) {} typename Operation1::result_type operator()(const typename Operation2::argument_type& x) const { return op1(op2(x)); } }; template <class Operation1, class Operation2> unary_compose<Operation1, Operation2> compose1(const Operation1& op1, const Operation2& op2) { return unary_compose<Operation1, Operation2>(op1, op2); } template <class Operation1, class Operation2, class Operation3> class binary_compose : public unary_function<typename Operation2::argument_type, typename Operation1::result_type> { protected: Operation1 op1; Operation2 op2; Operation3 op3; public: binary_compose(const Operation1& x, const Operation2& y, const Operation3& z) : op1(x), op2(y), op3(z) { } typename Operation1::result_type operator()(const typename Operation2::argument_type& x) const { return op1(op2(x), op3(x)); } }; template <class Operation1, class Operation2, class Operation3> binary_compose<Operation1, Operation2, Operation3> compose2(const Operation1& op1, const Operation2& op2, const Operation3& op3) { return binary_compose<Operation1, Operation2, Operation3>(op1, op2, op3); } template <class Arg, class Result> class pointer_to_unary_function : public unary_function<Arg, Result> { protected: Result (*ptr)(Arg); public: pointer_to_unary_function() {} pointer_to_unary_function(Result (*x)(Arg)) : ptr(x) {} Result operator()(Arg x) const { return ptr(x); } }; template <class Arg, class Result> pointer_to_unary_function<Arg, Result> ptr_fun(Result (*x)(Arg)) { return pointer_to_unary_function<Arg, Result>(x); } template <class Arg1, class Arg2, class Result> class pointer_to_binary_function : public binary_function<Arg1, Arg2, Result> { protected: Result (*ptr)(Arg1, Arg2); public: pointer_to_binary_function() {} pointer_to_binary_function(Result (*x)(Arg1, Arg2)) : ptr(x) {} Result operator()(Arg1 x, Arg2 y) const { return ptr(x, y); } }; template <class Arg1, class Arg2, class Result> pointer_to_binary_function<Arg1, Arg2, Result> ptr_fun(Result (*x)(Arg1, Arg2)) { return pointer_to_binary_function<Arg1, Arg2, Result>(x); } #endif --- NEW FILE: bool.h --- // Defining TRUE and FALSE is usually a Bad Idea, // because you will probably be inconsistent with anyone // else who had the same clever idea. // Therefore: DON'T USE THIS FILE. #ifndef _bool_h #define _bool_h 1 // make sure a config.h has been included before #if defined(__GNUG__) || defined(HAVE_BOOL_TYPE) #undef TRUE #undef FALSE #define TRUE true #define FALSE false #else class bool { int rep; public: bool () : rep(0) {} bool (int i) : rep(!!i) {} bool (const bool &b) : rep(b.rep) {} bool &operator= (const bool b) { rep = b.rep; return *this; } bool &operator= (int i) { rep = !!i; return *this; } operator int () { return rep; } operator int() const { return rep; } }; #undef true #undef false #define true (bool(1)) #define false (bool(0)) #endif #endif --- NEW FILE: map --- /* * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send comments and/or bug reports to: * mi...@in... */ #include <ministl/map.h> --- NEW FILE: vector --- /* * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send comments and/or bug reports to: * mi...@in... */ #include <ministl/vector.h> --- NEW FILE: defalloc.h --- /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * */ #ifndef MINISTL_DEFALLOC_H #define MINISTL_DEFALLOC_H template <class T> inline void destroy(T* pointer) { pointer->~T(); } template<> inline void destroy(char*) {} template<> inline void destroy(unsigned char*) {} template<> inline void destroy(short*) {} template<> inline void destroy(unsigned short*) {} template<> inline void destroy(int*) {} template<> inline void destroy(unsigned int*) {} template<> inline void destroy(long*) {} template<> inline void destroy(unsigned long*) {} template<> inline void destroy(float*) {} template<> inline void destroy(double*) {} template<> inline void destroy(char**) {} template<> inline void destroy(unsigned char**) {} template<> inline void destroy(short**) {} template<> inline void destroy(unsigned short**) {} template<> inline void destroy(int**) {} template<> inline void destroy(unsigned int**) {} template<> inline void destroy(long**) {} template<> inline void destroy(unsigned long**) {} template<> inline void destroy(float**) {} template<> inline void destroy(double**) {} template <class T> inline void destroy(T* beg, T* end) { for ( ; beg != end; ++beg) beg->~T(); } template<> inline void destroy(char*, char*) {} template<> inline void destroy(unsigned char*, unsigned char*) {} template<> inline void destroy(short*, short*) {} template<> inline void destroy(unsigned short*, unsigned short*) {} template<> inline void destroy(int*, int*) {} template<> inline void destroy(unsigned int*, unsigned int*) {} template<> inline void destroy(long*, long*) {} template<> inline void destroy(unsigned long*, unsigned long*) {} template<> inline void destroy(float*, float*) {} template<> inline void destroy(double*, double*) {} template<> inline void destroy(char**, char**) {} template<> inline void destroy(unsigned char**, unsigned char**) {} template<> inline void destroy(short**, short**) {} template<> inline void destroy(unsigned short**, unsigned short**) {} template<> inline void destroy(int**, int**) {} template<> inline void destroy(unsigned int**, unsigned int**) {} template<> inline void destroy(long**, long**) {} template<> inline void destroy(unsigned long**, unsigned long**) {} template<> inline void destroy(float**, float**) {} template<> inline void destroy(double**, double**) {} #if defined (__GNUG__) //inline void *operator new(size_t, void *place) { return place; } //inline void *operator new[](size_t, void *place) { return place; } #else #include <new.h> #endif #endif --- NEW FILE: map.h --- // -*- c++ -*- /* * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send comments and/or bug reports to: * mi...@in... */ #ifndef __ministl_map_h__ #define __ministl_map_h__ #include <ministl/ministl.h> #include <ministl/simplevec.h> #include <ministl/function> #include <ministl/pair> #ifndef __GNUG__ #include <ministl/bool.h> #endif template<class kT, class vT, class cT> class map; template<class kT, class vT, class cT> class mapConstIterator; template<class kT, class vT, class cT> class mapIterator { friend class map<kT,vT,cT>; friend class mapConstIterator<kT,vT,cT>; typedef mapIterator<kT,vT,cT> my_type; typedef pair<const kT, vT> value_type; typedef simplevec<value_type *> rep_type; typedef typename rep_type::iterator repiterator; repiterator n; mapIterator (repiterator _n) : n (_n) { } public: mapIterator () : n (0) { } bool operator== (const my_type &it) const { return it.n == n; } bool operator!= (const my_type &it) const { return !(it.n == n); } my_type operator++ () { ++n; return *this; } my_type operator++ (int) { my_type tmp = *this; ++n; return tmp; } my_type operator-- () { --n; return *this; } my_type operator-- (int) { my_type tmp = *this; --n; return tmp; } value_type &operator* () { return **n; } }; template<class kT, class vT, class cT> class mapConstIterator { friend class map<kT,vT,cT>; typedef mapConstIterator<kT,vT,cT> my_type; typedef pair<const kT, vT> value_type; typedef simplevec<value_type *> rep_type; typedef typename rep_type::const_iterator repiterator; repiterator n; mapConstIterator (repiterator _n) : n (_n) { } public: mapConstIterator () : n (0) { } mapConstIterator (const mapIterator<kT,vT,cT> &i) : n (i.n) { } bool operator== (const my_type &it) const { return it.n == n; } bool operator!= (const my_type &it) const { return !(it.n == n); } my_type operator++ () { ++n; return *this; } my_type operator++ (int) { my_type tmp = *this; ++n; return tmp; } my_type operator-- () { --n; return *this; } my_type operator-- (int) { my_type tmp = *this; --n; return tmp; } const value_type &operator* () const { return **n; } }; template<class keyT, class valT, class cmpT> class map { public: typedef keyT key_type; typedef pair<const keyT, valT> value_type; typedef unsigned long size_type; typedef simplevec<value_type *> rep_type; typedef mapIterator<keyT, valT, cmpT> iterator; typedef mapConstIterator<keyT, valT, cmpT> const_iterator; // XXX typedefs done to work around g++ bug typedef pair<iterator, bool> pair_iterator_bool; private: rep_type _ents; cmpT _comp; public: iterator begin () { return iterator (_ents.begin()); } const_iterator begin () const { return const_iterator (_ents.begin()); } iterator end () { return iterator (_ents.end()); } const_iterator end () const { return const_iterator (_ents.end()); } map (const cmpT &comp = cmpT()) : _comp (comp) { } map (const_iterator first, const_iterator last, const cmpT &comp = cmpT()) : _comp (comp) { insert (first, last); } map (const map<keyT, valT, cmpT> &m) : _comp (m._comp) { insert (m.begin(), m.end()); } map<keyT, valT, cmpT> &operator= (const map<keyT, valT, cmpT> &m) { if (this != &m) { _comp = m._comp; erase (begin(), end()); insert (m.begin(), m.end()); } return *this; } ~map () { erase (begin(), end()); } bool empty () const { return _ents.empty (); } size_type size () const { return _ents.size (); } private: // find the iterator position where k should be inserted ... bool lookup (const key_type &k, iterator &it); public: pair_iterator_bool insert (const value_type &v) { iterator i = end(); if (size() > 0 && lookup (v.first, i)) return pair_iterator_bool (i, false); i = iterator (_ents.insert (i.n, new value_type (v))); return pair_iterator_bool (i, true); } #if 0 iterator insert (iterator pos, const value_type &v) { } #endif void insert (const_iterator first, const_iterator last) { for ( ; first != last; ++first) insert (*first); } void insert (const value_type *first, const value_type *last) { for ( ; first != last; ++first) insert (*first); } void erase (iterator pos) { if (pos != end()) { delete *(pos.n); _ents.erase (pos.n); } } size_type erase (const key_type &k) { iterator i = find (k); if (i == end()) return 0; erase (i); return 1; } void erase (iterator first, iterator last) { for (iterator i = first; i != last; ++i) delete *(i.n); _ents.erase (first.n, last.n); } void clear () { erase (begin(), end()); } iterator find (const key_type &k) { if (size() > 0) { int l = 0; int r = size()-1; do { int m = (l+r) >> 1; if (_comp (_ents[m]->first, k)) { l = m+1; } else { // if (k == _ents[m]->first) if (!_comp (k, _ents[m]->first)) return iterator (_ents.begin()+m); r = m-1; } } while (l <= r); } return end(); } const_iterator find (const key_type &k) const { if (size() > 0) { int l = 0; int r = size()-1; do { int m = (l+r) >> 1; if (_comp (_ents[m]->first, k)) { l = m+1; } else { // if (k == _ents[m]->first) if (!_comp (k, _ents[m]->first)) return const_iterator (_ents.begin()+m); r = m-1; } } while (l <= r); } return end(); } size_type count (const key_type &k) const { return find (k) != end() ? 1 : 0; } valT &operator[] (const key_type &k) { iterator i = insert(value_type (k, valT())).first; return (*i).second; } }; template<class kT, class vT, class cT> inline bool map<kT,vT,cT>::lookup (const kT &k, mapIterator<kT,vT,cT> &it) { int l = 0; int r = size(); while (l < r) { int m = (l+r) >> 1; ministl_assert (m < r); if (_comp (_ents[m]->first, k)) { l = m+1; } else { // if (k == _ents[m]->first) { if (!_comp (k, _ents[m]->first)) { it = mapIterator<kT,vT,cT> (_ents.begin()+m); return true; } r = m; } } ministl_assert (l == r); it = mapIterator<kT,vT,cT> (_ents.begin()+l); return l < (int)size() && // (*it).first == k; !_comp ((*it).first, k) && !_comp (k, (*it).first); } template<class kT, class vT, class cT> bool operator== (const map<kT,vT,cT> &v1, const map<kT,vT,cT> &v2) { if (v1.size() != v2.size()) return false; typename map<kT,vT,cT>::const_iterator i1 = v1.begin(); typename map<kT,vT,cT>::const_iterator i2 = v2.begin(); for ( ;i1 != v1.end() && i2 != v2.end(); ++i1, ++i2) { if (!(*i1 == *i2)) return false; } return true; } template<class kT, class vT, class cT> bool operator< (const map<kT,vT,cT> &v1, const map<kT,vT,cT> &v2) { long minlast = _min_ (v1.size(), v2.size()); typename map<kT,vT,cT>::const_iterator i1 = v1.begin(); typename map<kT,vT,cT>::const_iterator i2 = v2.begin(); for ( ;i1 != v1.end() && i2 != v2.end(); ++i1, ++i2) { if (*i1 < *i2) return true; if (*i2 < *i1) return false; } return v1.size() < v2.size(); } #endif // __ministl_map_h__ --- NEW FILE: algo.h --- /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * */ #ifndef ALGO_H #define ALGO_H #include <stdlib.h> #ifndef __GNUG__ #include <ministl/bool.h> #endif #include <ministl/pair> template <class InputIterator, class Function> Function for_each(InputIterator first, InputIterator last, Function f) { while (first != last) f(*first++); return f; } template <class InputIterator, class T> InputIterator find(InputIterator first, InputIterator last, const T& value) { while (first != last && *first != value) ++first; return first; } template <class InputIterator, class Predicate> InputIterator find_if(InputIterator first, InputIterator last, Predicate pred) { while (first != last && !pred(*first)) ++first; return first; } template <class ForwardIterator> ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last) { if (first == last) return last; ForwardIterator next = first; while(++next != last) { if (*first == *next) return first; first = next; } return last; } template <class ForwardIterator, class BinaryPredicate> ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate binary_pred) { if (first == last) return last; ForwardIterator next = first; while(++next != last) { if (binary_pred(*first, *next)) return first; first = next; } return last; } template <class InputIterator, class T, class Size> void count(InputIterator first, InputIterator last, const T& value, Size& n) { while (first != last) if (*first++ == value) ++n; } template <class InputIterator, class Predicate, class Size> void count_if(InputIterator first, InputIterator last, Predicate pred, Size& n) { while (first != last) if (pred(*first++)) ++n; } #endif --- NEW FILE: pair --- /* * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send comments and/or bug reports to: * mi...@in... */ #include <ministl/pair.h> --- NEW FILE: simplevec.h --- // -*- c++ -*- /* * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send comments and/or bug reports to: * mi...@in... */ #ifndef __ministl_simplevec_h__ #define __ministl_simplevec_h__ #include <ministl/ministl.h> #ifndef __GNUG__ #include <ministl/bool.h> #endif #include <ministl/defalloc.h> template<class T> class simplevec { public: typedef T* iterator; typedef const T* const_iterator; typedef unsigned long size_type; private: size_type _last, _size; T *_buf; public: const_iterator begin () const { return &_buf[0]; } iterator begin () { return &_buf[0]; } const_iterator end () const { return &_buf[_last]; } iterator end () { return &_buf[_last]; } size_type capacity () const { return _size; } size_type size () const { return _last; } private: static T *alloc (size_type n) { return (T *)::operator new ((size_t)(n * sizeof (T))); } static void dealloc (T *buf) { if (buf) ::operator delete (buf); } void reserve (iterator where, size_type n) { if (_last + n <= _size) { memmove (where+n, where, (end()-where)*sizeof(T)); } else { long sz = _last+n; sz = (_size == 0) ? _max_(sz, 5) : _max_(sz, 2*_size); T *nbuf = alloc (sz); if (_buf) { memcpy (nbuf, begin(), (where-begin())*sizeof(T)); memcpy (nbuf + (where-begin()) + n, where, (end()-where)*sizeof(T)); dealloc (_buf); } _buf = nbuf; _size = sz; } } public: void reserve (size_type sz) { if (_size < sz) { sz = (_size == 0) ? _max_(sz, 5)... [truncated message content] |
From: Ewald A. <ewa...@us...> - 2005-11-27 17:33:55
|
Update of /cvsroot/mockpp/mockpp/3party/ministl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9138/3party/ministl Log Message: Directory /cvsroot/mockpp/mockpp/3party/ministl added to the repository |
Update of /cvsroot/mockpp/mockpp/mockpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7837/mockpp/tests Modified Files: AbstractDynamicChainingMock_test.cpp AbstractInvocationDispatcher_test.cpp ChainableMockMethod_1_test.cpp ChainableMockMethod_2_test.cpp ChainableMockMethod_test.cpp ChainableMockObject_1_test.cpp ChainableMockObject_1_void_test.cpp ChainableMockObject_2_test.cpp ChainableMockObject_2_void_test.cpp ChainableMockObject_3_test.cpp ChainableMockObject_3_void_test.cpp ChainableMockObject_4_test.cpp ChainableMockObject_4_void_test.cpp ChainableMockObject_5_test.cpp ChainableMockObject_5_void_test.cpp ChainableMockObject_test.cpp ChainableMockObject_void_test.cpp ChainingMockBuilder_test.cpp InvokeAtLeastMatcher_test.cpp InvokeAtLeastOnceMatcher_test.cpp InvokeAtMostMatcher_test.cpp InvokeCountMatcher_test.cpp InvokeOnceMatcher_test.cpp InvokedAfterMatcher_test.cpp InvokedBeforeMatcher_test.cpp InvokedRecorder_test.cpp StubSequence_test.cpp TestFailureMatcher_test.cpp TestFailureStub_test.cpp ThrowStub_test.cpp TypelessStubSequence_test.cpp VerifyingTestCaller_test.cpp compilecheck.cpp mockpp_pti_test.cpp Log Message: optionally disable exceptions Index: ChainableMockObject_5_void_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockObject_5_void_test.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- ChainableMockObject_5_void_test.cpp 15 Oct 2005 15:40:58 -0000 1.13 +++ ChainableMockObject_5_void_test.cpp 27 Nov 2005 17:27:57 -0000 1.14 @@ -305,35 +305,41 @@ mockpp::eq( (unsigned int) 21)) .will(mockpp::throwException<void, int>(54321)); - try + MOCKPP_TRY { mcm.chainable_i(12, 23, 34, 45, 56); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(int i) { MOCKPP_ASSERT_TRUE(i == 12345); } +#endif - try + MOCKPP_TRY { mcm.chainable_i(65, 54, 43, 32, 21); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(int i) { MOCKPP_ASSERT_TRUE(i == 54321); } +#endif - try + MOCKPP_TRY { mcm.chainable_i(1, 2, 3, 4, 5); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } Index: ChainableMockObject_4_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockObject_4_test.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ChainableMockObject_4_test.cpp 26 Nov 2005 17:57:48 -0000 1.10 +++ ChainableMockObject_4_test.cpp 27 Nov 2005 17:27:57 -0000 1.11 @@ -123,15 +123,17 @@ MOCKPP_ASSERT_TRUE(mcm.chainable(12, 34, 56, 78) == 12345678); MOCKPP_ASSERT_TRUE(mcm.chainable(87, 65, 43, 21) == 87654321); - try + MOCKPP_TRY { mcm.chainable(1, 2, 3, 4); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } Index: TestFailureMatcher_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/TestFailureMatcher_test.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- TestFailureMatcher_test.cpp 15 Oct 2005 15:40:59 -0000 1.8 +++ TestFailureMatcher_test.cpp 27 Nov 2005 17:27:57 -0000 1.9 @@ -63,12 +63,13 @@ { mockpp::TestFailureMatcher tfm (MOCKPP_PCHAR("knorxi")); - try + MOCKPP_TRY { tfm.incInvoked(); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("knorxi")) @@ -79,6 +80,7 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif mockpp::String s = MOCKPP_PCHAR("hallo"); MOCKPP_ASSERT_TRUE(tfm.describeTo(s) == MOCKPP_PCHAR("halloknorxi")); Index: InvokedRecorder_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/InvokedRecorder_test.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- InvokedRecorder_test.cpp 15 Oct 2005 15:40:58 -0000 1.9 +++ InvokedRecorder_test.cpp 27 Nov 2005 17:27:57 -0000 1.10 @@ -62,12 +62,13 @@ { mockpp::InvokedRecorder ir; - try + MOCKPP_TRY { ir.verifyHasBeenInvoked(); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("was not invoked")) @@ -78,6 +79,7 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif MOCKPP_ASSERT_TRUE(ir.hasBeenInvoked() == false); MOCKPP_ASSERT_TRUE(ir.getInvocationCount() == 0); @@ -98,12 +100,13 @@ ir.verifyHasBeenInvoked(); ir.verifyHasBeenInvokedExactly(1); - try + MOCKPP_TRY { ir.verifyHasBeenInvokedExactly(2); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("number of times:")) @@ -114,6 +117,7 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif } Index: mockpp_pti_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/mockpp_pti_test.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- mockpp_pti_test.cpp 15 Oct 2005 15:40:59 -0000 1.7 +++ mockpp_pti_test.cpp 27 Nov 2005 17:27:57 -0000 1.8 @@ -47,6 +47,8 @@ #include <cppunit/extensions/HelperMacros.h> +#ifndef MOCKPP_NO_EXCEPTIONS + typedef mockpp::Invocation1<int> Setter1Invocation; #if 1 @@ -389,8 +391,9 @@ MOCKPP_ASSERT_TRUE(stub->invoked == true); } - } // ns +#endif // MOCKPP_NO_EXCEPTIONS + #endif // HAVE_CPPUNIT Index: InvokedBeforeMatcher_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/InvokedBeforeMatcher_test.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- InvokedBeforeMatcher_test.cpp 15 Oct 2005 15:40:58 -0000 1.5 +++ InvokedBeforeMatcher_test.cpp 27 Nov 2005 17:27:57 -0000 1.6 @@ -80,12 +80,13 @@ MOCKPP_ASSERT_TRUE(iam.describeTo(s) == (MOCKPP_PCHAR("hallobefore beforematch (invoked)"))); MOCKPP_ASSERT_TRUE(s == (MOCKPP_PCHAR("hallobefore beforematch (invoked)"))); - try + MOCKPP_TRY { iam.incInvoked(1); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("called out of order")) @@ -96,6 +97,7 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif } Index: InvokeAtMostMatcher_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/InvokeAtMostMatcher_test.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- InvokeAtMostMatcher_test.cpp 15 Oct 2005 15:40:58 -0000 1.7 +++ InvokeAtMostMatcher_test.cpp 27 Nov 2005 17:27:57 -0000 1.8 @@ -82,12 +82,13 @@ ir.incInvoked(); MOCKPP_ASSERT_TRUE(ir.matches() == false); - try + MOCKPP_TRY { ir.verify(); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("too often")) @@ -98,6 +99,7 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif s = MOCKPP_PCHAR("hallo"); MOCKPP_ASSERT_TRUE(ir.describeTo(s).find(MOCKPP_PCHAR("at most")) != mockpp::String::npos); Index: ChainableMockObject_void_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockObject_void_test.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ChainableMockObject_void_test.cpp 13 Nov 2005 11:53:18 -0000 1.11 +++ ChainableMockObject_void_test.cpp 27 Nov 2005 17:27:57 -0000 1.12 @@ -105,16 +105,17 @@ MOCKPP_CHAINER_FOR(MyChainableMockObject_void, chainable) chain(&mcm); - try + MOCKPP_TRY { mcm.chainable(); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected")) != mockpp::String::npos); } - +#endif mcm.verify(); } @@ -128,16 +129,18 @@ MOCKPP_ASSERT_TRUE(&mbd == cm.lookupID(MOCKPP_PCHAR("first-name"))->getBuilder()); MOCKPP_ASSERT_TRUE(&mbd == cm.lookupID(MOCKPP_PCHAR("second-name"))->getBuilder()); - try + MOCKPP_TRY { cm.registerUniqueID(MOCKPP_PCHAR("second-name"), 0); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch ( const mockpp::AssertionFailedError &ae ) { MOCKPP_ASSERT_TRUE(ae.getMessage().find(MOCKPP_PCHAR( "duplicate invocation named" )) != mockpp::String::npos); } +#endif cm.reset(); MOCKPP_ASSERT_TRUE(0 == cm.lookupID(MOCKPP_PCHAR("second-name"))); Index: StubSequence_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/StubSequence_test.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- StubSequence_test.cpp 26 Nov 2005 17:57:48 -0000 1.15 +++ StubSequence_test.cpp 27 Nov 2005 17:27:57 -0000 1.16 @@ -103,12 +103,13 @@ val = ss.invoke((int) 1); MOCKPP_ASSERT_TRUE(val == 56); - try + MOCKPP_TRY { ss.invoke((int)1); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("no more stubs")) @@ -119,6 +120,7 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif } Index: ThrowStub_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ThrowStub_test.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ThrowStub_test.cpp 26 Nov 2005 17:57:48 -0000 1.12 +++ ThrowStub_test.cpp 27 Nov 2005 17:27:57 -0000 1.13 @@ -87,12 +87,13 @@ { mockpp::ThrowableItem it ( mockpp::make_throwable( MOCKPP_STL::string( "my-item" ) ) ); mockpp::ThrowStub<int> ts( it ); - try + MOCKPP_TRY { ts.typelessInvoke(); MOCKPP_FAIL( MOCKPP_PCHAR( "Did not throw the exception" ) ); } +#ifndef MOCKPP_NO_EXCEPTIONS catch ( MOCKPP_STL::string & s ) { MOCKPP_ASSERT_TRUE( s == "my-item" ); @@ -102,6 +103,7 @@ { MOCKPP_FAIL( MOCKPP_PCHAR( "Caught unexpected exception" ) ); } +#endif } @@ -116,6 +118,7 @@ MOCKPP_FAIL( MOCKPP_PCHAR( "Did not throw the exception" ) ); } +#ifndef MOCKPP_NO_EXCEPTIONS catch ( MOCKPP_STL::string & s ) { MOCKPP_ASSERT_TRUE( s == "my-item" ); @@ -125,6 +128,7 @@ { MOCKPP_FAIL( MOCKPP_PCHAR( "Caught unexpected exception" ) ); } +#endif } @@ -133,12 +137,13 @@ mockpp::ThrowableItem it; it.take( MOCKPP_STL::string( "my-item" ) ); mockpp::ThrowStub<void> ts( it ); - try + MOCKPP_TRY { ts.typelessInvoke(); MOCKPP_FAIL( MOCKPP_PCHAR( "Did not throw the exception" ) ); } +#ifndef MOCKPP_NO_EXCEPTIONS catch ( MOCKPP_STL::string & s ) { MOCKPP_ASSERT_TRUE( s == "my-item" ); @@ -148,6 +153,7 @@ { MOCKPP_FAIL( MOCKPP_PCHAR( "Caught unexpected exception" ) ); } +#endif } Index: ChainableMockObject_2_void_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockObject_2_void_test.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ChainableMockObject_2_void_test.cpp 26 Nov 2005 17:57:48 -0000 1.11 +++ ChainableMockObject_2_void_test.cpp 27 Nov 2005 17:27:57 -0000 1.12 @@ -122,35 +122,41 @@ mockpp::eq( (unsigned int) 21)) .will(mockpp::throwException<void, int>(21)); - try + MOCKPP_TRY { mcm.chainable(12, 23); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(int i) { MOCKPP_ASSERT_TRUE(i == 12); } +#endif - try + MOCKPP_TRY { mcm.chainable(32, 21); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(int i) { MOCKPP_ASSERT_TRUE(i == 21); } +#endif - try + MOCKPP_TRY { mcm.chainable(1, 2); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } Index: ChainableMockObject_5_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockObject_5_test.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ChainableMockObject_5_test.cpp 18 Oct 2005 20:03:54 -0000 1.11 +++ ChainableMockObject_5_test.cpp 27 Nov 2005 17:27:57 -0000 1.12 @@ -300,15 +300,17 @@ MOCKPP_ASSERT_TRUE(mcm.chainable_i(12, 23, 34, 45, 56) == 12345); MOCKPP_ASSERT_TRUE(mcm.chainable_i(65, 54, 43, 32, 21) == 54321); - try + MOCKPP_TRY { mcm.chainable_i(1, 2, 3, 4, 5); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } Index: ChainableMockObject_1_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockObject_1_test.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ChainableMockObject_1_test.cpp 26 Nov 2005 17:57:48 -0000 1.11 +++ ChainableMockObject_1_test.cpp 27 Nov 2005 17:27:57 -0000 1.12 @@ -117,15 +117,17 @@ MOCKPP_ASSERT_TRUE(mcm.chainable(12) == 21); MOCKPP_ASSERT_TRUE(mcm.chainable(34) == 43); - try + MOCKPP_TRY { mcm.chainable(56); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } Index: AbstractInvocationDispatcher_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/AbstractInvocationDispatcher_test.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- AbstractInvocationDispatcher_test.cpp 26 Nov 2005 20:16:55 -0000 1.22 +++ AbstractInvocationDispatcher_test.cpp 27 Nov 2005 17:27:57 -0000 1.23 @@ -143,16 +143,18 @@ TInvok *ti = new TInvok(); ti->match_result = false; aid.add(ti); - try + MOCKPP_TRY { aid.dispatch(ginv); MOCKPP_ASSERT_TRUE(false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch ( mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find (MOCKPP_PCHAR("unexpected")) != mockpp::String::npos); } +#endif } Index: ChainableMockMethod_1_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockMethod_1_test.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ChainableMockMethod_1_test.cpp 15 Nov 2005 19:42:18 -0000 1.10 +++ ChainableMockMethod_1_test.cpp 27 Nov 2005 17:27:57 -0000 1.11 @@ -121,15 +121,18 @@ MOCKPP_ASSERT_TRUE(mcm.chainable(12) == 21); MOCKPP_ASSERT_TRUE(mcm.chainable(34) == 43); - try + MOCKPP_TRY { mcm.chainable(56); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } + +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } @@ -156,15 +159,17 @@ mcm.chainablev(34); MOCKPP_ASSERT_EQUALS(2u, counter); - try + MOCKPP_TRY { mcm.chainablev(56); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } Index: ChainableMockObject_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockObject_test.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- ChainableMockObject_test.cpp 13 Nov 2005 11:53:18 -0000 1.23 +++ ChainableMockObject_test.cpp 27 Nov 2005 17:27:57 -0000 1.24 @@ -127,16 +127,18 @@ mcm.addPendingRecorder(MOCKPP_PCHAR("id-1"), 0); mcm.addPendingRecorder(MOCKPP_PCHAR("id-2"), 0); - try + MOCKPP_TRY { mcm.checkPendingRecorders(); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("id-1")) != mockpp::String::npos); MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("id-2")) != mockpp::String::npos); } +#endif } @@ -169,15 +171,17 @@ MOCKPP_CHAINER_FOR(MyChainableMockObject, chainable_a) chain(&mcm); - try + MOCKPP_TRY { mcm.chainable_a(); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected")) != mockpp::String::npos); } +#endif mcm.verify(); } @@ -224,16 +228,18 @@ MOCKPP_ASSERT_TRUE(&mbd1 == cm.lookupID(MOCKPP_PCHAR("first-name"))->getBuilder()); MOCKPP_ASSERT_TRUE(&mbd2 == cm.lookupID(MOCKPP_PCHAR("second-name"))->getBuilder()); - try + MOCKPP_TRY { cm.registerUniqueID(MOCKPP_PCHAR("second-name"), 0); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch ( const mockpp::AssertionFailedError &ae ) { MOCKPP_ASSERT_TRUE(ae.getMessage().find(MOCKPP_PCHAR( "duplicate invocation named" )) != mockpp::String::npos); } +#endif cm.reset(); MOCKPP_ASSERT_TRUE(0 == cm.lookupID(MOCKPP_PCHAR("second-name"))); @@ -332,11 +338,12 @@ .will(mockpp::returnValue<int>(456)) .id(MOCKPP_PCHAR("chainable-b")); - try + MOCKPP_TRY { mcm.chainable_a(); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { mockpp::String s = ex.getMessage(); @@ -344,6 +351,7 @@ MOCKPP_ASSERT_TRUE(s.find(MOCKPP_PCHAR("(not invoked)")) != mockpp::String::npos); MOCKPP_ASSERT_TRUE(s.find(MOCKPP_PCHAR("chainable-b")) != mockpp::String::npos); } +#endif } @@ -438,11 +446,12 @@ .id(MOCKPP_PCHAR("chainable-b")); MOCKPP_ASSERT_TRUE(mcm.chainable_b() == 456); - try + MOCKPP_TRY { mcm.chainable_a(); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { mockpp::String s = ex.getMessage(); @@ -450,6 +459,7 @@ MOCKPP_ASSERT_TRUE(s.find(MOCKPP_PCHAR("before")) != mockpp::String::npos); MOCKPP_ASSERT_TRUE(s.find(MOCKPP_PCHAR("chainable-b")) != mockpp::String::npos); } +#endif } Index: ChainableMockObject_3_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockObject_3_test.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ChainableMockObject_3_test.cpp 26 Nov 2005 17:57:48 -0000 1.9 +++ ChainableMockObject_3_test.cpp 27 Nov 2005 17:27:57 -0000 1.10 @@ -120,15 +120,17 @@ MOCKPP_ASSERT_TRUE(mcm.chainable(12, 34, 56) == 123456); MOCKPP_ASSERT_TRUE(mcm.chainable(65, 43, 21) == 654321); - try + MOCKPP_TRY { mcm.chainable(1, 2, 3); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } Index: ChainableMockObject_4_void_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockObject_4_void_test.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ChainableMockObject_4_void_test.cpp 26 Nov 2005 17:57:48 -0000 1.11 +++ ChainableMockObject_4_void_test.cpp 27 Nov 2005 17:27:57 -0000 1.12 @@ -126,35 +126,41 @@ mockpp::eq( (unsigned int) 21)) .will(mockpp::throwException<void, int>(4321)); - try + MOCKPP_TRY { mcm.chainable(12, 23, 34, 45); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(int i) { MOCKPP_ASSERT_TRUE(i == 1234); } +#endif - try + MOCKPP_TRY { mcm.chainable(54, 43, 32, 21); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(int i) { MOCKPP_ASSERT_TRUE(i == 4321); } +#endif - try + MOCKPP_TRY { mcm.chainable(1, 2, 3, 4); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } Index: compilecheck.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/compilecheck.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- compilecheck.cpp 27 Feb 2005 11:48:16 -0000 1.23 +++ compilecheck.cpp 27 Nov 2005 17:27:57 -0000 1.24 @@ -64,7 +64,7 @@ virtual void verify() { - // throw AssertionFailedError(); + // MOCKPP_THROW(AssertionFailedError()); } }; @@ -99,7 +99,7 @@ virtual void verify() { - // throw AssertionFailedException(); + // MOCKPP_THROW(AssertionFailedException()); } }; @@ -142,7 +142,7 @@ virtual void verify() { - // throw AssertionFailedException(); + // MOCKPP_THROW(AssertionFailedException()); } }; @@ -312,7 +312,7 @@ try { std::cout << "throw?\n"; - throw ex; + MOCKPP_THROW(ex); } catch(std::exception *ex) { Index: AbstractDynamicChainingMock_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/AbstractDynamicChainingMock_test.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- AbstractDynamicChainingMock_test.cpp 18 Oct 2005 20:03:53 -0000 1.32 +++ AbstractDynamicChainingMock_test.cpp 27 Nov 2005 17:27:57 -0000 1.33 @@ -264,18 +264,19 @@ md1->enable_except = false; cmd.verify(); - try + MOCKPP_TRY { md1->enable_except = true; cmd.verify(); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("did not throw the exception"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ex ) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("dummy-verify")) != mockpp::String::npos ); MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("adc-name")) != mockpp::String::npos ); } - +#endif md1->enable_except = false; cmd.verify(); } @@ -308,29 +309,33 @@ md1->invocation_result = 5; MOCKPP_ASSERT_TRUE(cmd.invoke(inv) == 5); - try + MOCKPP_TRY { md1->enable_except = true; cmd.invoke(inv); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("did not throw the exception"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ex ) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("invoke-fail")) != mockpp::String::npos ); MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("adc-name")) != mockpp::String::npos ); } +#endif md1->enable_except = false; - try + MOCKPP_TRY { cmd.invoke(inv); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("did not throw the exception"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ex ) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("invoke-fail")) != mockpp::String::npos ); MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("adc-name")) != mockpp::String::npos ); } +#endif cmd.reset(); cmd.invoke(inv); @@ -381,30 +386,34 @@ MOCKPP_ASSERT_TRUE(md1->is_invoke == true); MOCKPP_ASSERT_TRUE(store->invoked == false); - try + MOCKPP_TRY { md1->enable_except = true; cmd.void_invoke(inv); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("did not throw the exception"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ex ) { mockpp::String s = ex.getMessage(); MOCKPP_ASSERT_TRUE(s.find(MOCKPP_PCHAR("invoke-fail")) != mockpp::String::npos ); MOCKPP_ASSERT_TRUE(s.find(MOCKPP_PCHAR("adc-name")) != mockpp::String::npos ); } +#endif md1->enable_except = false; - try + MOCKPP_TRY { cmd.void_invoke(inv); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("did not throw the exception"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch (mockpp::AssertionFailedError &ex ) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("invoke-fail")) != mockpp::String::npos ); MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("adc-name")) != mockpp::String::npos ); } +#endif cmd.reset(); cmd.void_invoke(inv); Index: ChainingMockBuilder_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainingMockBuilder_test.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- ChainingMockBuilder_test.cpp 26 Nov 2005 17:57:48 -0000 1.20 +++ ChainingMockBuilder_test.cpp 27 Nov 2005 17:27:57 -0000 1.21 @@ -261,29 +261,32 @@ cm.lookupID(MOCKPP_PCHAR("first-name")); cm.lookupID(MOCKPP_PCHAR("second-name")); - try + MOCKPP_TRY { cm.registerUniqueID(MOCKPP_PCHAR("second-name"), 0); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch ( const mockpp::AssertionFailedError &ae ) { MOCKPP_ASSERT_TRUE(ae.getMessage().find(MOCKPP_PCHAR( "duplicate invocation named" )) != mockpp::String::npos); } - +#endif cm.reset(); - try + MOCKPP_TRY { cm.lookupID(MOCKPP_PCHAR("second-name")); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch ( const mockpp::AssertionFailedError &ae ) { MOCKPP_ASSERT_TRUE(ae.getMessage().find(MOCKPP_PCHAR( "no expected invocation named" )) != mockpp::String::npos); } +#endif } Index: InvokeAtLeastMatcher_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/InvokeAtLeastMatcher_test.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- InvokeAtLeastMatcher_test.cpp 15 Oct 2005 15:40:58 -0000 1.5 +++ InvokeAtLeastMatcher_test.cpp 27 Nov 2005 17:27:57 -0000 1.6 @@ -65,12 +65,13 @@ MOCKPP_ASSERT_TRUE(ir.matches() == true); MOCKPP_ASSERT_TRUE(ir.hasBeenInvoked() == false); - try + MOCKPP_TRY { ir.verify(); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("not invoked often enough")) @@ -81,16 +82,18 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif ir.incInvoked(); MOCKPP_ASSERT_TRUE(ir.hasBeenInvoked() == true); - try + MOCKPP_TRY { ir.verify(); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("not invoked often enough")) @@ -101,6 +104,7 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif MOCKPP_ASSERT_TRUE(ir.matches() == true); MOCKPP_ASSERT_TRUE(ir.hasBeenInvoked() == true); Index: InvokeAtLeastOnceMatcher_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/InvokeAtLeastOnceMatcher_test.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- InvokeAtLeastOnceMatcher_test.cpp 15 Oct 2005 15:40:58 -0000 1.8 +++ InvokeAtLeastOnceMatcher_test.cpp 27 Nov 2005 17:27:57 -0000 1.9 @@ -63,12 +63,13 @@ mockpp::InvokeAtLeastOnceMatcher ir; MOCKPP_ASSERT_TRUE(ir.matches() == true); - try + MOCKPP_TRY { ir.verify(); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("was not invoked")) @@ -79,6 +80,7 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif mockpp::String s = MOCKPP_PCHAR("hallo"); MOCKPP_ASSERT_TRUE(ir.describeTo(s).find(MOCKPP_PCHAR("at least once")) != mockpp::String::npos); Index: ChainableMockObject_1_void_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockObject_1_void_test.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- ChainableMockObject_1_void_test.cpp 26 Nov 2005 17:57:48 -0000 1.14 +++ ChainableMockObject_1_void_test.cpp 27 Nov 2005 17:27:57 -0000 1.15 @@ -120,35 +120,41 @@ .with(mockpp::eq( (unsigned int) 21)) .will(mockpp::throwException<void, int>(12)); - try + MOCKPP_TRY { mcm.chainable(12); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(int i) { MOCKPP_ASSERT_TRUE(i == 21); } +#endif - try + MOCKPP_TRY { mcm.chainable(21); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(int i) { MOCKPP_ASSERT_TRUE(i == 12); } +#endif - try + MOCKPP_TRY { mcm.chainable(9); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } Index: TypelessStubSequence_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/TypelessStubSequence_test.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- TypelessStubSequence_test.cpp 26 Nov 2005 17:57:48 -0000 1.5 +++ TypelessStubSequence_test.cpp 27 Nov 2005 17:27:57 -0000 1.6 @@ -103,12 +103,13 @@ val = ss.typelessInvoke(); MOCKPP_ASSERT_TRUE(val == 56); - try + MOCKPP_TRY { ss.typelessInvoke(); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("no more stubs")) @@ -119,6 +120,7 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif } Index: ChainableMockMethod_2_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockMethod_2_test.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ChainableMockMethod_2_test.cpp 18 Nov 2005 10:49:31 -0000 1.9 +++ ChainableMockMethod_2_test.cpp 27 Nov 2005 17:27:57 -0000 1.10 @@ -122,15 +122,17 @@ MOCKPP_ASSERT_TRUE(mcm.chainable(12, 23) == 21); MOCKPP_ASSERT_TRUE(mcm.chainable(34, 45) == 43); - try + MOCKPP_TRY { mcm.chainable(56, 67); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } @@ -164,15 +166,17 @@ mcm.chainablev(34, 45); MOCKPP_ASSERT_EQUALS(2u, counter); - try + MOCKPP_TRY { mcm.chainablev(56, 67); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } Index: InvokedAfterMatcher_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/InvokedAfterMatcher_test.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- InvokedAfterMatcher_test.cpp 15 Oct 2005 15:40:58 -0000 1.8 +++ InvokedAfterMatcher_test.cpp 27 Nov 2005 17:27:57 -0000 1.9 @@ -66,12 +66,13 @@ MOCKPP_ASSERT_TRUE(iam.matches(1) == false); MOCKPP_ASSERT_TRUE(iam.hasDescription() == true); - try + MOCKPP_TRY { iam.incInvoked(1); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("called out of order")) @@ -82,6 +83,7 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif mockpp::String s = MOCKPP_PCHAR("hallo"); MOCKPP_ASSERT_TRUE(iam.describeTo(s) == MOCKPP_PCHAR("halloafter aftermatch (not invoked)")); Index: TestFailureStub_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/TestFailureStub_test.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- TestFailureStub_test.cpp 30 Dec 2004 20:54:06 -0000 1.6 +++ TestFailureStub_test.cpp 27 Nov 2005 17:27:57 -0000 1.7 @@ -75,12 +75,13 @@ void TestFailureStub_test::test_invoke() { mockpp::TestFailureStub<int, int> ts(MOCKPP_PCHAR("my-description")); - try + MOCKPP_TRY { ts.invoke((int)1); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("my-description")) @@ -91,6 +92,7 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif } Index: InvokeOnceMatcher_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/InvokeOnceMatcher_test.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- InvokeOnceMatcher_test.cpp 15 Oct 2005 15:40:58 -0000 1.8 +++ InvokeOnceMatcher_test.cpp 27 Nov 2005 17:27:57 -0000 1.9 @@ -62,12 +62,13 @@ { mockpp::InvokeOnceMatcher ir; - try + MOCKPP_TRY { ir.verify(); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("was not invoked")) @@ -78,6 +79,7 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif mockpp::String s = MOCKPP_PCHAR("hallo"); MOCKPP_ASSERT_TRUE(ir.describeTo(s).find(MOCKPP_PCHAR("expected once")) != mockpp::String::npos); Index: VerifyingTestCaller_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VerifyingTestCaller_test.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- VerifyingTestCaller_test.cpp 26 Nov 2005 17:57:48 -0000 1.7 +++ VerifyingTestCaller_test.cpp 27 Nov 2005 17:27:57 -0000 1.8 @@ -108,7 +108,7 @@ void thrower() { - throw 1; + MOCKPP_THROW(1); } }; Index: ChainableMockObject_3_void_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockObject_3_void_test.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ChainableMockObject_3_void_test.cpp 26 Nov 2005 17:57:48 -0000 1.11 +++ ChainableMockObject_3_void_test.cpp 27 Nov 2005 17:27:57 -0000 1.12 @@ -123,35 +123,41 @@ mockpp::eq( (unsigned int) 21)) .will(mockpp::throwException<void, int>(321)); - try + MOCKPP_TRY { mcm.chainable(12, 23, 34); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(int i) { MOCKPP_ASSERT_TRUE(i == 123); } +#endif - try + MOCKPP_TRY { mcm.chainable(43, 32, 21); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(int i) { MOCKPP_ASSERT_TRUE(i == 321); } +#endif - try + MOCKPP_TRY { mcm.chainable(1, 2, 3); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } Index: ChainableMockObject_2_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockObject_2_test.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ChainableMockObject_2_test.cpp 26 Nov 2005 17:57:48 -0000 1.10 +++ ChainableMockObject_2_test.cpp 27 Nov 2005 17:27:57 -0000 1.11 @@ -117,15 +117,17 @@ MOCKPP_ASSERT_TRUE(mcm.chainable(12, 34) == 1234); MOCKPP_ASSERT_TRUE(mcm.chainable(43, 21) == 4321); - try + MOCKPP_TRY { mcm.chainable(1, 2); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } Index: ChainableMockMethod_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockMethod_test.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ChainableMockMethod_test.cpp 15 Nov 2005 19:42:18 -0000 1.12 +++ ChainableMockMethod_test.cpp 27 Nov 2005 17:27:57 -0000 1.13 @@ -162,15 +162,17 @@ MOCKPP_ASSERT_TRUE(mcm.chainable() == 21); MOCKPP_ASSERT_TRUE(mcm.chainable() == 43); - try + MOCKPP_TRY { mcm.chainable(); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } @@ -195,15 +197,17 @@ mcm.chainablev(); MOCKPP_ASSERT_EQUALS(2u, counter); - try + MOCKPP_TRY { mcm.chainablev(); MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &ex) { MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); } +#endif mcm.verify(); } Index: InvokeCountMatcher_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/InvokeCountMatcher_test.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- InvokeCountMatcher_test.cpp 15 Oct 2005 15:40:58 -0000 1.9 +++ InvokeCountMatcher_test.cpp 27 Nov 2005 17:27:57 -0000 1.10 @@ -62,12 +62,13 @@ { mockpp::InvokeCountMatcher ir(1); - try + MOCKPP_TRY { ir.verify(); MOCKPP_FAIL(MOCKPP_PCHAR("Did not throw the exception")); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(mockpp::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("was not invoked")) @@ -78,6 +79,7 @@ { MOCKPP_FAIL(MOCKPP_PCHAR("Caught unexpected exception")); } +#endif MOCKPP_ASSERT_TRUE(ir.matches() == true); MOCKPP_ASSERT_TRUE(ir.hasDescription()); |
From: Ewald A. <ewa...@us...> - 2005-11-27 17:28:31
|
Update of /cvsroot/mockpp/mockpp/3party In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8056/3party Log Message: Directory /cvsroot/mockpp/mockpp/3party added to the repository |
From: Ewald A. <ewa...@us...> - 2005-11-27 17:28:20
|
Update of /cvsroot/mockpp/mockpp/mockpp/chaining In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7837/mockpp/chaining Modified Files: AbstractDynamicChainingMock.h InvocationMocker.h Log Message: optionally disable exceptions Index: InvocationMocker.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/InvocationMocker.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- InvocationMocker.h 26 Nov 2005 17:56:30 -0000 1.36 +++ InvocationMocker.h 27 Nov 2005 17:27:57 -0000 1.37 @@ -121,17 +121,19 @@ */ virtual void verify() { - try + MOCKPP_TRY { for ( ConstIterator it = matchers.begin(); it != matchers.end(); ++it ) ( *it ) ->verify(); } +#ifndef MOCKPP_NO_EXCEPTIONS catch ( const AssertionFailedError & error ) { assertionFailed( __LINE__, __FILE__, error.getMessage() + MOCKPP_PCHAR( "\n" ) + this->toString() ); } +#endif // MOCKPP_NO_EXCEPTIONS } /** Sets the object's name Index: AbstractDynamicChainingMock.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/AbstractDynamicChainingMock.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- AbstractDynamicChainingMock.h 26 Nov 2005 17:56:30 -0000 1.36 +++ AbstractDynamicChainingMock.h 27 Nov 2005 17:27:57 -0000 1.37 @@ -133,11 +133,12 @@ { forgetFailure(); - try + MOCKPP_TRY { invocationDispatcher->verify(); } +#ifndef MOCKPP_NO_EXCEPTIONS catch ( const AssertionFailedError &ex ) { assertionFailed( __LINE__, __FILE__, @@ -146,6 +147,7 @@ + MOCKPP_PCHAR( ": " ) + ex.getMessage() ); } +#endif // MOCKPP_NO_EXCEPTIONS } /** Transform the object's state to a human readable string. @@ -254,11 +256,12 @@ this->failure->getSrcFile(), this->failure->getMessage()); - try + MOCKPP_TRY { return this->invocationDispatcher->dispatch( invocation ); } +#ifndef MOCKPP_NO_EXCEPTIONS catch ( const AssertionFailedError & assertion ) { DynamicChainingMockError<R, I> dme( this, @@ -271,6 +274,7 @@ this->failure->getMessage()); } return R(); +#endif // MOCKPP_NO_EXCEPTIONS } }; @@ -314,13 +318,14 @@ virtual void mockInvocation( const I &invocation ) { if ( this->failure.get() != 0 ) - throw *this->failure.get(); + MOCKPP_THROW(*this->failure.get()); - try + MOCKPP_TRY { this->invocationDispatcher->dispatch( invocation ); } +#ifndef MOCKPP_NO_EXCEPTIONS catch ( const AssertionFailedError & assertion ) { DynamicChainingMockError<void, I> dme( this, @@ -328,8 +333,9 @@ this->invocationDispatcher.get(), assertion.getMessage() ); this->failure.reset( new AssertionFailedError(__LINE__, __FILE__, dme.getMessage())); - throw *this->failure.get(); + MOCKPP_THROW(*this->failure.get()); } +#endif // MOCKPP_NO_EXCEPTIONS } }; @@ -374,7 +380,7 @@ void mockInvocation( const I &invocation ) \ { \ if ( this->failure.get() != 0 ) \ - throw *this->failure.get(); \ + MOCKPP_THROW(*this->failure.get()); \ \ try \ { \ @@ -388,7 +394,7 @@ this->invocationDispatcher.get(), \ assertion.getMessage() ); \ this->failure.reset( new AssertionFailedError(__LINE__, __FILE__, dme.getMessage())); \ - throw *this->failure.get(); \ + MOCKPP_THROW(*this->failure.get()); \ } \ } \ }; \ |
From: Ewald A. <ewa...@us...> - 2005-11-27 17:28:18
|
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7837/mockpp Modified Files: Throwable.h mockpp.h Log Message: optionally disable exceptions Index: mockpp.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/mockpp.h,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- mockpp.h 27 Nov 2005 15:34:36 -0000 1.61 +++ mockpp.h 27 Nov 2005 17:27:56 -0000 1.62 @@ -198,6 +198,33 @@ ////////////////////////////////////////////////// // +#ifndef MOCKPP_NO_EXCEPTIONS + +#define MOCKPP_THROW(x) throw (x) +#define MOCKPP_TRY try +#define MOCKPP_CATCH(x) (x) + +#else + +#define CPPUNIT_DISABLE_EXCEPTIONS // ea-hack + +# ifndef MOCKPP_THROW +# define MOCKPP_THROW(x) /**/ +# endif + +# ifndef MOCKPP_TRY +# define MOCKPP_TRY /**/ +# endif + +# ifndef MOCKPP_CATCH +# define MOCKPP_CATCH(x) if(false) +# endif + +#endif + +////////////////////////////////////////////////// +// + #ifdef HAVE_LIMITS # include <limits> // current #else Index: Throwable.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/Throwable.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Throwable.h 13 Nov 2005 11:53:18 -0000 1.15 +++ Throwable.h 27 Nov 2005 17:27:56 -0000 1.16 @@ -76,7 +76,7 @@ virtual void throw_me() { ++thrown; - throw obj; + MOCKPP_THROW(obj); } |
From: Ewald A. <ewa...@us...> - 2005-11-27 17:28:13
|
Update of /cvsroot/mockpp/mockpp/mockpp/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7837/mockpp/util Modified Files: AssertMo.cpp Log Message: optionally disable exceptions Index: AssertMo.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/util/AssertMo.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- AssertMo.cpp 26 Nov 2005 18:00:17 -0000 1.20 +++ AssertMo.cpp 27 Nov 2005 17:27:57 -0000 1.21 @@ -124,7 +124,7 @@ { mockpp::String fmt = mockpp_i18n(MOCKPP_PCHAR("Not Implemented in %1.")); fmt << mockName; - throw NotImplementedException(srcline, srcfile, fmt); + MOCKPP_THROW(NotImplementedException(srcline, srcfile, fmt)); } |
From: Ewald A. <ewa...@us...> - 2005-11-27 17:28:13
|
Update of /cvsroot/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7837 Modified Files: ChangeLog Makefile.am acinclude.m4 configure.in run-configure-unicode.sh Log Message: optionally disable exceptions Index: run-configure-unicode.sh =================================================================== RCS file: /cvsroot/mockpp/mockpp/run-configure-unicode.sh,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- run-configure-unicode.sh 27 Nov 2005 15:34:36 -0000 1.7 +++ run-configure-unicode.sh 27 Nov 2005 17:27:56 -0000 1.8 @@ -8,6 +8,7 @@ fi echo mycc: $MYCC -OPTS="--enable-doxygen --enable-docbook --disable-rtti" +# --disable-rtti --disable-exceptions +OPTS="--enable-doxygen --enable-docbook" CFLAGS="$MYFLAGS" CXXFLAGS="$MYFLAGS" CXX=$MYCC CC=$MYCC ${0%/*}/configure --enable-unicode --enable-debug=full $OPTS --prefix=/tmp/mockpp-install Index: ChangeLog =================================================================== RCS file: /cvsroot/mockpp/mockpp/ChangeLog,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- ChangeLog 27 Nov 2005 15:34:36 -0000 1.81 +++ ChangeLog 27 Nov 2005 17:27:56 -0000 1.82 @@ -8,6 +8,7 @@ - fix compilation error due to bad namespace resolution - provide ways for alternative STL - optionally disable runtime type information (rtti) + - optionally disable exceptions 2005-11-19 1.10.0: Index: Makefile.am =================================================================== RCS file: /cvsroot/mockpp/mockpp/Makefile.am,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- Makefile.am 27 Nov 2005 15:40:50 -0000 1.34 +++ Makefile.am 27 Nov 2005 17:27:56 -0000 1.35 @@ -1,4 +1,4 @@ -SUBDIRS = tool mockpp bcb5 bcb6 bcbX msvc6 msvc7 msvc71 +SUBDIRS = tool config mockpp bcb5 bcb6 bcbX msvc6 msvc7 msvc71 LIBTOOL_DEPS = @LIBTOOL_DEPS@ Index: acinclude.m4 =================================================================== RCS file: /cvsroot/mockpp/mockpp/acinclude.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- acinclude.m4 27 Nov 2005 15:39:14 -0000 1.1 +++ acinclude.m4 27 Nov 2005 17:27:56 -0000 1.2 @@ -1 +1,2 @@ sinclude(config/ac_cxx_rtti.m4) +sinclude(config/ac_cxx_except.m4) Index: configure.in =================================================================== RCS file: /cvsroot/mockpp/mockpp/configure.in,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- configure.in 27 Nov 2005 15:34:36 -0000 1.96 +++ configure.in 27 Nov 2005 17:27:56 -0000 1.97 @@ -361,6 +361,8 @@ # ---------------------------------------------------------------------------- AC_CXX_RTTI + +EA_DISABLE_EXCEPTIONS EA_DISABLE_RTTI EA_ENABLE_DOCBOOK EA_CHECK_LIBDL @@ -432,6 +434,7 @@ bcbX/Makefile \ bcbX/cppunit-lib/Makefile \ \ + config/Makefile \ tool/Makefile \ \ msvc6/Makefile \ |
From: Ewald A. <ewa...@us...> - 2005-11-27 17:28:13
|
Update of /cvsroot/mockpp/mockpp/mockpp/compat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7837/mockpp/compat Modified Files: AssertionFailedError.cpp Log Message: optionally disable exceptions Index: AssertionFailedError.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/compat/AssertionFailedError.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- AssertionFailedError.cpp 28 Aug 2005 20:40:23 -0000 1.14 +++ AssertionFailedError.cpp 27 Nov 2005 17:27:57 -0000 1.15 @@ -62,7 +62,7 @@ void assertionFailed(unsigned srcline, const char* srcfile, const String &message) { - throw AssertionFailedError(srcline, srcfile, message); + MOCKPP_THROW(AssertionFailedError(srcline, srcfile, message)); } |
From: Ewald A. <ewa...@us...> - 2005-11-27 17:28:07
|
Update of /cvsroot/mockpp/mockpp/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7837/config Modified Files: ac_cxx_rtti.m4 Log Message: optionally disable exceptions Index: ac_cxx_rtti.m4 =================================================================== RCS file: /cvsroot/mockpp/mockpp/config/ac_cxx_rtti.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ac_cxx_rtti.m4 27 Nov 2005 15:38:09 -0000 1.1 +++ ac_cxx_rtti.m4 27 Nov 2005 17:27:56 -0000 1.2 @@ -39,7 +39,7 @@ AC_DEFUN([EA_DISABLE_RTTI],[ -AC_ARG_ENABLE(rtti, [ --disable-rtti disable rtti support (no)], [ disable_rtti=yes ], [ disable_rtti=no ]) +AC_ARG_ENABLE(rtti, [ --disable-rtti disable rtti support (no)], [ disable_rtti=yes ], [ disable_rtti=no ]) if test "x$disable_rtti" = xyes; then echo "*******************************************************" |
From: Ewald A. <ewa...@us...> - 2005-11-27 15:40:57
|
Update of /cvsroot/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20529 Modified Files: Makefile.am Log Message: optionally disable runtime type information (rtti) Index: Makefile.am =================================================================== RCS file: /cvsroot/mockpp/mockpp/Makefile.am,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- Makefile.am 19 Nov 2005 21:47:26 -0000 1.33 +++ Makefile.am 27 Nov 2005 15:40:50 -0000 1.34 @@ -19,7 +19,8 @@ TODO \ Makefile.cvs \ mockpp.lsm \ - gen_files_N.sh + gen_files_N.sh \ + acinclude.m4 CLEANFILES = *.~* *.~~* *~ cachegrind.out.* |
From: Ewald A. <ewa...@us...> - 2005-11-27 15:39:23
|
Update of /cvsroot/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20250 Added Files: acinclude.m4 Log Message: optionally disable runtime type information (rtti) --- NEW FILE: acinclude.m4 --- sinclude(config/ac_cxx_rtti.m4) |
From: Ewald A. <ewa...@us...> - 2005-11-27 15:38:18
|
Update of /cvsroot/mockpp/mockpp/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20109/config Added Files: ac_cxx_rtti.m4 Log Message: optionally disable runtime type information (rtti) --- NEW FILE: ac_cxx_rtti.m4 --- dnl @synopsis AC_CXX_RTTI from CppUnit dnl dnl If the compiler supports Run-Time Type Identification (typeinfo dnl header and typeid keyword), define HAVE_RTTI. dnl dnl @version $Id: ac_cxx_rtti.m4,v 1.1 2005/11/27 15:38:09 ewald-arnold Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN([AC_CXX_RTTI], [AC_CACHE_CHECK(whether the compiler supports Run-Time Type Identification, ac_cv_cxx_rtti, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([#include <typeinfo>],[ class Base { public : Base () {} virtual ~Base () {} virtual int f () { return 0; } }; class Derived : public Base { public : Derived () {} virtual ~Derived () {} virtual int f () { return 1; } }; Derived d; Base *ptr = &d; return typeid (*ptr) == typeid (Derived); ], ac_cv_cxx_rtti=yes, ac_cv_cxx_rtti=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_rtti" = yes; then AC_DEFINE(HAVE_RTTI,1, [define if the compiler supports Run-Time Type Identification]) fi ]) AC_DEFUN([EA_DISABLE_RTTI],[ AC_ARG_ENABLE(rtti, [ --disable-rtti disable rtti support (no)], [ disable_rtti=yes ], [ disable_rtti=no ]) if test "x$disable_rtti" = xyes; then echo "*******************************************************" echo "** RTTI is disabled" echo "*******************************************************" AC_DEFINE(MOCKPP_NO_RTTI, 1, [Define to disable rtti support.]) CXXFLAGS="$CXXFLAGS -fno-rtti" else echo "*******************************************************" echo "** RTTI is enabled" echo "*******************************************************" AH_TEMPLATE([MOCKPP_NO_RTTI], [Define to disable rtti support.]) fi # AC_SUBST(MOCKPP_NO_RTTI) ]) |
From: Ewald A. <ewa...@us...> - 2005-11-27 15:34:54
|
Update of /cvsroot/mockpp/mockpp/mockpp/chaining In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19644/mockpp/chaining Modified Files: ChainingMockObjectSupport.h Log Message: optionally disable runtime type information (rtti) Index: ChainingMockObjectSupport.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/ChainingMockObjectSupport.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- ChainingMockObjectSupport.h 26 Nov 2005 17:56:30 -0000 1.22 +++ ChainingMockObjectSupport.h 27 Nov 2005 15:34:36 -0000 1.23 @@ -237,6 +237,8 @@ } +#ifndef MOCKPP_NO_RTTI + /** Creates a constraint that checks if an object is derived from a base class. * The base class is needed since dynamic_cast checks for an existing traversal * from \c derived to \c base. @@ -252,6 +254,8 @@ return new IsInstanceOf<ROOT, DERIVED>(); } +#endif // MOCKPP_NO_RTTI + /** Creates a constraint that checks for the occurence of a substring * @ingroup grp_constraint_abbrev @@ -655,7 +659,9 @@ using mockpp::gt; using mockpp::lt; using mockpp::same; +#ifndef MOCKPP_NO_RTTI using mockpp::isA; +#endif using mockpp::stringContains; using mockpp::startsWith; using mockpp::endsWith; |
From: Ewald A. <ewa...@us...> - 2005-11-27 15:34:53
|
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19644/mockpp Modified Files: MockObject.cpp mockpp.h Log Message: optionally disable runtime type information (rtti) Index: mockpp.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/mockpp.h,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- mockpp.h 26 Nov 2005 20:16:55 -0000 1.60 +++ mockpp.h 27 Nov 2005 15:34:36 -0000 1.61 @@ -82,8 +82,6 @@ #ifndef MOCKPP_H #define MOCKPP_H -#include <typeinfo> - # ifdef _MSC_VER // Compilation Warning remover // needed to prevent MSVC6 complain about itself :-/ @@ -135,6 +133,9 @@ # endif #endif +////////////////////////////////////////////////// +// + /* #if defined(MOCKPP_UNICODE) # ifndef _UNICODE @@ -153,6 +154,9 @@ #endif +////////////////////////////////////////////////// +// + #ifdef MOCKPP_USE_MINI_STL #include <ministl/string> @@ -181,6 +185,19 @@ #endif +////////////////////////////////////////////////// +// + +#ifndef MOCKPP_NO_RTTI +#include <typeinfo> +#else +#undef CPPUNIT_USE_TYPEINFO_NAME +#define CPPUNIT_USE_TYPEINFO_NAME 0 +#endif + +////////////////////////////////////////////////// +// + #ifdef HAVE_LIMITS # include <limits> // current #else @@ -201,6 +218,9 @@ # define MOCKPP_UNLIMITED (UINT_MAX) #endif +////////////////////////////////////////////////// +// + #ifdef __BORLANDC__ # define MOCKPP_FUNC_MACRO __FUNC__ #elif defined(_MSC_VER) @@ -218,6 +238,9 @@ * for a whole project. */ +////////////////////////////////////////////////// +// + /** @def MOCKPP_UNUSED * Simple macro to suppress warnings about unused variables if possible. * Note: This is just an empty fallback. The actual content (if any) is in the @@ -229,6 +252,9 @@ #define MOCKPP_UNUSED(x) #endif +////////////////////////////////////////////////// +// + //! Output char values more readable (e.g. non-alphanumeric as number) #define MOCKPP_MAKE_CHAR_READABLE 1 @@ -242,6 +268,9 @@ //! with user's data type if there are no operator+() and operator-(). #define MOCKPP_BOUNDARY_DELTA 0 +////////////////////////////////////////////////// +// + #if defined(__BORLANDC__) || defined (_MSC_VER) # ifndef __WIN32__ @@ -261,6 +290,9 @@ # endif +////////////////////////////////////////////////// +// + # ifdef _MSC_VER // DLL // EXPORT @@ -316,6 +348,9 @@ #endif +////////////////////////////////////////////////// +// + //! Namespace for project "Mock Objects for C++" namespace mockpp { Index: MockObject.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/MockObject.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- MockObject.cpp 26 Nov 2005 18:00:16 -0000 1.24 +++ MockObject.cpp 27 Nov 2005 15:34:36 -0000 1.25 @@ -48,10 +48,14 @@ void MOCKPP_EXPORT MockObject::notImplemented() { -#ifdef MOCKPP_UNICODE +#ifndef MOCKPP_NO_RTTI +# ifdef MOCKPP_UNICODE MOCKPP_NOT_IMPLEMENTED(getUnicode(typeid(*this).name())); -#else +# else MOCKPP_NOT_IMPLEMENTED(typeid(*this).name()); +# endif +#else + MOCKPP_NOT_IMPLEMENTED(MOCKPP_PCHAR("[rtti-disabled in MockObject::notImplemented()") ); #endif } |
From: Ewald A. <ewa...@us...> - 2005-11-27 15:34:53
|
Update of /cvsroot/mockpp/mockpp/mockpp/stub In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19644/mockpp/stub Modified Files: ThrowStub.h Log Message: optionally disable runtime type information (rtti) Index: ThrowStub.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/stub/ThrowStub.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- ThrowStub.h 3 Apr 2005 18:32:53 -0000 1.31 +++ ThrowStub.h 27 Nov 2005 15:34:36 -0000 1.32 @@ -73,7 +73,11 @@ virtual String describeTo( String &buffer ) const { buffer += MOCKPP_PCHAR("throws <") +#ifdef MOCKPP_NO_RTTI + + MOCKPP_GET_STRING("[rtti-disabled]") +#else + MOCKPP_GET_STRING(typeid(throwable).name()) +#endif + MOCKPP_PCHAR(">"); return buffer; } @@ -117,7 +121,7 @@ }; - + /** A stub throwing exceptions. */ template<> |
From: Ewald A. <ewa...@us...> - 2005-11-27 15:34:53
|
Update of /cvsroot/mockpp/mockpp/mockpp/constraint In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19644/mockpp/constraint Modified Files: IsInstanceOf.h Log Message: optionally disable runtime type information (rtti) Index: IsInstanceOf.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/constraint/IsInstanceOf.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- IsInstanceOf.h 13 Mar 2005 19:13:25 -0000 1.17 +++ IsInstanceOf.h 27 Nov 2005 15:34:36 -0000 1.18 @@ -42,6 +42,8 @@ namespace mockpp { +#ifndef MOCKPP_NO_RTTI + /** Tests whether the value is derived from the given class. * A base class is needed since dynamic_cast checks for an existing traversal * from \c derived to \c base. @@ -78,6 +80,7 @@ } }; +#endif // MOCKPP_NO_RTTI } // namespace mockpp |
From: Ewald A. <ewa...@us...> - 2005-11-27 15:34:53
|
Update of /cvsroot/mockpp/mockpp/mockpp/compat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19644/mockpp/compat Modified Files: Formatter.h Log Message: optionally disable runtime type information (rtti) Index: Formatter.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/compat/Formatter.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- Formatter.h 26 Nov 2005 17:56:44 -0000 1.34 +++ Formatter.h 27 Nov 2005 15:34:36 -0000 1.35 @@ -268,6 +268,7 @@ * Replaces the lowest %-parameter with the string representation of the data. * "hello %1" << 9 gives "hello 9" * @ingroup grp_helper + * @note Only meaningful if RTTI is actually enabled at compile time. * @param formatter target string with position parameter * @param o value by reference to output * @return the resulting string @@ -276,7 +277,11 @@ mockpp::String & MOCKPP_EXPORT operator << (mockpp::String &formatter, const T &o) { mockpp::String s = MOCKPP_PCHAR("[") +#ifdef MOCKPP_NO_RTTI + + MOCKPP_GET_STRING("[rtti-disabled]") +#else + MOCKPP_GET_STRING(typeid(o).name()) +#endif + MOCKPP_PCHAR("&]"); formatter << s; return formatter; @@ -286,6 +291,7 @@ /** Fallback output: replace a positional %-parameter with a values typeid name. * Replaces the lowest %-parameter with the string representation of the data. * "hello %1" << 9 gives "hello 9" + * @note Only meaningful if RTTI is actually enabled at compile time. * @ingroup grp_helper * @param formatter target string with position parameter * @param po value by pointer to output @@ -295,7 +301,11 @@ mockpp::String & MOCKPP_EXPORT operator << (mockpp::String &formatter, const T * &po) { mockpp::String s = MOCKPP_PCHAR("[") +#ifdef MOCKPP_NO_RTTI + + MOCKPP_GET_STRING("[rtti-disabled]") +#else + MOCKPP_GET_STRING(typeid(*po).name()) +#endif + MOCKPP_PCHAR("*]"); formatter << s; return formatter; |
From: Ewald A. <ewa...@us...> - 2005-11-27 15:34:53
|
Update of /cvsroot/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19644 Modified Files: ChangeLog configure.in run-configure-unicode.sh Log Message: optionally disable runtime type information (rtti) Index: run-configure-unicode.sh =================================================================== RCS file: /cvsroot/mockpp/mockpp/run-configure-unicode.sh,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- run-configure-unicode.sh 18 Nov 2005 20:32:36 -0000 1.6 +++ run-configure-unicode.sh 27 Nov 2005 15:34:36 -0000 1.7 @@ -8,6 +8,6 @@ fi echo mycc: $MYCC -OPTS="--enable-doxygen --enable-docbook" +OPTS="--enable-doxygen --enable-docbook --disable-rtti" CFLAGS="$MYFLAGS" CXXFLAGS="$MYFLAGS" CXX=$MYCC CC=$MYCC ${0%/*}/configure --enable-unicode --enable-debug=full $OPTS --prefix=/tmp/mockpp-install Index: ChangeLog =================================================================== RCS file: /cvsroot/mockpp/mockpp/ChangeLog,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 --- ChangeLog 26 Nov 2005 20:16:55 -0000 1.80 +++ ChangeLog 27 Nov 2005 15:34:36 -0000 1.81 @@ -7,6 +7,7 @@ - removed superfluous template parameter - fix compilation error due to bad namespace resolution - provide ways for alternative STL + - optionally disable runtime type information (rtti) 2005-11-19 1.10.0: Index: configure.in =================================================================== RCS file: /cvsroot/mockpp/mockpp/configure.in,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- configure.in 18 Nov 2005 20:32:36 -0000 1.95 +++ configure.in 27 Nov 2005 15:34:36 -0000 1.96 @@ -360,6 +360,8 @@ # ---------------------------------------------------------------------------- +AC_CXX_RTTI +EA_DISABLE_RTTI EA_ENABLE_DOCBOOK EA_CHECK_LIBDL EA_ENABLE_DOXYGEN |
From: Ewald A. <ewa...@us...> - 2005-11-27 15:34:50
|
Update of /cvsroot/mockpp/mockpp/mockpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19644/mockpp/tests Modified Files: ChainingMockObjectSupport_test.cpp IsInstanceOf_test.cpp Log Message: optionally disable runtime type information (rtti) Index: ChainingMockObjectSupport_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainingMockObjectSupport_test.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- ChainingMockObjectSupport_test.cpp 26 Nov 2005 17:57:48 -0000 1.33 +++ ChainingMockObjectSupport_test.cpp 27 Nov 2005 15:34:36 -0000 1.34 @@ -65,7 +65,9 @@ CPPUNIT_TEST( test_less_func ); CPPUNIT_TEST( test_same_func ); CPPUNIT_TEST( test_less_equal_func ); +#ifndef MOCKPP_NO_RTTI CPPUNIT_TEST( test_instance ); +#endif CPPUNIT_TEST( test_invoke_not ); CPPUNIT_TEST( test_invoke_or ); CPPUNIT_TEST( test_invoke_and ); @@ -92,7 +94,9 @@ void test_invoke_and(); void test_invoke_or(); void test_invoke_not(); +#ifndef MOCKPP_NO_RTTI void test_instance(); +#endif void test_same_func(); void test_less_equal_func(); void test_less_func(); @@ -149,6 +153,8 @@ }; +#ifndef MOCKPP_NO_RTTI + void ChainingMockObjectSupport_test::test_instance() { A a; @@ -171,6 +177,7 @@ MOCKPP_ASSERT_TRUE( instance->eval( &rb ) == false ); } +#endif // MOCKPP_NO_RTTI void ChainingMockObjectSupport_test::test_string_contains() { Index: IsInstanceOf_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/IsInstanceOf_test.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- IsInstanceOf_test.cpp 26 Nov 2005 17:57:48 -0000 1.13 +++ IsInstanceOf_test.cpp 27 Nov 2005 15:34:36 -0000 1.14 @@ -42,6 +42,8 @@ #include <cppunit/extensions/HelperMacros.h> #include <iostream> +#ifndef MOCKPP_NO_RTTI + class IsInstanceOf_test : public CppUnit::TestFixture { public: @@ -135,5 +137,6 @@ delete pd; } +#endif // MOCKPP_NO_RTTI #endif // HAVE_CPPUNIT |
From: Ewald A. <ewa...@us...> - 2005-11-26 20:17:06
|
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15736/mockpp Modified Files: ReturnObjectList.h ThrowableList.h mockpp.h Log Message: prepare use of alternative stl Index: mockpp.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/mockpp.h,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- mockpp.h 26 Nov 2005 18:27:30 -0000 1.59 +++ mockpp.h 26 Nov 2005 20:16:55 -0000 1.60 @@ -152,6 +152,7 @@ //# define _GLIBCPP_HAVE_WCHAR_H #endif + #ifdef MOCKPP_USE_MINI_STL #include <ministl/string> @@ -162,8 +163,8 @@ #define MOCKPP_FUNCTION_H <ministl/function> #define MOCKPP_DEQUE_H <ministl/deque> -// no namespace ministl -#define MOCKPP_STL +// namespace ministl +#define MOCKPP_STL ministl #else @@ -231,7 +232,7 @@ //! Output char values more readable (e.g. non-alphanumeric as number) #define MOCKPP_MAKE_CHAR_READABLE 1 -//! mockpp::Exception is derived from MOCKPP_STL::exception +//! mockpp::Exception is derived from std::exception #define MOCKPP_USE_STD_EXCEPTION 1 #undef HAVE_MULTITHREAD // obsolete and error prone @@ -322,7 +323,7 @@ #ifdef MOCKPP_UNICODE typedef MOCKPP_STL::basic_string<wchar_t> String; - typedef wchar_t Char; + typedef wchar_t Char; //! make the charactor constant of type wchar_t # define MOCKPP_CHAR(x) L##x //! make the string literal a wchar_t literal @@ -330,8 +331,8 @@ #else - typedef MOCKPP_STL::string String; - typedef char Char; + typedef MOCKPP_STL::basic_string<char> String; + typedef char Char; //! make the charactor constant of type char # define MOCKPP_CHAR(x) x //! make the string literal a char literal Index: ThrowableList.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ThrowableList.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- ThrowableList.h 26 Nov 2005 18:27:30 -0000 1.22 +++ ThrowableList.h 26 Nov 2005 20:16:55 -0000 1.23 @@ -138,8 +138,8 @@ ThrowableList (const ThrowableList &); // forbid ThrowableList& operator=(ThrowableList&); - std::vector<Throwable *> list; - std::vector<Throwable *> already_used; + MOCKPP_STL::vector<Throwable *> list; + MOCKPP_STL::vector<Throwable *> already_used; }; Index: ReturnObjectList.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ReturnObjectList.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- ReturnObjectList.h 26 Nov 2005 18:27:30 -0000 1.32 +++ ReturnObjectList.h 26 Nov 2005 20:16:55 -0000 1.33 @@ -203,9 +203,9 @@ private: - std::vector<T> myObjects; - bool haveDefault; - T defaultObject; + MOCKPP_STL::vector<T> myObjects; + bool haveDefault; + T defaultObject; }; |