From 242bbeb5649b62a9af4268139afe6f57250520e0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 18 Jul 2020 10:37:35 +0200 Subject: Fix various clang-tidy warnings --- test/maid_test.cpp | 8 ++++++-- test/ringbuffer_test.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/maid_test.cpp b/test/maid_test.cpp index c2a5856..47781a0 100644 --- a/test/maid_test.cpp +++ b/test/maid_test.cpp @@ -36,10 +36,13 @@ static std::atomic n_finished_threads(0); class Junk : public Maid::Disposable { public: - explicit Junk(size_t v) : val(v) { ++n_junk; } + explicit Junk(size_t v) : _val(v) { ++n_junk; } ~Junk() override { --n_junk; } - size_t val; + size_t value() const { return _val; } + +private: + size_t _val; }; static void @@ -47,6 +50,7 @@ litter(Maid* maid) { for (size_t i = 0; i < n_junk_per_thread; ++i) { Maid::managed_ptr a = maid->make_managed(i); + assert(a->value() == i); } ++n_finished_threads; diff --git a/test/ringbuffer_test.cpp b/test/ringbuffer_test.cpp index 37a2740..d7caeaf 100644 --- a/test/ringbuffer_test.cpp +++ b/test/ringbuffer_test.cpp @@ -28,7 +28,7 @@ #include #include -#define MSG_SIZE 20u +constexpr const auto MSG_SIZE = 20u; namespace { -- cgit v1.2.1