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

Side by Side Diff: tests/DataRefTest.cpp

Issue 23548034: Follow up to serialization validation code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« src/pipe/SkGPipeRead.cpp ('K') | « tests/ColorFilterTest.cpp ('k') | no next file » | 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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "Test.h" 8 #include "Test.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkDataSet.h" 10 #include "SkDataSet.h"
(...skipping 18 matching lines...) Expand all
29 static void test_datatable_flatten(skiatest::Reporter* reporter, 29 static void test_datatable_flatten(skiatest::Reporter* reporter,
30 SkDataTable* table) { 30 SkDataTable* table) {
31 SkOrderedWriteBuffer wb(1024); 31 SkOrderedWriteBuffer wb(1024);
32 wb.writeFlattenable(table); 32 wb.writeFlattenable(table);
33 33
34 size_t wsize = wb.size(); 34 size_t wsize = wb.size();
35 SkAutoMalloc storage(wsize); 35 SkAutoMalloc storage(wsize);
36 wb.writeToMemory(storage.get()); 36 wb.writeToMemory(storage.get());
37 37
38 SkOrderedReadBuffer rb(storage.get(), wsize); 38 SkOrderedReadBuffer rb(storage.get(), wsize);
39 SkAutoTUnref<SkDataTable> newTable((SkDataTable*)rb.readFlattenable()); 39 SkAutoTUnref<SkDataTable> newTable(rb.readFlattenableT<SkDataTable>());
40 40
41 test_is_equal(reporter, table, newTable); 41 test_is_equal(reporter, table, newTable);
42 } 42 }
43 43
44 static void test_datatable_is_empty(skiatest::Reporter* reporter, 44 static void test_datatable_is_empty(skiatest::Reporter* reporter,
45 SkDataTable* table) { 45 SkDataTable* table) {
46 REPORTER_ASSERT(reporter, table->isEmpty()); 46 REPORTER_ASSERT(reporter, table->isEmpty());
47 REPORTER_ASSERT(reporter, 0 == table->count()); 47 REPORTER_ASSERT(reporter, 0 == table->count());
48 test_datatable_flatten(reporter, table); 48 test_datatable_flatten(reporter, table);
49 } 49 }
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 tmp->unref(); 318 tmp->unref();
319 319
320 test_cstring(reporter); 320 test_cstring(reporter);
321 test_dataset(reporter); 321 test_dataset(reporter);
322 test_files(reporter); 322 test_files(reporter);
323 } 323 }
324 324
325 #include "TestClassDef.h" 325 #include "TestClassDef.h"
326 DEFINE_TESTCLASS("Data", DataTestClass, TestData) 326 DEFINE_TESTCLASS("Data", DataTestClass, TestData)
327 DEFINE_TESTCLASS("DataTable", DataTableTestClass, TestDataTable) 327 DEFINE_TESTCLASS("DataTable", DataTableTestClass, TestDataTable)
OLDNEW
« src/pipe/SkGPipeRead.cpp ('K') | « tests/ColorFilterTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698