aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/TemplatesTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/TemplatesTest.cpp')
-rw-r--r--tests/TemplatesTest.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/TemplatesTest.cpp b/tests/TemplatesTest.cpp
index fc3bc320af..9d5ca7735f 100644
--- a/tests/TemplatesTest.cpp
+++ b/tests/TemplatesTest.cpp
@@ -126,3 +126,20 @@ DEF_TEST(AutoReallocToZero, reporter) {
test_realloc_to_zero<SkAutoTMalloc<int> >(reporter);
test_realloc_to_zero<SkAutoSTMalloc<kStackPreallocCount, int> >(reporter);
}
+
+DEF_TEST(SkAutoTMallocSelfMove, r) {
+#if defined(__clang__)
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wself-move"
+#endif
+
+ SkAutoTMalloc<int> foo(20);
+ REPORTER_ASSERT(r, foo.get());
+
+ foo = std::move(foo);
+ REPORTER_ASSERT(r, foo.get());
+
+#if defined(__clang__)
+ #pragma clang diagnostic pop
+#endif
+}