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.

преди 7 години
1234567891011121314151617
  1. #include "scope_guard.h"
  2. #include <catch.hpp>
  3. TEST_CASE("deleter called on destruction", "[ScopeGuard]")
  4. {
  5. bool executed = false;
  6. {
  7. auto guard = scope_guard([&executed] { executed = true; });
  8. static_cast<void>(guard);
  9. }
  10. REQUIRE(executed == true);
  11. }