summaryrefslogtreecommitdiff
path: root/test/test-enumDetails.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-01-08 16:34:43 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-01-08 16:34:43 +0000
commit8cd0977a3688fa705c83867c57505a47b9269369 (patch)
treeb7b48711051299607077ed31fdf3b3f6dd6cc41f /test/test-enumDetails.cpp
parentTidy shadow map creation (diff)
downloadilt-8cd0977a3688fa705c83867c57505a47b9269369.tar.bz2
ilt-8cd0977a3688fa705c83867c57505a47b9269369.tar.xz
ilt-8cd0977a3688fa705c83867c57505a47b9269369.zip
Fix up all the static analyzer warnings
Diffstat (limited to 'test/test-enumDetails.cpp')
-rw-r--r--test/test-enumDetails.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/test-enumDetails.cpp b/test/test-enumDetails.cpp
index c803cf8..db2d6d0 100644
--- a/test/test-enumDetails.cpp
+++ b/test/test-enumDetails.cpp
@@ -1,6 +1,7 @@
#define BOOST_TEST_MODULE test_enumDetails
#include "enumDetailsData.hpp"
+#include "testHelpers.h"
#include <boost/test/data/test_case.hpp>
#include <boost/test/unit_test.hpp>
#include <enumDetails.hpp>
@@ -32,14 +33,16 @@ constexpr std::array INVALID_VALUES {-1, 3, 20};
BOOST_DATA_TEST_CASE(valid_parse_##TYPE, VALID_NAMES ^ VALID_VALUES<TYPE>, in, out) \
{ \
const auto v = EnumDetails<TYPE>::parse(in); \
- BOOST_REQUIRE(v.has_value()); \
- BOOST_CHECK_EQUAL(v.value(), out); \
+ BOOST_CHECK_IF(vo, v.has_value()) { \
+ BOOST_CHECK_EQUAL(v.value(), out); \
+ } \
} \
BOOST_DATA_TEST_CASE(valid_to_string_##TYPE, VALID_VALUES<TYPE> ^ VALID_NAMES, in, out) \
{ \
const auto v = EnumDetails<TYPE>::to_string(in); \
- BOOST_CHECK(v.has_value()); \
- BOOST_CHECK_EQUAL(v.value(), out); \
+ BOOST_CHECK_IF(vo, v.has_value()) { \
+ BOOST_CHECK_EQUAL(v.value(), out); \
+ } \
}
TESTS_FOR_TYPE(GlobalScoped)