diff options
author | onqtam <vik.kirilov@gmail.com> | 2016-06-07 23:46:09 +0300 |
---|---|---|
committer | onqtam <vik.kirilov@gmail.com> | 2016-09-21 15:46:07 +0300 |
commit | 3ffb887b3f38541f9d84b605be24bf4751fbcee9 (patch) | |
tree | 4e8cc0ccc27461fcc0f3220e6306911654401f34 /examples | |
parent | eae70c792c66ac05590df0db018d12af5dc9c10a (diff) |
travis builds should be fixed
Diffstat (limited to 'examples')
-rw-r--r-- | examples/separate_headers/test.cpp | 49 | ||||
-rw-r--r-- | examples/separate_headers/test_output/separate_headers.txt | 36 |
2 files changed, 5 insertions, 80 deletions
diff --git a/examples/separate_headers/test.cpp b/examples/separate_headers/test.cpp index cf8abdb..41dc44a 100644 --- a/examples/separate_headers/test.cpp +++ b/examples/separate_headers/test.cpp @@ -1,50 +1,5 @@ #include "parts/doctest_fwd.h" -TEST_CASE("captain obvious") { CHECK(true == false); } - -static int throws(bool in) { - if(in) - throw 5; - return 42; -} - -using doctest::Approx; - -TEST_SUITE("meaningless macros"); - -TEST_CASE("an empty test that will succeed") {} - -TEST_CASE("an empty test that will fail because of an exception") { throws(true); } - -TEST_SUITE_END(); - -TEST_CASE("normal macros") { - int a = 5; - int b = 5; - - CHECK(throws(true) == 42); - - CHECK_FALSE(!(a == b)); - - REQUIRE(a == b); - // commented out because 32 vs 64 bit builds will fail when the output is compared - //WARN(reinterpret_cast<void*>(1000) == reinterpret_cast<void*>(1004)); - - CHECK(Approx(0.1000001) == 0.1000002); - CHECK(Approx(0.502) == 0.501); - - const char* c_string = "test_test"; - - CHECK(c_string == "test_test"); - - throws(true); -} - -TEST_CASE("exceptions-related macros") { - CHECK_THROWS(throws(false)); - CHECK_THROWS_AS(throws(false), int); - CHECK_THROWS_AS(throws(true), int); - CHECK_THROWS_AS(throws(true), char); - - REQUIRE_NOTHROW(throws(true)); +TEST_CASE("captain obvious") { + CHECK(true == false); } diff --git a/examples/separate_headers/test_output/separate_headers.txt b/examples/separate_headers/test_output/separate_headers.txt index 64d6807..4db5962 100644 --- a/examples/separate_headers/test_output/separate_headers.txt +++ b/examples/separate_headers/test_output/separate_headers.txt @@ -4,41 +4,11 @@ test.cpp(3) captain obvious -test.cpp(3) FAILED! +test.cpp(4) FAILED! CHECK( true == false ) with expansion: CHECK( true == false ) =============================================================================== -test.cpp(17) -an empty test that will fail because of an exception - - TEST CASE FAILED! (threw exception) - -=============================================================================== -test.cpp(21) -normal macros - -test.cpp(25) FAILED! (threw exception) - CHECK( throws(true) == 42 ) - -test.cpp(34) FAILED! - CHECK( Approx(0.502) == 0.501 ) -with expansion: - CHECK( Approx( 0.502 ) == 0.501 ) - - TEST CASE FAILED! (threw exception) - -=============================================================================== -test.cpp(43) -exceptions-related macros - -test.cpp(44) FAILED! - CHECK_THROWS( throws(false) ) - -test.cpp(45) FAILED! (didn't throw at all) - CHECK_THROWS_AS( throws(false), int ) - -=============================================================================== -[doctest] test cases: 5 | 1 passed | 4 failed | 0 skipped -[doctest] assertions: 9 | 4 passed | 5 failed | +[doctest] test cases: 1 | 0 passed | 1 failed | 0 skipped +[doctest] assertions: 1 | 0 passed | 1 failed | |