summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/maid_test.cpp8
-rw-r--r--test/ringbuffer_test.cpp2
2 files changed, 7 insertions, 3 deletions
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<size_t> 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<Junk> a = maid->make_managed<Junk>(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 <string>
#include <thread>
-#define MSG_SIZE 20u
+constexpr const auto MSG_SIZE = 20u;
namespace {