From 8dbcd0c319357e2869c3597e65ea3838b334a39e Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Fri, 15 Oct 2021 11:25:54 +0200 Subject: [PATCH] fix linting errors --- include/caosdb/file_transmission/file_reader.h | 1 + test/CMakeLists.txt | 2 +- test/test_data_type.cpp | 16 ++++++++-------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/caosdb/file_transmission/file_reader.h b/include/caosdb/file_transmission/file_reader.h index 67c1247..5820c1e 100644 --- a/include/caosdb/file_transmission/file_reader.h +++ b/include/caosdb/file_transmission/file_reader.h @@ -52,6 +52,7 @@ #include <boost/filesystem/fstream.hpp> // for ifstream #include <boost/filesystem/operations.hpp> // for exists #include <boost/filesystem/path.hpp> // for path +#include <cstddef> // for size_t #include <fstream> // for ifstream, size_t #include <string> // for string diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index aefe684..9cacb63 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -41,7 +41,7 @@ set(test_cases # special linting for tests set(_CMAKE_CXX_CLANG_TIDY_TEST_CHECKS - "${_CMAKE_CXX_CLANG_TIDY_CHECKS},-cert-err58-cpp,-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-owning-memory,-modernize-use-trailing-return-type,-google-readability-avoid-underscore-in-googletest-name,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-cppcoreguidelines-avoid-goto,-hicpp-avoid-goto,-readability-function-cognitive-complexity,-cppcoreguidelines-non-private-member-variables-in-classes,-misc-non-private-member-variables-in-classes" + "${_CMAKE_CXX_CLANG_TIDY_CHECKS},-cert-err58-cpp,-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-owning-memory,-modernize-use-trailing-return-type,-google-readability-avoid-underscore-in-googletest-name,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-cppcoreguidelines-avoid-goto,-hicpp-avoid-goto,-readability-function-cognitive-complexity,-cppcoreguidelines-non-private-member-variables-in-classes,-misc-non-private-member-variables-in-classes,-clang-analyzer-cplusplus.Move" ) # add special cmake functions for gtest diff --git a/test/test_data_type.cpp b/test/test_data_type.cpp index cc59a65..b1e714d 100644 --- a/test/test_data_type.cpp +++ b/test/test_data_type.cpp @@ -134,7 +134,7 @@ TEST(test_data_type, data_type_copy_constructor) { const auto dt_string = data_type.ToString(); // copy - const DataType copy_data_type(data_type); + const DataType copy_data_type(data_type); // NOLINT (explicit copy) EXPECT_EQ(copy_data_type, data_type); EXPECT_EQ(dt_string, copy_data_type.ToString()); } @@ -146,9 +146,9 @@ TEST(test_data_type, data_type_move_constructor) { // copy for testing const DataType copy_data_type(data_type); // move - const DataType move_data_type(std::move(data_type)); - EXPECT_NE(data_type, copy_data_type); // NOLINT - EXPECT_NE(data_type.ToString(), dt_string); // NOLINT + const DataType move_data_type(std::move(data_type)); // NOLINT + EXPECT_NE(data_type, copy_data_type); // NOLINT + EXPECT_NE(data_type.ToString(), dt_string); // NOLINT EXPECT_EQ(copy_data_type, move_data_type); EXPECT_EQ(move_data_type.ToString(), dt_string); @@ -159,7 +159,7 @@ TEST(test_data_type, data_type_copy_assignment) { const auto dt_string = data_type.ToString(); // copy - DataType copy_data_type = data_type; + DataType copy_data_type = data_type; // NOLINT (explicit copy) EXPECT_EQ(copy_data_type, data_type); EXPECT_EQ(dt_string, copy_data_type.ToString()); } @@ -171,9 +171,9 @@ TEST(test_data_type, data_type_move_assignment) { // copy for testing const DataType copy_data_type(data_type); // move - DataType move_data_type = std::move(data_type); - EXPECT_NE(data_type, copy_data_type); // NOLINT - EXPECT_NE(data_type.ToString(), dt_string); // NOLINT + DataType move_data_type = std::move(data_type); // NOLINT + EXPECT_NE(data_type, copy_data_type); // NOLINT + EXPECT_NE(data_type.ToString(), dt_string); // NOLINT EXPECT_EQ(copy_data_type, move_data_type); EXPECT_EQ(move_data_type.ToString(), dt_string); -- GitLab