You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
311B

  1. #include "scope_guard.h"
  2. #include <catch.hpp>
  3. using namespace guards;
  4. TEST_CASE("deleter called on destruction", "[ScopeGuard]")
  5. {
  6. bool executed = false;
  7. {
  8. auto guard = scope_guard([&executed] { executed = true; });
  9. static_cast<void>(guard);
  10. }
  11. REQUIRE(executed == true);
  12. }