aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-14 16:49:15 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-14 16:49:15 +0000
commit4979f32cd3fd29db5f23712f0aea3cf01a5c695d (patch)
tree0ef15030cea69e7260d6545dbd62e023a75ce346 /tests
parent790c3f4e095c57b1e2412a46e7d71f28babf07c8 (diff)
remove SkDataSet, and just store a key/value in SkAnnotation
BUG= R=mtklein@google.com Review URL: https://codereview.chromium.org/27208002 git-svn-id: http://skia.googlecode.com/svn/trunk@11759 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r--tests/DataRefTest.cpp67
1 files changed, 0 insertions, 67 deletions
diff --git a/tests/DataRefTest.cpp b/tests/DataRefTest.cpp
index 313a61066d..9043a58722 100644
--- a/tests/DataRefTest.cpp
+++ b/tests/DataRefTest.cpp
@@ -7,7 +7,6 @@
*/
#include "Test.h"
#include "SkData.h"
-#include "SkDataSet.h"
#include "SkDataTable.h"
#include "SkOrderedReadBuffer.h"
#include "SkOrderedWriteBuffer.h"
@@ -162,71 +161,6 @@ static void TestDataTable(skiatest::Reporter* reporter) {
test_globaltable(reporter);
}
-static void unrefAll(const SkDataSet::Pair pairs[], int count) {
- for (int i = 0; i < count; ++i) {
- pairs[i].fValue->unref();
- }
-}
-
-// asserts that inner is a subset of outer
-static void test_dataset_subset(skiatest::Reporter* reporter,
- const SkDataSet& outer, const SkDataSet& inner) {
- SkDataSet::Iter iter(inner);
- for (; !iter.done(); iter.next()) {
- SkData* outerData = outer.find(iter.key());
- REPORTER_ASSERT(reporter, outerData);
- REPORTER_ASSERT(reporter, outerData->equals(iter.value()));
- }
-}
-
-static void test_datasets_equal(skiatest::Reporter* reporter,
- const SkDataSet& ds0, const SkDataSet& ds1) {
- REPORTER_ASSERT(reporter, ds0.count() == ds1.count());
-
- test_dataset_subset(reporter, ds0, ds1);
- test_dataset_subset(reporter, ds1, ds0);
-}
-
-static void test_dataset(skiatest::Reporter* reporter, const SkDataSet& ds,
- int count) {
- REPORTER_ASSERT(reporter, ds.count() == count);
-
- SkDataSet::Iter iter(ds);
- int index = 0;
- for (; !iter.done(); iter.next()) {
-// const char* name = iter.key();
-// SkData* data = iter.value();
-// SkDebugf("[%d] %s:%s\n", index, name, (const char*)data->bytes());
- index += 1;
- }
- REPORTER_ASSERT(reporter, index == count);
-
- SkDynamicMemoryWStream ostream;
- ds.writeToStream(&ostream);
- SkMemoryStream istream;
- istream.setData(ostream.copyToData())->unref();
- SkDataSet copy(&istream);
-
- test_datasets_equal(reporter, ds, copy);
-}
-
-static void test_dataset(skiatest::Reporter* reporter) {
- SkDataSet set0(NULL, 0);
- SkDataSet set1("hello", SkAutoTUnref<SkData>(SkData::NewWithCString("world")));
-
- const SkDataSet::Pair pairs[] = {
- { "one", SkData::NewWithCString("1") },
- { "two", SkData::NewWithCString("2") },
- { "three", SkData::NewWithCString("3") },
- };
- SkDataSet set3(pairs, 3);
- unrefAll(pairs, 3);
-
- test_dataset(reporter, set0, 0);
- test_dataset(reporter, set1, 1);
- test_dataset(reporter, set3, 3);
-}
-
static void* gGlobal;
static void delete_int_proc(const void* ptr, size_t len, void* context) {
@@ -318,7 +252,6 @@ static void TestData(skiatest::Reporter* reporter) {
tmp->unref();
test_cstring(reporter);
- test_dataset(reporter);
test_files(reporter);
}