diff options
author | eldritch horrors <pennae@lix.systems> | 2024-03-21 21:33:14 +0100 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-03-31 00:07:09 +0000 |
commit | 862f20a4ba4a917e3442db2963e7f75bd7f567bf (patch) | |
tree | 4d9a876a002f0360dbc89da48b1801fe0eb69bfc /tests/unit | |
parent | 620de98d0ce8d6a9207a6a54c7fc66cfa55f7797 (diff) |
libutil: remove Pool::flushBad
this was never actually used, and bad design in the first place—why
should a bad resource be put back into the idle pool? just drop it.
Change-Id: Idab8774bee19dadae0209d404c4fb86dd4aeba1e
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/libutil/pool.cc | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/tests/unit/libutil/pool.cc b/tests/unit/libutil/pool.cc index a3743e601..3ad4ed3aa 100644 --- a/tests/unit/libutil/pool.cc +++ b/tests/unit/libutil/pool.cc @@ -65,21 +65,6 @@ namespace nix { ASSERT_EQ(pool.capacity(), 0); } - TEST(Pool, flushBadDropsOutOfScopeResources) { - auto isGood = [](const ref<TestResource> & r) { return false; }; - auto createResource = []() { return make_ref<TestResource>(); }; - - Pool<TestResource> pool = Pool<TestResource>((size_t)1, createResource, isGood); - - { - auto _r = pool.get(); - ASSERT_EQ(pool.count(), 1); - } - - pool.flushBad(); - ASSERT_EQ(pool.count(), 0); - } - // Test that the resources we allocate are being reused when they are still good. TEST(Pool, reuseResource) { auto isGood = [](const ref<TestResource> & r) { return true; }; |