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

Side by Side Diff: tests/PathTest.cpp

Issue 2333713002: change SkStreams to work with sk_sp<SkData> instead of SkData* (Closed)
Patch Set: fix xpsdevice Created 4 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 unified diff | Download patch
« no previous file with comments | « tests/PDFPrimitivesTest.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include <cmath> 8 #include <cmath>
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkGeometry.h" 10 #include "SkGeometry.h"
(...skipping 4065 matching lines...) Expand 10 before | Expand all | Expand 10 after
4076 REPORTER_ASSERT(reporter, a != b); 4076 REPORTER_ASSERT(reporter, a != b);
4077 a.reset(); 4077 a.reset();
4078 a.lineTo(1, 2); 4078 a.lineTo(1, 2);
4079 REPORTER_ASSERT(reporter, a == b); 4079 REPORTER_ASSERT(reporter, a == b);
4080 } 4080 }
4081 4081
4082 static void compare_dump(skiatest::Reporter* reporter, const SkPath& path, bool force, 4082 static void compare_dump(skiatest::Reporter* reporter, const SkPath& path, bool force,
4083 bool dumpAsHex, const char* str) { 4083 bool dumpAsHex, const char* str) {
4084 SkDynamicMemoryWStream wStream; 4084 SkDynamicMemoryWStream wStream;
4085 path.dump(&wStream, force, dumpAsHex); 4085 path.dump(&wStream, force, dumpAsHex);
4086 sk_sp<SkData> data(wStream.copyToData()); 4086 sk_sp<SkData> data = wStream.detachAsData();
4087 REPORTER_ASSERT(reporter, data->size() == strlen(str)); 4087 REPORTER_ASSERT(reporter, data->size() == strlen(str));
4088 if (strlen(str) > 0) { 4088 if (strlen(str) > 0) {
4089 REPORTER_ASSERT(reporter, !memcmp(data->data(), str, strlen(str))); 4089 REPORTER_ASSERT(reporter, !memcmp(data->data(), str, strlen(str)));
4090 } else { 4090 } else {
4091 REPORTER_ASSERT(reporter, data->data() == nullptr || !memcmp(data->data( ), str, strlen(str))); 4091 REPORTER_ASSERT(reporter, data->data() == nullptr || !memcmp(data->data( ), str, strlen(str)));
4092 } 4092 }
4093 } 4093 }
4094 4094
4095 static void test_dump(skiatest::Reporter* reporter) { 4095 static void test_dump(skiatest::Reporter* reporter) {
4096 SkPath p; 4096 SkPath p;
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
4428 PathRefTest_Private::TestPathRef(reporter); 4428 PathRefTest_Private::TestPathRef(reporter);
4429 PathTest_Private::TestPathrefListeners(reporter); 4429 PathTest_Private::TestPathrefListeners(reporter);
4430 test_dump(reporter); 4430 test_dump(reporter);
4431 test_path_crbug389050(reporter); 4431 test_path_crbug389050(reporter);
4432 test_path_crbugskia2820(reporter); 4432 test_path_crbugskia2820(reporter);
4433 test_skbug_3469(reporter); 4433 test_skbug_3469(reporter);
4434 test_skbug_3239(reporter); 4434 test_skbug_3239(reporter);
4435 test_bounds_crbug_513799(reporter); 4435 test_bounds_crbug_513799(reporter);
4436 test_fuzz_crbug_638223(); 4436 test_fuzz_crbug_638223();
4437 } 4437 }
OLDNEW
« no previous file with comments | « tests/PDFPrimitivesTest.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698