Browse Source

Test case for unique resource with std::function deleter added.

main
offa 4 years ago
parent
commit
d08bc6f8ca
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      test/UniqueResourceTest.cpp

+ 8
- 0
test/UniqueResourceTest.cpp View File

@@ -237,3 +237,11 @@ TEST_CASE("noexcept move", "[UniqueResource]")
auto temp = std::move(guard);
guard = std::move(temp);
}

TEST_CASE("std::function deleter", "[UniqueResource]")
{
const auto deleter = std::function<void(Handle)>{[]([[maybe_unused]] Handle h) { }};
sr::unique_resource guard1{Handle{3}, deleter};
sr::unique_resource guard2{Handle{4}, deleter};
guard2 = std::move(guard1);
}

Loading…
Cancel
Save