@@ -140,8 +140,13 @@ namespace sr | |||
return m_resource; | |||
} | |||
const D& get_deleter() const noexcept | |||
{ | |||
return m_deleter; | |||
} | |||
unique_resource& operator=(unique_resource&& other); | |||
unique_resource& operator=(unique_resource&& other); // TODO: Implement | |||
unique_resource& operator=(const unique_resource&) = delete; | |||
@@ -222,4 +222,15 @@ TEST_CASE("get returns resource", "[UniqueResource]") | |||
CHECK(guard.get() == 3); | |||
} | |||
// TODO: Pointer access functions | |||
TEST_CASE("deleter access", "[UniqueResource]") | |||
{ | |||
auto guard = sr::make_unique_resource(Handle{3}, deleter); | |||
guard.release(); | |||
{ | |||
REQUIRE_CALL(m, deleter(8)); | |||
guard.get_deleter()(8); | |||
} | |||
} |