Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: tests/MiniDataTest.cpp

Issue 573323002: Add SkMiniData. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: MSVC doesn't like uint8_t data[0]. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkMiniData.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
+ }
+}
« no previous file with comments | « src/core/SkMiniData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698