summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoronqtam <vik.kirilov@gmail.com>2016-06-10 21:28:08 +0300
committeronqtam <vik.kirilov@gmail.com>2016-09-21 15:46:08 +0300
commit8def6b040fd176f929e9ebc881810745e11e0a2d (patch)
treea905cd2cb703067a4656b1f8738600f2ae16b363 /examples
parent8deb09203ceb319fd90caa7c6f308718f9509e94 (diff)
removed custom implementations of vector and hashtable and now using std::vector and std::set
Diffstat (limited to 'examples')
-rw-r--r--examples/alternative_macros/main.cpp1
-rw-r--r--examples/separate_headers/test.cpp33
-rw-r--r--examples/separate_headers/test_output/separate_headers.txt39
3 files changed, 34 insertions, 39 deletions
diff --git a/examples/alternative_macros/main.cpp b/examples/alternative_macros/main.cpp
index 9017111..edc5a73 100644
--- a/examples/alternative_macros/main.cpp
+++ b/examples/alternative_macros/main.cpp
@@ -14,6 +14,5 @@ my_testcase("custom macros") {
my_require(5 > 3);
}
-
// CHECK(1 == 1); <== ERROR - the default short macros are disabled from the proxy header
}
diff --git a/examples/separate_headers/test.cpp b/examples/separate_headers/test.cpp
index d7bf195..2066af5 100644
--- a/examples/separate_headers/test.cpp
+++ b/examples/separate_headers/test.cpp
@@ -1,12 +1,31 @@
#include "parts/doctest_fwd.h"
-TEST_CASE("captain obvious") {
- bool b = false;
- CHECK(b);
+#include <cstdio>
- CHECK_UNARY_FALSE(true);
+TEST_CASE("custom macros") {
+ printf("Hello world!\n");
- WARN_GT(false, false);
- CHECK_EQ(false, true);
- REQUIRE_EQ(false, true);
+ CHECK(1 == 1);
+
+ SUBCASE("bar") {
+ SUBCASE("foo") {
+ printf("foo\n"); //
+ }
+ SUBCASE("baz") {
+ printf("baz\n"); //
+ }
+
+ printf("end\n"); //
+ }
}
+
+//TEST_CASE("captain obvious") {
+// bool b = false;
+// CHECK(b);
+//
+// CHECK_UNARY_FALSE(true);
+//
+// WARN_GT(false, false);
+// CHECK_EQ(false, true);
+// REQUIRE_EQ(false, true);
+//}
diff --git a/examples/separate_headers/test_output/separate_headers.txt b/examples/separate_headers/test_output/separate_headers.txt
index 040135c..07c6e7d 100644
--- a/examples/separate_headers/test_output/separate_headers.txt
+++ b/examples/separate_headers/test_output/separate_headers.txt
@@ -1,34 +1,11 @@
[doctest] doctest version is "1.0.0"
[doctest] run with "--help" for options
+Hello world!
+foo
+end
+Hello world!
+baz
+end
===============================================================================
-test.cpp(3)
-captain obvious
-
-test.cpp(5) FAILED!
- CHECK( b )
-with expansion:
- CHECK( false )
-
-test.cpp(7) FAILED!
- CHECK_UNARY_FALSE( true )
-with expansion:
- CHECK_UNARY_FALSE( true )
-
-test.cpp(9) FAILED!
- WARN_NEQ( false != false )
-with expansion:
- WARN_NEQ( false != false )
-
-test.cpp(10) FAILED!
- CHECK_EQ( false == true )
-with expansion:
- CHECK_EQ( false == true )
-
-test.cpp(11) FAILED!
- REQUIRE_EQ( false == true )
-with expansion:
- REQUIRE_EQ( false == true )
-
-===============================================================================
-[doctest] test cases: 1 | 0 passed | 1 failed | 0 skipped
-[doctest] assertions: 4 | 0 passed | 4 failed |
+[doctest] test cases: 1 | 1 passed | 0 failed | 0 skipped
+[doctest] assertions: 2 | 2 passed | 0 failed |