Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

17 static void test_is_equal(skiatest::Reporter* reporter,
19 REPORTER_ASSERT(reporter, a->count() == b->count());
24 REPORTER_ASSERT(reporter, sizea == sizeb);
25 REPORTER_ASSERT(reporter, !memcmp(mema, memb, sizea));
29 static void test_datatable_is_empty(skiatest::Reporter* reporter,
31 REPORTER_ASSERT(reporter, table->isEmpty());
32 REPORTER_ASSERT(reporter, 0 == table->count());
35 static void test_emptytable(skiatest::Reporter* reporter) {
42 test_datatable_is_empty(reporter, table0);
43 test_datatable_is_empty(reporter, table1);
44 test_datatable_is_empty(reporter, table2);
45 test_datatable_is_empty(reporter, table3);
47 test_is_equal(reporter, table0, table1);
48 test_is_equal(reporter, table0, table2);
49 test_is_equal(reporter, table0, table3);
52 static void test_simpletable(skiatest::Reporter* reporter) {
58 REPORTER_ASSERT(reporter, itable->count() == icount);
61 REPORTER_ASSERT(reporter, sizeof(int) == itable->atSize(i));
62 REPORTER_ASSERT(reporter, *itable->atT<int>(i, &size) == idata[i]);
63 REPORTER_ASSERT(reporter, sizeof(int) == size);
67 static void test_vartable(skiatest::Reporter* reporter) {
80 REPORTER_ASSERT(reporter, table->count() == count);
83 REPORTER_ASSERT(reporter, table->atSize(i) == sizes[i]);
84 REPORTER_ASSERT(reporter, !strcmp(table->atT<const char>(i, &size),
86 REPORTER_ASSERT(reporter, size == sizes[i]);
89 REPORTER_ASSERT(reporter, strlen(s) == strlen(str[i]));
93 static void test_tablebuilder(skiatest::Reporter* reporter) {
106 REPORTER_ASSERT(reporter, table->count() == count);
109 REPORTER_ASSERT(reporter, table->atSize(i) == strlen(str[i]) + 1);
110 REPORTER_ASSERT(reporter, !strcmp(table->atT<const char>(i, &size),
112 REPORTER_ASSERT(reporter, size == strlen(str[i]) + 1);
115 REPORTER_ASSERT(reporter, strlen(s) == strlen(str[i]));
119 static void test_globaltable(skiatest::Reporter* reporter) {
128 REPORTER_ASSERT(reporter, table->count() == count);
131 REPORTER_ASSERT(reporter, table->atSize(i) == sizeof(int));
132 REPORTER_ASSERT(reporter, *table->atT<const char>(i, &size) == i);
133 REPORTER_ASSERT(reporter, sizeof(int) == size);
137 DEF_TEST(DataTable, reporter) {
138 test_emptytable(reporter);
139 test_simpletable(reporter);
140 test_vartable(reporter);
141 test_tablebuilder(reporter);
142 test_globaltable(reporter);
153 static void assert_len(skiatest::Reporter* reporter, SkData* ref, size_t len) {
154 REPORTER_ASSERT(reporter, ref->size() == len);
157 static void assert_data(skiatest::Reporter* reporter, SkData* ref,
159 REPORTER_ASSERT(reporter, ref->size() == len);
160 REPORTER_ASSERT(reporter, !memcmp(ref->data(), data, len));
163 static void test_cstring(skiatest::Reporter* reporter) {
170 REPORTER_ASSERT(reporter, r0->equals(r1));
173 REPORTER_ASSERT(reporter, 1 == r2->size());
174 REPORTER_ASSERT(reporter, 0 == *r2->bytes());
177 static void test_files(skiatest::Reporter* reporter) {
191 reporter->reportFailed(msg);
199 REPORTER_ASSERT(reporter, r1.get() != NULL);
200 REPORTER_ASSERT(reporter, r1->size() == 26);
201 REPORTER_ASSERT(reporter, strncmp(static_cast<const char*>(r1->data()), s, 26) == 0);
205 REPORTER_ASSERT(reporter, r2.get() != NULL);
206 REPORTER_ASSERT(reporter, r2->size() == 26);
207 REPORTER_ASSERT(reporter, strncmp(static_cast<const char*>(r2->data()), s, 26) == 0);
210 DEF_TEST(Data, reporter) {
220 assert_len(reporter, r0, 0);
221 assert_len(reporter, r1, strlen(str));
222 assert_len(reporter, r2, N * sizeof(int));
223 assert_len(reporter, r3, 6);
225 assert_data(reporter, r1, str, strlen(str));
226 assert_data(reporter, r3, "people", 6);
229 assert_len(reporter, tmp, 0);
232 assert_len(reporter, tmp, 0);
235 test_cstring(reporter);
236 test_files(reporter);