Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest/UsageTests/Class.tests.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-06-20 16:25:57 +0200
committerMartin Hořeňovský2021-06-20 19:15:02 +0200
commitbf61a418cbc4d3b430e3d258c5287780944ad505 (patch)
treef93f4136d7b2a14cc4fdecc8a90ad9415ead4c17 /tests/SelfTest/UsageTests/Class.tests.cpp
parent849002aec0271b0a8356162134ea78731e84454a (diff)
downloadcatch3-bf61a418cbc4d3b430e3d258c5287780944ad505.tar.gz
Remove the ill-conceived compilation perf tests using real tests
Diffstat (limited to 'tests/SelfTest/UsageTests/Class.tests.cpp')
-rw-r--r--tests/SelfTest/UsageTests/Class.tests.cpp81
1 files changed, 28 insertions, 53 deletions
diff --git a/tests/SelfTest/UsageTests/Class.tests.cpp b/tests/SelfTest/UsageTests/Class.tests.cpp
index b6009e0b..94e83051 100644
--- a/tests/SelfTest/UsageTests/Class.tests.cpp
+++ b/tests/SelfTest/UsageTests/Class.tests.cpp
@@ -7,68 +7,47 @@
#include <catch2/catch_template_test_macros.hpp>
#include <array>
-namespace{ namespace ClassTests {
+namespace {
-#ifndef CLASS_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU
-#define CLASS_TEST_HELPERS_INCLUDED
+ class TestClass {
+ std::string s;
-class TestClass
-{
- std::string s;
+ public:
+ TestClass(): s( "hello" ) {}
-public:
- TestClass()
- : s( "hello" )
- {}
+ void succeedingCase() { REQUIRE( s == "hello" ); }
+ void failingCase() { REQUIRE( s == "world" ); }
+ };
- void succeedingCase()
- {
- REQUIRE( s == "hello" );
- }
- void failingCase()
- {
- REQUIRE( s == "world" );
- }
-};
+ struct Fixture {
+ Fixture(): m_a( 1 ) {}
-struct Fixture
-{
- Fixture() : m_a( 1 ) {}
+ int m_a;
+ };
- int m_a;
-};
+ template <typename T> struct Template_Fixture {
+ Template_Fixture(): m_a( 1 ) {}
-template< typename T >
-struct Template_Fixture {
- Template_Fixture(): m_a(1) {}
+ T m_a;
+ };
- T m_a;
-};
+ template <typename T> struct Template_Fixture_2 {
+ Template_Fixture_2() {}
-template<typename T>
-struct Template_Fixture_2 {
- Template_Fixture_2() {}
+ T m_a;
+ };
- T m_a;
-};
+ template <typename T> struct Template_Foo {
+ size_t size() { return 0; }
+ };
-template< typename T>
-struct Template_Foo {
- size_t size() { return 0; }
-};
-
-template< typename T, size_t V>
-struct Template_Foo_2 {
- size_t size() { return V; }
-};
-
-template <int V>
-struct Nttp_Fixture{
- int value = V;
-};
-#endif
+ template <typename T, size_t V> struct Template_Foo_2 {
+ size_t size() { return V; }
+ };
+ template <int V> struct Nttp_Fixture { int value = V; };
+} // end unnamed namespace
METHOD_AS_TEST_CASE( TestClass::succeedingCase, "A METHOD_AS_TEST_CASE based test run that succeeds", "[class]" )
METHOD_AS_TEST_CASE( TestClass::failingCase, "A METHOD_AS_TEST_CASE based test run that fails", "[.][class][failing]" )
@@ -129,7 +108,3 @@ namespace Inner
REQUIRE(Template_Fixture_2<TestType>{}.m_a.size() < 2);
}
}
-
-
-
-}} // namespace ClassTests