1 #ifndef RecordTestUtils_DEFINED
2 #define RecordTestUtils_DEFINED
7 // If the command we're reading is a U, set ptr to it, otherwise set it to NULL.
10 ReadAs() : ptr(NULL), type(SkRecords::Type(~0)) {}
15 void operator()(const U& r) { ptr = &r; type = U::kType; }
18 void operator()(const T&) { type = U::kType; }
21 // Assert that the ith command in record is of type T, and return it.
23 static const T* assert_type(skiatest::Reporter* r, const SkRecord& record, unsigned index) {
25 record.visit<void>(index, reader);
26 REPORTER_ASSERT(r, T::kType == reader.type);
27 REPORTER_ASSERT(r, SkToBool(reader.ptr));
31 #endif//RecordTestUtils_DEFINED