diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2022-04-05 20:14:03 +0200 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2022-04-05 20:14:03 +0200 |
commit | 182228e76f886cacd10ddd1d9da54149fe1ab969 (patch) | |
tree | d2a53c221326301c96d833aa113c776ec68430e3 | |
parent | 870894585eb4f764c03ddf0c6e0e76a9d591d33f (diff) | |
download | ccache-182228e76f886cacd10ddd1d9da54149fe1ab969.tar.gz |
style: Enable some clang-tidy readability checks for unit tests
-rw-r--r-- | unittest/.clang-tidy | 9 | ||||
-rw-r--r-- | unittest/test_util_Tokenizer.cpp | 7 |
2 files changed, 12 insertions, 4 deletions
diff --git a/unittest/.clang-tidy b/unittest/.clang-tidy index 06d78c32..978237e3 100644 --- a/unittest/.clang-tidy +++ b/unittest/.clang-tidy @@ -1,5 +1,12 @@ --- -Checks: '-*,readability-function-size' +Checks: '-*, + readability-*, + -readability-implicit-bool-conversion, + -readability-magic-numbers, + -readability-else-after-return, + -readability-named-parameter, + -readability-qualified-auto, + -readability-redundant-declaration' WarningsAsErrors: '*' # Only include headers directly in unittest. HeaderFilterRegex: 'unittest/[^/]*$' diff --git a/unittest/test_util_Tokenizer.cpp b/unittest/test_util_Tokenizer.cpp index c5efea34..ce3a5531 100644 --- a/unittest/test_util_Tokenizer.cpp +++ b/unittest/test_util_Tokenizer.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Joel Rosdahl and other contributors +// Copyright (C) 2021-2022 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -36,13 +36,14 @@ TEST_CASE("util::Tokenizer") void operator()(const char* input, const char* separators, - const std::vector<std::string>& expected) + const std::vector<std::string>& expected) const { const auto res = Util::split_into_views(input, separators, m_mode, m_includeDelimiter); REQUIRE(res.size() == expected.size()); - for (int i = 0, total = expected.size(); i < total; ++i) + for (int i = 0, total = expected.size(); i < total; ++i) { CHECK(res[i] == expected[i]); + } } Mode m_mode; |