From 88d052cb8c51bc15aaaa69301b837c7a7b88178c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 24 Sep 2021 18:49:04 +0100 Subject: Pass cppcheck --- Jamroot.jam | 3 +++ slicer/ice/testSpecifics.cpp | 4 +++- slicer/json/testSpecifics.cpp | 3 ++- slicer/test/compilation.cpp | 2 ++ slicer/test/preprocessor.cpp | 6 ++---- slicer/xml/serializer.cpp | 6 +++--- slicer/xml/testSpecifics.cpp | 3 ++- 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Jamroot.jam b/Jamroot.jam index b1dc307..63b7689 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -67,7 +67,10 @@ project tidy:db/bin/tidy/debug/checker-none/cxxstd-17-iso/visibility-hidden/testModels.h tidy:ice/cpp/* tidy:ICE_IGNORE_VERSION + tidy:ICE_MEMBER tidy:__x86_64 + tidy:boost + tidy:std ; build-project slicer ; diff --git a/slicer/ice/testSpecifics.cpp b/slicer/ice/testSpecifics.cpp index 50742e4..3786112 100644 --- a/slicer/ice/testSpecifics.cpp +++ b/slicer/ice/testSpecifics.cpp @@ -1,10 +1,12 @@ #define BOOST_TEST_MODULE ice_specifics -#include "serializer.h" #include + +#include "serializer.h" #include #include // LCOV_EXCL_START +// cppcheck-suppress unknownMacro BOOST_TEST_DONT_PRINT_LOG_VALUE(TestModule::IsoDate) // LCOV_EXCL_STOP diff --git a/slicer/json/testSpecifics.cpp b/slicer/json/testSpecifics.cpp index ba85e5e..92c699b 100644 --- a/slicer/json/testSpecifics.cpp +++ b/slicer/json/testSpecifics.cpp @@ -1,6 +1,7 @@ #define BOOST_TEST_MODULE json_specifics -#include "serializer.h" #include + +#include "serializer.h" #include #include diff --git a/slicer/test/compilation.cpp b/slicer/test/compilation.cpp index c633fd4..42f0759 100644 --- a/slicer/test/compilation.cpp +++ b/slicer/test/compilation.cpp @@ -7,7 +7,9 @@ #include // LCOV_EXCL_START +// cppcheck-suppress unknownMacro BOOST_TEST_DONT_PRINT_LOG_VALUE(std::type_info) +// cppcheck-suppress unknownMacro BOOST_TEST_DONT_PRINT_LOG_VALUE(Slicer::ModelPartType) // LCOV_EXCL_STOP diff --git a/slicer/test/preprocessor.cpp b/slicer/test/preprocessor.cpp index 506eb1e..463683c 100644 --- a/slicer/test/preprocessor.cpp +++ b/slicer/test/preprocessor.cpp @@ -28,11 +28,9 @@ total() void process(Slicer::Slicer & s, const ComponentsCount::value_type & c) { -#if BOOST_VERSION / 100 >= 1060 - BOOST_TEST_CONTEXT(c.first) -#endif - { + BOOST_TEST_CONTEXT(c.first) { s.slicePath = rootDir / c.first; + // cppcheck-suppress assertWithSideEffect BOOST_REQUIRE_EQUAL(c.second, s.Execute()); } } diff --git a/slicer/xml/serializer.cpp b/slicer/xml/serializer.cpp index ad55ae5..1ac6a63 100644 --- a/slicer/xml/serializer.cpp +++ b/slicer/xml/serializer.cpp @@ -222,14 +222,14 @@ namespace Slicer { { auto node = element->get_first_child(); while (node) { - if (auto element = dynamic_cast(node)) { + if (auto childElement = dynamic_cast(node)) { auto emp = dict->GetAnonChild(); emp->Create(); auto key = emp->GetChild(keyName); auto value = emp->GetChildRef(valueName); - key->SetValue(XmlValueSource(element->get_name())); + key->SetValue(XmlValueSource(childElement->get_name())); key->Complete(); - DocumentTreeIterateElement(element, value.Child(), value); + DocumentTreeIterateElement(childElement, value.Child(), value); emp->Complete(); } node = node->get_next_sibling(); diff --git a/slicer/xml/testSpecifics.cpp b/slicer/xml/testSpecifics.cpp index 16bfab3..d2c2d22 100644 --- a/slicer/xml/testSpecifics.cpp +++ b/slicer/xml/testSpecifics.cpp @@ -1,6 +1,7 @@ #define BOOST_TEST_MODULE xml_specifics -#include "serializer.h" #include + +#include "serializer.h" #include #include #include -- cgit v1.2.3