Small cleanup of self tests
diff --git a/projects/SelfTest/Baselines/compact.sw.approved.txt b/projects/SelfTest/Baselines/compact.sw.approved.txt
index b2edd62..45a37c5 100644
--- a/projects/SelfTest/Baselines/compact.sw.approved.txt
+++ b/projects/SelfTest/Baselines/compact.sw.approved.txt
@@ -3,6 +3,8 @@
Decomposition.tests.cpp:<line number>: passed: fptr == 0l for: 0 == 0
Compilation.tests.cpp:<line number>: passed: y.v == 0 for: 0 == 0
Compilation.tests.cpp:<line number>: passed: 0 == y.v for: 0 == 0
+Compilation.tests.cpp:<line number>: passed: y.v == 0 for: 0 == 0
+Compilation.tests.cpp:<line number>: passed: 0 == y.v for: 0 == 0
Compilation.tests.cpp:<line number>: passed: t1 == t2 for: {?} == {?}
Compilation.tests.cpp:<line number>: passed: t1 != t2 for: {?} != {?}
Compilation.tests.cpp:<line number>: passed: t1 < t2 for: {?} < {?}
@@ -244,8 +246,6 @@
Approx.tests.cpp:<line number>: passed: INFINITY == Approx(INFINITY) for: inff == Approx( inf )
Approx.tests.cpp:<line number>: passed: NAN != Approx(NAN) for: nanf != Approx( nan )
Approx.tests.cpp:<line number>: passed: !(NAN == Approx(NAN)) for: !(nanf == Approx( nan ))
-Tricky.tests.cpp:<line number>: passed: y.v == 0 for: 0 == 0
-Tricky.tests.cpp:<line number>: passed: 0 == y.v for: 0 == 0
Message.tests.cpp:<line number>: passed: with 7 messages: 'a := 1' and 'b := 2' and 'c := 3' and 'a + b := 3' and 'a+b := 3' and 'c > b := true' and 'a == 1 := true'
Message.tests.cpp:<line number>: passed: with 7 messages: 'std::vector<int>{1, 2, 3}[0, 1, 2] := 3' and 'std::vector<int>{1, 2, 3}[(0, 1)] := 2' and 'std::vector<int>{1, 2, 3}[0] := 1' and '(helper_1436<int, int>{12, -12}) := { 12, -12 }' and '(helper_1436<int, int>(-12, 12)) := { -12, 12 }' and '(1, 2) := 2' and '(2, 3) := 3'
Message.tests.cpp:<line number>: passed: with 11 messages: '("comma, in string", "escaped, \", ") := "escaped, ", "' and '"single quote in string,'," := "single quote in string,',"' and '"some escapes, \\,\\\\" := "some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<"' and ''"' := '"'' and ''\'' := '''' and '',' := ','' and ''}' := '}'' and '')' := ')'' and ''(' := '('' and ''{' := '{''
diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt
index dfc9f0b..73c2390 100644
--- a/projects/SelfTest/Baselines/console.sw.approved.txt
+++ b/projects/SelfTest/Baselines/console.sw.approved.txt
@@ -50,6 +50,22 @@
0 == 0
-------------------------------------------------------------------------------
+#1027: Bitfields can be captured
+-------------------------------------------------------------------------------
+Compilation.tests.cpp:<line number>
+...............................................................................
+
+Compilation.tests.cpp:<line number>: PASSED:
+ REQUIRE( y.v == 0 )
+with expansion:
+ 0 == 0
+
+Compilation.tests.cpp:<line number>: PASSED:
+ REQUIRE( 0 == y.v )
+with expansion:
+ 0 == 0
+
+-------------------------------------------------------------------------------
#1147
-------------------------------------------------------------------------------
Compilation.tests.cpp:<line number>
@@ -1945,22 +1961,6 @@
!(nanf == Approx( nan ))
-------------------------------------------------------------------------------
-Bitfields can be captured (#1027)
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( y.v == 0 )
-with expansion:
- 0 == 0
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( 0 == y.v )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
CAPTURE can deal with complex expressions
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
diff --git a/projects/SelfTest/Baselines/console.swa4.approved.txt b/projects/SelfTest/Baselines/console.swa4.approved.txt
index bfa6675..322b815 100644
--- a/projects/SelfTest/Baselines/console.swa4.approved.txt
+++ b/projects/SelfTest/Baselines/console.swa4.approved.txt
@@ -50,6 +50,22 @@
0 == 0
-------------------------------------------------------------------------------
+#1027: Bitfields can be captured
+-------------------------------------------------------------------------------
+Compilation.tests.cpp:<line number>
+...............................................................................
+
+Compilation.tests.cpp:<line number>: PASSED:
+ REQUIRE( y.v == 0 )
+with expansion:
+ 0 == 0
+
+Compilation.tests.cpp:<line number>: PASSED:
+ REQUIRE( 0 == y.v )
+with expansion:
+ 0 == 0
+
+-------------------------------------------------------------------------------
#1147
-------------------------------------------------------------------------------
Compilation.tests.cpp:<line number>
@@ -352,6 +368,6 @@
CHECK( true != true )
===============================================================================
-test cases: 18 | 13 passed | 3 failed | 2 failed as expected
-assertions: 40 | 33 passed | 4 failed | 3 failed as expected
+test cases: 19 | 14 passed | 3 failed | 2 failed as expected
+assertions: 42 | 35 passed | 4 failed | 3 failed as expected
diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt
index 77a1926..2cd6081 100644
--- a/projects/SelfTest/Baselines/junit.sw.approved.txt
+++ b/projects/SelfTest/Baselines/junit.sw.approved.txt
@@ -9,6 +9,7 @@
<testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}"/>
<testcase classname="<exe-name>.global" name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" time="{duration}"/>
<testcase classname="<exe-name>.global" name="#1027" time="{duration}"/>
+ <testcase classname="<exe-name>.global" name="#1027: Bitfields can be captured" time="{duration}"/>
<testcase classname="<exe-name>.global" name="#1147" time="{duration}"/>
<testcase classname="<exe-name>.global" name="#1175 - Hidden Test" time="{duration}"/>
<testcase classname="<exe-name>.global" name="#1238" time="{duration}"/>
@@ -232,7 +233,6 @@
<testcase classname="<exe-name>.global" name="Assertions then sections/A section/Another section" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Assertions then sections/A section/Another other section" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Assorted miscellaneous tests" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Bitfields can be captured (#1027)" time="{duration}"/>
<testcase classname="<exe-name>.global" name="CAPTURE can deal with complex expressions" time="{duration}"/>
<testcase classname="<exe-name>.global" name="CAPTURE can deal with complex expressions involving commas" time="{duration}"/>
<testcase classname="<exe-name>.global" name="CAPTURE parses string and character constants" time="{duration}"/>
diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt
index 7715a04..05875d0 100644
--- a/projects/SelfTest/Baselines/xml.sw.approved.txt
+++ b/projects/SelfTest/Baselines/xml.sw.approved.txt
@@ -43,6 +43,25 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
+ <TestCase name="#1027: Bitfields can be captured" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
+ <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
+ <Original>
+ y.v == 0
+ </Original>
+ <Expanded>
+ 0 == 0
+ </Expanded>
+ </Expression>
+ <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
+ <Original>
+ 0 == y.v
+ </Original>
+ <Expanded>
+ 0 == 0
+ </Expanded>
+ </Expression>
+ <OverallResult success="true"/>
+ </TestCase>
<TestCase name="#1147" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
<Original>
@@ -2180,25 +2199,6 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
- <TestCase name="Bitfields can be captured (#1027)" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- y.v == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- 0 == y.v
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
<TestCase name="CAPTURE can deal with complex expressions" tags="[capture][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
<Info>
a := 1
diff --git a/projects/SelfTest/UsageTests/Compilation.tests.cpp b/projects/SelfTest/UsageTests/Compilation.tests.cpp
index 7f2ad8b..11d136a 100644
--- a/projects/SelfTest/UsageTests/Compilation.tests.cpp
+++ b/projects/SelfTest/UsageTests/Compilation.tests.cpp
@@ -194,6 +194,31 @@
REQUIRE(std::is_same<TypeList<int>, TypeList<int>>::value);
}
-}} // namespace CompilationTests
+ // #925
+ using signal_t = void (*) (void*);
+ struct TestClass {
+ signal_t testMethod_uponComplete_arg = nullptr;
+ };
+
+ namespace utility {
+ inline static void synchronizing_callback( void * ) { }
+ }
+
+ TEST_CASE("#925: comparing function pointer to function address failed to compile", "[!nonportable]" ) {
+ TestClass test;
+ REQUIRE(utility::synchronizing_callback != test.testMethod_uponComplete_arg);
+ }
+
+ TEST_CASE( "#1027: Bitfields can be captured" ) {
+ struct Y {
+ uint32_t v : 1;
+ };
+ Y y{ 0 };
+ REQUIRE( y.v == 0 );
+ REQUIRE( 0 == y.v );
+ }
+
+
+}} // namespace CompilationTests
diff --git a/projects/SelfTest/UsageTests/Misc.tests.cpp b/projects/SelfTest/UsageTests/Misc.tests.cpp
index 00a897d..0a053ba 100644
--- a/projects/SelfTest/UsageTests/Misc.tests.cpp
+++ b/projects/SelfTest/UsageTests/Misc.tests.cpp
@@ -440,12 +440,6 @@
REQUIRE( l == std::numeric_limits<long long>::max() );
}
-//TEST_CASE( "Divide by Zero signal handler", "[.][sig]" ) {
-// int i = 0;
-// int x = 10/i; // This should cause the signal to fire
-// CHECK( x == 0 );
-//}
-
TEST_CASE( "This test 'should' fail but doesn't", "[.][failing][!shouldfail]" ) {
SUCCEED( "oops!" );
}
diff --git a/projects/SelfTest/UsageTests/Tricky.tests.cpp b/projects/SelfTest/UsageTests/Tricky.tests.cpp
index ea507a8..d8e5465 100644
--- a/projects/SelfTest/UsageTests/Tricky.tests.cpp
+++ b/projects/SelfTest/UsageTests/Tricky.tests.cpp
@@ -402,32 +402,6 @@
CHECK( ti == typeid(int) );
}
-// #925
-using signal_t = void (*) (void*);
-
-struct TestClass {
- signal_t testMethod_uponComplete_arg = nullptr;
-};
-
-namespace utility {
- inline static void synchronizing_callback( void * ) { }
-}
-
-TEST_CASE("#925: comparing function pointer to function address failed to compile", "[!nonportable]" ) {
-
- TestClass test;
- REQUIRE(utility::synchronizing_callback != test.testMethod_uponComplete_arg);
-}
-
-TEST_CASE( "Bitfields can be captured (#1027)" ) {
- struct Y {
- uint32_t v : 1;
- };
- Y y{ 0 };
- REQUIRE( y.v == 0 );
- REQUIRE( 0 == y.v );
-}
-
TEST_CASE("#1514: stderr/stdout is not captured in tests aborted by an exception", "[output-capture][regression][.]") {
std::cout << "This would not be caught previously\n" << std::flush;
std::clog << "Nor would this\n" << std::flush;