Index: tests/MiniDataTest.cpp |
diff --git a/tests/MiniDataTest.cpp b/tests/MiniDataTest.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cb656b3e5a7e847000e34e735d80742e0cc96964 |
--- /dev/null |
+++ b/tests/MiniDataTest.cpp |
@@ -0,0 +1,16 @@ |
+#include "SkMiniData.h" |
+#include "Test.h" |
+ |
+DEF_TEST(MiniData, r) { |
+ static const char* s = "abcdefghijklmnopqrstuvwxyz"; |
+ |
+ for (size_t len = 0; len <= 26; len++) { |
+ SkMiniData md(s, len); |
+ REPORTER_ASSERT(r, md.len() == len); |
+ REPORTER_ASSERT(r, 0 == memcmp(md.data(), s, len)); |
+ |
+ SkMiniData copy(md); |
+ REPORTER_ASSERT(r, copy.len() == len); |
+ REPORTER_ASSERT(r, 0 == memcmp(copy.data(), s, len)); |
+ } |
+} |