catch2/projects/SelfTest
Tiago Macarios 0b993d7436 Fix catch exception by reference
When compiling our codebase with clang we were getting the following
error:

GSL/tests/algorithm_tests.cpp:198:58: warning: catch handler catches by
value; should catch by reference instead
[misc-throw-by-value-catch-by-reference]
    CHECK_THROWS_AS(copy(src_span_dyn, dst_span_static), fail_fast);
                                                             ^
Looking at the catch source code exceptions were being caught by value.
One could have it designed so that users might say:

CHECK_THROWS_AS(copy(src_span_dyn, dst_span_static), fail_fast&);

But I don't think this is the intent and looking at the Catch tests
itself looks like this macro does not expect the reference:

    REQUIRE_THROWS_AS( thisThrows(), std::domain_error );
    CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error );

This commit makes Catch catch exceptions by reference instead of by
value.
2017-10-24 20:58:23 -07:00
..
Baselines Fixed expansion of _FALSE binary expression 2017-10-13 19:44:20 +01:00
SurrogateCpps Added surrogate cpp for catch_test_case_tracker 2017-01-23 15:18:23 +00:00
ApproxTests.cpp Added tests for using margin with Approx. 2017-02-27 14:15:03 +01:00
BDDTests.cpp Fixed inconsistent and trailing whitespace 2017-01-26 23:13:12 +01:00
ClassTests.cpp Stripped trailing whitespace from all source code lines 2015-11-04 18:04:15 +00:00
CmdLineTests.cpp Added some missing source files (including all SurrogateCpps) to CMake project. 2016-11-09 22:55:32 +00:00
CompilationTests.cpp Fix catch exception by reference 2017-10-24 20:58:23 -07:00
ConditionTests.cpp Removed stray code 2017-02-23 08:11:15 +00:00
DecompositionTests.cpp Add test for #914 (stringify truthy exprs in standard way) 2017-05-27 14:42:05 +02:00
EnumToString.cpp Marked tests that use C++11 features with [c++11] tag and exclude them from approval tests 2017-01-09 14:37:28 +00:00
ExceptionTests.cpp Fmt and tag fixup for #876 2017-04-04 11:31:13 +02:00
GeneratorTests.cpp Stripped trailing whitespace from all source code lines 2015-11-04 18:04:15 +00:00
MatchersTests.cpp Added first vector matchers (Contains and Equals) 2017-02-21 16:05:04 +00:00
MessageTests.cpp Capture std::clog writes and combine them with std::cerr writes (#989) 2017-08-09 15:28:40 +02:00
MiscTests.cpp Add tests for #961 2017-08-10 21:38:07 +02:00
PartTrackerTests.cpp First cut of -c/—section option for running specific sections 2017-01-23 12:36:03 +00:00
TagAliasTests.cpp Don't introduce Catch::Matchers namespace in macro 2015-11-05 18:10:33 +00:00
TestMain.cpp Don’t assume first CL arg (exe name) is present 2017-03-13 11:00:58 +00:00
ToStringGeneralTests.cpp Cosmetic fixes (whitespace and spelling) 2017-05-27 14:42:54 +02:00
ToStringPair.cpp Some minor tidy-up/ style alignment of recent toString merges 2014-09-04 07:27:09 +01:00
ToStringTuple.cpp Marked tests that use C++11 features with [c++11] tag and exclude them from approval tests 2017-01-09 14:37:28 +00:00
ToStringVector.cpp Excluded two more C++11 tests from Approval tests 2017-01-09 14:37:28 +00:00
ToStringWhich.cpp Don’t include tests that rely on varying two-phase-lookup behaviour in approval tests 2017-01-23 17:47:58 +00:00
TrickyTests.cpp Fix issue with fatal errors and non-failing assertions 2017-08-10 21:44:54 +02:00
VariadicMacrosTests.cpp handle TEST_CASE_METHOD macro consistently 2013-05-14 19:31:21 +01:00