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

Unified Diff: tests/DataRefTest.cpp

Issue 1193553002: simplify release-proc for SkData, removing unneeded size param (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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/pdf/SkPDFFont.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/DataRefTest.cpp
diff --git a/tests/DataRefTest.cpp b/tests/DataRefTest.cpp
index 981ac54fcfcc97ac0300b064e7992df0590fadbe..9fcbeb0502d80f226fd9001f1e0064bee5ab4e2f 100644
--- a/tests/DataRefTest.cpp
+++ b/tests/DataRefTest.cpp
@@ -143,12 +143,20 @@ DEF_TEST(DataTable, reporter) {
static void* gGlobal;
-static void delete_int_proc(const void* ptr, size_t len, void* context) {
+static void delete_int_proc(const void* ptr, void* context) {
int* data = (int*)ptr;
SkASSERT(context == gGlobal);
delete[] data;
}
+#ifdef SK_SUPPORT_LEGACY_DATARELEASEPROC_PARAMS
+static void legacy_delete_int_proc(const void* ptr, size_t size, void* context) {
+ int* data = (int*)ptr;
+ SkASSERT(context == gGlobal);
+ delete[] data;
+}
+#endif
+
static void assert_len(skiatest::Reporter* reporter, SkData* ref, size_t len) {
REPORTER_ASSERT(reporter, ref->size() == len);
}
@@ -213,6 +221,10 @@ DEF_TEST(Data, reporter) {
SkAutoTUnref<SkData> r2(SkData::NewWithProc(new int[N], N*sizeof(int),
delete_int_proc, gGlobal));
SkAutoTUnref<SkData> r3(SkData::NewSubset(r1, 7, 6));
+#ifdef SK_SUPPORT_LEGACY_DATARELEASEPROC_PARAMS
+ SkAutoTUnref<SkData> r4(SkData::NewWithProc(new int[N], N*sizeof(int),
+ legacy_delete_int_proc, gGlobal));
+#endif
assert_len(reporter, r0, 0);
assert_len(reporter, r1, strlen(str));
« no previous file with comments | « src/pdf/SkPDFFont.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698