Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

18 static void test_clz(skiatest::Reporter* reporter) {
19 REPORTER_ASSERT(reporter, 32 == SkCLZ(0));
20 REPORTER_ASSERT(reporter, 31 == SkCLZ(1));
21 REPORTER_ASSERT(reporter, 1 == SkCLZ(1 << 30));
22 REPORTER_ASSERT(reporter, 0 == SkCLZ(~0U));
32 REPORTER_ASSERT(reporter, intri == porta);
52 static void test_floor_value(skiatest::Reporter* reporter, float value) {
55 REPORTER_ASSERT(reporter, std == fast);
60 static void test_floor(skiatest::Reporter* reporter) {
66 test_floor_value(reporter, gVals[i]);
67 // test_floor_value(reporter, -gVals[i]);
74 static void test_muldivround(skiatest::Reporter* reporter) {
95 REPORTER_ASSERT(reporter, prod0 == prod1);
167 static void test_blend(skiatest::Reporter* reporter) {
183 REPORTER_ASSERT(reporter, false);
213 static void check_length(skiatest::Reporter* reporter,
221 REPORTER_ASSERT(reporter, len > 0.999f && len < 1.001f);
247 static void assert_float_equal(skiatest::Reporter* reporter, const char op[],
253 reporter->reportFailed(desc);
257 static void test_float_cast(skiatest::Reporter* reporter, float x) {
260 assert_float_equal(reporter, "cast", x, ix, iix);
263 static void test_float_floor(skiatest::Reporter* reporter, float x) {
266 assert_float_equal(reporter, "floor", x, ix, iix);
269 static void test_float_round(skiatest::Reporter* reporter, float x) {
273 assert_float_equal(reporter, "round", x, ix, iix);
276 static void test_float_ceil(skiatest::Reporter* reporter, float x) {
279 assert_float_equal(reporter, "ceil", x, ix, iix);
282 static void test_float_conversions(skiatest::Reporter* reporter, float x) {
283 test_float_cast(reporter, x);
284 test_float_floor(reporter, x);
285 test_float_round(reporter, x);
286 test_float_ceil(reporter, x);
289 static void test_int2float(skiatest::Reporter* reporter, int ival) {
293 REPORTER_ASSERT(reporter, x0 == x1);
294 REPORTER_ASSERT(reporter, x0 == x2);
297 static void unittest_fastfloat(skiatest::Reporter* reporter) {
307 test_float_conversions(reporter, gFloats[i]);
308 test_float_conversions(reporter, -gFloats[i]);
315 test_float_conversions(reporter, x);
318 test_int2float(reporter, 0);
319 test_int2float(reporter, 1);
320 test_int2float(reporter, -1);
325 test_int2float(reporter, ival);
326 test_int2float(reporter, -ival);
337 static void unittest_isfinite(skiatest::Reporter* reporter) {
343 REPORTER_ASSERT(reporter, !SkScalarIsNaN(inf));
344 REPORTER_ASSERT(reporter, !SkScalarIsNaN(-inf));
345 REPORTER_ASSERT(reporter, !SkScalarIsFinite(inf));
346 REPORTER_ASSERT(reporter, !SkScalarIsFinite(-inf));
352 REPORTER_ASSERT(reporter, SkScalarIsNaN(nan));
353 REPORTER_ASSERT(reporter, !SkScalarIsNaN(big));
354 REPORTER_ASSERT(reporter, !SkScalarIsNaN(-big));
355 REPORTER_ASSERT(reporter, !SkScalarIsNaN(0));
357 REPORTER_ASSERT(reporter, !SkScalarIsFinite(nan));
358 REPORTER_ASSERT(reporter, SkScalarIsFinite(big));
359 REPORTER_ASSERT(reporter, SkScalarIsFinite(-big));
360 REPORTER_ASSERT(reporter, SkScalarIsFinite(0));
363 static void test_muldiv255(skiatest::Reporter* reporter) {
374 REPORTER_ASSERT(reporter, iround == round);
375 REPORTER_ASSERT(reporter, itrunc == trunc);
377 REPORTER_ASSERT(reporter, itrunc <= iround);
378 REPORTER_ASSERT(reporter, iround <= a);
379 REPORTER_ASSERT(reporter, iround <= b);
384 static void test_muldiv255ceiling(skiatest::Reporter* reporter) {
390 REPORTER_ASSERT(reporter, expected_ceiling == webkit_ceiling);
392 REPORTER_ASSERT(reporter, skia_ceiling == webkit_ceiling);
397 static void test_copysign(skiatest::Reporter* reporter) {
411 REPORTER_ASSERT(reporter,
416 REPORTER_ASSERT(reporter, sk_float_copysign(x, y) == expected);
422 REPORTER_ASSERT(reporter, SkCopySign32(ix, ix) == ix);
423 REPORTER_ASSERT(reporter, SkCopySign32(ix, -ix) == -ix);
424 REPORTER_ASSERT(reporter, SkCopySign32(-ix, ix) == ix);
425 REPORTER_ASSERT(reporter, SkCopySign32(-ix, -ix) == -ix);
428 REPORTER_ASSERT(reporter, SkScalarCopySign(sx, sx) == sx);
429 REPORTER_ASSERT(reporter, SkScalarCopySign(sx, -sx) == -sx);
430 REPORTER_ASSERT(reporter, SkScalarCopySign(-sx, sx) == sx);
431 REPORTER_ASSERT(reporter, SkScalarCopySign(-sx, -sx) == -sx);
435 DEF_TEST(Math, reporter) {
460 test_muldiv255(reporter);
461 test_muldiv255ceiling(reporter);
462 test_copysign(reporter);
466 REPORTER_ASSERT(reporter, SkScalarIsNaN(x));
471 REPORTER_ASSERT(reporter, x == i);
475 REPORTER_ASSERT(reporter, x == SK_Fixed1);
477 REPORTER_ASSERT(reporter, x == SK_Fixed1/2);
479 REPORTER_ASSERT(reporter, x == SK_Fixed1*2);
482 REPORTER_ASSERT(reporter, x == SK_Fract1);
484 REPORTER_ASSERT(reporter, x == SK_Fract1/2);
486 REPORTER_ASSERT(reporter, x == SK_Fract1/4);
490 REPORTER_ASSERT(reporter, x == SK_Fixed1 * i);
499 REPORTER_ASSERT(reporter, clamp == clamp2);
510 check_length(reporter, p, SK_Scalar1);
514 check_length(reporter, p, SK_Scalar1);
519 REPORTER_ASSERT(reporter, result == SK_Fixed1);
521 REPORTER_ASSERT(reporter, result == 1);
524 unittest_fastfloat(reporter);
525 unittest_isfinite(reporter);
537 REPORTER_ASSERT(reporter, result != (SkFixed)SK_NaN32);
543 REPORTER_ASSERT(reporter, result == (int32_t)check);
548 REPORTER_ASSERT(reporter, result != (SkFixed)SK_NaN32);
554 REPORTER_ASSERT(reporter, result == (int32_t)check);
566 REPORTER_ASSERT(reporter, result == r2);
574 REPORTER_ASSERT(reporter, diff <= 1);
583 REPORTER_ASSERT(reporter, mod == 0 || (mod < 0) == (m < 0));
585 REPORTER_ASSERT(reporter, (diff >> 7) == 0);
595 REPORTER_ASSERT(reporter, xr == check ||
602 REPORTER_ASSERT(reporter, xr == check || xr == check-1);
607 REPORTER_ASSERT(reporter, xr == check || xr == check-1);
614 REPORTER_ASSERT(reporter, s == 0);
615 REPORTER_ASSERT(reporter, c == SK_Fixed1);
639 test_blend(reporter);
642 if (false) test_floor(reporter);
647 test_muldivround(reporter);
648 test_clz(reporter);
656 DEF_TEST(TestEndian, reporter) {
673 REPORTER_ASSERT(reporter, 0x1122 == SkTEndianSwap16<0x2211>::value);
674 REPORTER_ASSERT(reporter, 0x11223344 == SkTEndianSwap32<0x44332211>::value);
675 REPORTER_ASSERT(reporter, 0x1122334455667788ULL == SkTEndianSwap64<0x8877665544332211ULL>::value);
678 REPORTER_ASSERT(reporter, g16[i].fYang == SkEndianSwap16(g16[i].fYin));
681 REPORTER_ASSERT(reporter, g32[i].fYang == SkEndianSwap32(g32[i].fYin));
684 REPORTER_ASSERT(reporter, g64[i].fYang == SkEndianSwap64(g64[i].fYin));
689 static void test_divmod(skiatest::Reporter* r) {