diff options
author | eldritch horrors <pennae@lix.systems> | 2024-04-05 03:52:51 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-04-05 20:13:02 +0000 |
commit | 38dc6f5b69da81dfd21780ef16efaa297f9c2231 (patch) | |
tree | 84e362fbba62144119bb7b721781091fa2e63106 /tests/unit/libutil/pool.cc | |
parent | 52f741c23af84ebb67f7295600069a9c6e83aec4 (diff) |
Revert "libutil: drop Pool resources on exceptional free"
This reverts commit de2884b82b376d10de5c400d8e73bc7d98f195d2.
Change-Id: I1fa301149d7c2ed3d266a40c15b2d010e12e44e6
Diffstat (limited to 'tests/unit/libutil/pool.cc')
-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 3ad4ed3aa..90ee509ba 100644 --- a/tests/unit/libutil/pool.cc +++ b/tests/unit/libutil/pool.cc @@ -109,19 +109,4 @@ namespace nix { ASSERT_NE(h->num, counter); } } - - TEST(Pool, throwingOperationDropsResource) - { - auto createResource = []() { return make_ref<TestResource>(); }; - - Pool<TestResource> pool = Pool<TestResource>((size_t)1, createResource); - - ASSERT_THROW({ - auto _r = pool.get(); - ASSERT_EQ(pool.count(), 1); - throw 1; - }, int); - - ASSERT_EQ(pool.count(), 0); - } } |