diff options
| author | Martin Hořeňovský | 2020-08-19 17:44:22 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-08-20 20:42:21 +0200 |
| commit | 1a97af45f168b24769301906cad9dcfe235d78e5 (patch) | |
| tree | 9ba8714754f38df9e7d446b959d753a385215bc3 /tests | |
| parent | 2e480b6e560ad8412337b49b6327c7ac303bfb01 (diff) | |
| download | catch3-1a97af45f168b24769301906cad9dcfe235d78e5.tar.gz | |
Cleanup some stuff found by MSVC's /analyze
* Added some missing `noexcept`s on custom destructors.
* Fixed `std::move` being called on a const-reference.
* Initialized `ScopedMessage::m_moved` in class definition, instead
of doing so in constructors explicitly.
* Turned some `enum`s into `enum class`es.
* Initialized `StreamingReporterBase::currentTestCaseInfo` in class
definition.
* Some cleanups in SelfTest code.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/SelfTest/IntrospectiveTests/UniquePtr.tests.cpp | 4 | ||||
| -rw-r--r-- | tests/SelfTest/UsageTests/Tricky.tests.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/SelfTest/IntrospectiveTests/UniquePtr.tests.cpp b/tests/SelfTest/IntrospectiveTests/UniquePtr.tests.cpp index bc7fe228..fcdb8a32 100644 --- a/tests/SelfTest/IntrospectiveTests/UniquePtr.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/UniquePtr.tests.cpp @@ -104,10 +104,10 @@ namespace { move_detector(move_detector const& rhs) = default; move_detector& operator=(move_detector const& rhs) = default; - move_detector(move_detector&& rhs) { + move_detector(move_detector&& rhs) noexcept { rhs.has_moved = true; } - move_detector& operator=(move_detector&& rhs) { + move_detector& operator=(move_detector&& rhs) noexcept { rhs.has_moved = true; return *this; } diff --git a/tests/SelfTest/UsageTests/Tricky.tests.cpp b/tests/SelfTest/UsageTests/Tricky.tests.cpp index 9fe4779d..7627f0a0 100644 --- a/tests/SelfTest/UsageTests/Tricky.tests.cpp +++ b/tests/SelfTest/UsageTests/Tricky.tests.cpp @@ -185,7 +185,7 @@ struct Obj { Obj():prop(&p){} - int p; + int p = 0; int* prop; }; |