Lines Matching refs:reporter

25 static void test_is_equal(skiatest::Reporter* reporter,
27 REPORTER_ASSERT(reporter, a->count() == b->count());
32 REPORTER_ASSERT(reporter, sizea == sizeb);
33 REPORTER_ASSERT(reporter, !memcmp(mema, memb, sizea));
37 static void test_datatable_is_empty(skiatest::Reporter* reporter, SkDataTable* table) {
38 REPORTER_ASSERT(reporter, table->isEmpty());
39 REPORTER_ASSERT(reporter, 0 == table->count());
42 static void test_emptytable(skiatest::Reporter* reporter) {
48 test_datatable_is_empty(reporter, table0.get());
49 test_datatable_is_empty(reporter, table1.get());
50 test_datatable_is_empty(reporter, table2.get());
51 test_datatable_is_empty(reporter, table3.get());
53 test_is_equal(reporter, table0.get(), table1.get());
54 test_is_equal(reporter, table0.get(), table2.get());
55 test_is_equal(reporter, table0.get(), table3.get());
58 static void test_simpletable(skiatest::Reporter* reporter) {
62 REPORTER_ASSERT(reporter, itable->count() == icount);
65 REPORTER_ASSERT(reporter, sizeof(int) == itable->atSize(i));
66 REPORTER_ASSERT(reporter, *itable->atT<int>(i, &size) == idata[i]);
67 REPORTER_ASSERT(reporter, sizeof(int) == size);
71 static void test_vartable(skiatest::Reporter* reporter) {
83 REPORTER_ASSERT(reporter, table->count() == count);
86 REPORTER_ASSERT(reporter, table->atSize(i) == sizes[i]);
87 REPORTER_ASSERT(reporter, !strcmp(table->atT<const char>(i, &size),
89 REPORTER_ASSERT(reporter, size == sizes[i]);
92 REPORTER_ASSERT(reporter, strlen(s) == strlen(str[i]));
96 static void test_globaltable(skiatest::Reporter* reporter) {
105 REPORTER_ASSERT(reporter, table->count() == count);
108 REPORTER_ASSERT(reporter, table->atSize(i) == sizeof(int));
109 REPORTER_ASSERT(reporter, *table->atT<const char>(i, &size) == i);
110 REPORTER_ASSERT(reporter, sizeof(int) == size);
114 DEF_TEST(DataTable, reporter) {
115 test_emptytable(reporter);
116 test_simpletable(reporter);
117 test_vartable(reporter);
118 test_globaltable(reporter);
129 static void assert_len(skiatest::Reporter* reporter, const sk_sp<SkData>& ref, size_t len) {
130 REPORTER_ASSERT(reporter, ref->size() == len);
133 static void assert_data(skiatest::Reporter* reporter, const sk_sp<SkData>& ref,
135 REPORTER_ASSERT(reporter, ref->size() == len);
136 REPORTER_ASSERT(reporter, !memcmp(ref->data(), data, len));
139 static void test_cstring(skiatest::Reporter* reporter) {
146 REPORTER_ASSERT(reporter, r0->equals(r1.get()));
149 REPORTER_ASSERT(reporter, 1 == r2->size());
150 REPORTER_ASSERT(reporter, 0 == *r2->bytes());
153 static void test_files(skiatest::Reporter* reporter) {
165 ERRORF(reporter, "Failed to create tmp file %s\n", path.c_str());
173 REPORTER_ASSERT(reporter, r1.get() != nullptr);
174 REPORTER_ASSERT(reporter, r1->size() == 26);
175 REPORTER_ASSERT(reporter, strncmp(static_cast<const char*>(r1->data()), s, 26) == 0);
179 REPORTER_ASSERT(reporter, r2.get() != nullptr);
180 REPORTER_ASSERT(reporter, r2->size() == 26);
181 REPORTER_ASSERT(reporter, strncmp(static_cast<const char*>(r2->data()), s, 26) == 0);
184 DEF_TEST(Data, reporter) {
193 assert_len(reporter, r0, 0);
194 assert_len(reporter, r1, strlen(str));
195 assert_len(reporter, r2, N * sizeof(int));
196 assert_len(reporter, r3, 6);
198 assert_data(reporter, r1, str, strlen(str));
199 assert_data(reporter, r3, "people", 6);
202 assert_len(reporter, tmp, 0);
204 assert_len(reporter, tmp, 0);
206 test_cstring(reporter);
207 test_files(reporter);
210 DEF_TEST(Data_empty, reporter) {
222 REPORTER_ASSERT(reporter, array[i]->size() == 0);
224 REPORTER_ASSERT(reporter, array[i]->equals(array[j].get()));