Initial commit, version 0.1.0.
[libfsafe.git] / tests / Assert.cxx
blob2012060d14ba523c18193304e8e7fb6d7f3bc361
1 #include <tests/Assert.hxx>
2 #include <libfsafe/assert.hxx>
4 void tests::Assert::passIfTrue()
6 ASSERT(true);
9 void tests::Assert::failIfFalse()
11 ASSERT(false);
14 void tests::Assert::testMessage()
16 try {
17 ASSERT(false);
18 CPPUNIT_FAIL("false positive");
19 } catch (libfsafe::AssertionFailure& e) {
20 std::string exp =
21 __FILE__ ":17: "
22 "Condition 'false' violated.";
23 std::string act = e.what();
24 CPPUNIT_ASSERT_EQUAL(exp, act);