summaryrefslogtreecommitdiffstats
path: root/test/maid_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/maid_test.cpp')
-rw-r--r--test/maid_test.cpp8
1 files changed, 6 insertions, 2 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;