From 636882316b5191931e144212d93665c10859ac95 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Fri, 7 Mar 2025 00:00:43 +0100 Subject: Some work on clang-tidy-ing things up --- asl/containers/hash_set_tests.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'asl/containers/hash_set_tests.cpp') diff --git a/asl/containers/hash_set_tests.cpp b/asl/containers/hash_set_tests.cpp index 515fe76..8f42e50 100644 --- a/asl/containers/hash_set_tests.cpp +++ b/asl/containers/hash_set_tests.cpp @@ -10,7 +10,7 @@ ASL_TEST(empty) { - asl::hash_set set; + const asl::hash_set set; ASL_TEST_EXPECT(set.size() == 0); @@ -42,7 +42,7 @@ ASL_TEST(a_bunch_of_ints) { asl::hash_set set; - int count = 3000; + const int count = 3000; for (int i = 0; i < count; ++i) { @@ -98,6 +98,7 @@ struct CustomHasher } }; +// NOLINTNEXTLINE(*-complexity) ASL_TEST(destructor_and_remove) { static constexpr int kCount = 200; @@ -113,9 +114,9 @@ ASL_TEST(destructor_and_remove) ASL_TEST_EXPECT(set.size() == kCount); - for (int i = 0; i < kCount; ++i) + for (const bool i : destroyed) { - ASL_TEST_EXPECT(!destroyed[i]); // NOLINT + ASL_TEST_EXPECT(!i); // NOLINT } for (int i = 0; i < kCount; i += 2) @@ -132,9 +133,9 @@ ASL_TEST(destructor_and_remove) } } - for (int i = 0; i < kCount; ++i) + for (const bool i : destroyed) { - ASL_TEST_EXPECT(destroyed[i]); // NOLINT + ASL_TEST_EXPECT(i); // NOLINT } } @@ -147,7 +148,7 @@ ASL_TEST(copy) set1.insert(i); } - asl::hash_set set2 = set1; + const asl::hash_set set2 = set1; asl::hash_set set3; set3 = set1; -- cgit