examples almost done! only assertion_macros.cpp is left
diff --git a/examples/all_features/subcases.cpp b/examples/all_features/subcases.cpp
index 9a66397..c760d8b 100644
--- a/examples/all_features/subcases.cpp
+++ b/examples/all_features/subcases.cpp
@@ -1,19 +1,11 @@
#include "doctest.h"
+#include "header.h"
+
#include <iostream>
#include <vector>
using namespace std;
-static int throws(bool in) {
- if(in)
-#ifndef DOCTEST_CONFIG_NO_EXCEPTIONS
- throw 5;
-#else // DOCTEST_CONFIG_NO_EXCEPTIONS
- return 0;
-#endif // DOCTEST_CONFIG_NO_EXCEPTIONS
- return 42;
-}
-
TEST_CASE("lots of nested subcases") {
cout << endl << "root" << endl;
SUBCASE("") {
@@ -25,7 +17,7 @@
SUBCASE("") { cout << "2.1" << endl; }
SUBCASE("") {
// whops! all the subcases below shouldn't be discovered and executed!
- throws(true);
+ FAIL("");
cout << "2.2" << endl;
SUBCASE("") {
@@ -80,31 +72,3 @@
}
}
}
-
-// to silence GCC warnings when inheriting from the class TheFixture which has no virtual destructor
-#if defined(__GNUC__) && !defined(__clang__)
-#pragma GCC diagnostic ignored "-Weffc++"
-#endif // __GNUC__
-
-struct TheFixture
-{
- int data;
- TheFixture()
- : data(42) {
- // setup here
- }
-
- ~TheFixture() {
- // teardown here
- }
-};
-
-TEST_CASE_FIXTURE(TheFixture, "test with a fixture - 1") {
- data /= 2;
- CHECK(data == 21);
-}
-
-TEST_CASE_FIXTURE(TheFixture, "test with a fixture - 2") {
- data *= 2;
- CHECK(data == 85);
-}