Index: tests/CPlusPlusEleven.cpp |
diff --git a/tests/CPlusPlusEleven.cpp b/tests/CPlusPlusEleven.cpp |
index 3130e6f95bd1edf99cdccd74b600e921abe68ab9..bbd8a12f88dcee4c03505af4f8e98717d88a8c97 100644 |
--- a/tests/CPlusPlusEleven.cpp |
+++ b/tests/CPlusPlusEleven.cpp |
@@ -6,6 +6,7 @@ |
*/ |
#include "Test.h" |
#include "SkTemplates.h" |
+#include "SkScopeExit.h" |
#include <utility> |
namespace { |
@@ -55,3 +56,12 @@ DEF_TEST(CPlusPlusEleven_default_move, r) { |
REPORTER_ASSERT(r, b.fFoo.fCopied); |
REPORTER_ASSERT(r, !c.fFoo.fCopied); |
} |
+ |
+DEF_TEST(SkAtScopeExit, r) { |
+ int x = 5; |
+ { |
+ SK_AT_SCOPE_EXIT(x--); |
+ REPORTER_ASSERT(r, x == 5); |
+ } |
+ REPORTER_ASSERT(r, x == 4); |
+} |