Lines Matching refs:reporter
22 static void test_clz(skiatest::Reporter* reporter) { in test_clz() argument
23 REPORTER_ASSERT(reporter, 32 == SkCLZ(0)); in test_clz()
24 REPORTER_ASSERT(reporter, 31 == SkCLZ(1)); in test_clz()
25 REPORTER_ASSERT(reporter, 1 == SkCLZ(1 << 30)); in test_clz()
26 REPORTER_ASSERT(reporter, 0 == SkCLZ(~0U)); in test_clz()
36 REPORTER_ASSERT(reporter, intri == porta); in test_clz()
40 static void test_quick_div(skiatest::Reporter* reporter) { in test_quick_div() argument
51 REPORTER_ASSERT(reporter, table[i] == gFDot6INVERSE[i + kInverseTableSize]); in test_quick_div()
63 REPORTER_ASSERT(reporter, in test_quick_div()
88 static void test_floor_value(skiatest::Reporter* reporter, float value) { in test_floor_value() argument
92 ERRORF(reporter, "fast_floor(%.9g) == %.9g != %.9g == std_floor(%.9g)", in test_floor_value()
97 static void test_floor(skiatest::Reporter* reporter) { in test_floor() argument
103 test_floor_value(reporter, gVals[i]); in test_floor()
111 static void test_muldivround(skiatest::Reporter* reporter) { in test_muldivround() argument
132 REPORTER_ASSERT(reporter, prod0 == prod1); in test_muldivround()
204 static void test_blend(skiatest::Reporter* reporter) { in test_blend() argument
216 ERRORF(reporter, "src:%d dst:%d a:%d " in test_blend()
225 static void check_length(skiatest::Reporter* reporter, in check_length() argument
233 REPORTER_ASSERT(reporter, len > 0.999f && len < 1.001f); in check_length()
260 static void assert_float_equal(skiatest::Reporter* reporter, const char op[], in assert_float_equal() argument
263 ERRORF(reporter, "%s float %g bits %x native %x skia %x\n", in assert_float_equal()
268 static void test_float_floor(skiatest::Reporter* reporter, float x) { in test_float_floor() argument
271 assert_float_equal(reporter, "floor", x, ix, iix); in test_float_floor()
274 static void test_float_round(skiatest::Reporter* reporter, float x) { in test_float_round() argument
278 assert_float_equal(reporter, "round", x, ix, iix); in test_float_round()
281 static void test_float_ceil(skiatest::Reporter* reporter, float x) { in test_float_ceil() argument
284 assert_float_equal(reporter, "ceil", x, ix, iix); in test_float_ceil()
287 static void test_float_conversions(skiatest::Reporter* reporter, float x) { in test_float_conversions() argument
288 test_float_floor(reporter, x); in test_float_conversions()
289 test_float_round(reporter, x); in test_float_conversions()
290 test_float_ceil(reporter, x); in test_float_conversions()
293 static void unittest_fastfloat(skiatest::Reporter* reporter) { in unittest_fastfloat() argument
304 test_float_conversions(reporter, gFloats[i]); in unittest_fastfloat()
305 test_float_conversions(reporter, -gFloats[i]); in unittest_fastfloat()
312 test_float_conversions(reporter, x); in unittest_fastfloat()
321 static void unittest_isfinite(skiatest::Reporter* reporter) { in unittest_isfinite() argument
326 REPORTER_ASSERT(reporter, !SkScalarIsNaN(inf)); in unittest_isfinite()
327 REPORTER_ASSERT(reporter, !SkScalarIsNaN(-inf)); in unittest_isfinite()
328 REPORTER_ASSERT(reporter, !SkScalarIsFinite(inf)); in unittest_isfinite()
329 REPORTER_ASSERT(reporter, !SkScalarIsFinite(-inf)); in unittest_isfinite()
331 REPORTER_ASSERT(reporter, SkScalarIsNaN(nan)); in unittest_isfinite()
332 REPORTER_ASSERT(reporter, !SkScalarIsNaN(big)); in unittest_isfinite()
333 REPORTER_ASSERT(reporter, !SkScalarIsNaN(-big)); in unittest_isfinite()
334 REPORTER_ASSERT(reporter, !SkScalarIsNaN(0)); in unittest_isfinite()
336 REPORTER_ASSERT(reporter, !SkScalarIsFinite(nan)); in unittest_isfinite()
337 REPORTER_ASSERT(reporter, SkScalarIsFinite(big)); in unittest_isfinite()
338 REPORTER_ASSERT(reporter, SkScalarIsFinite(-big)); in unittest_isfinite()
339 REPORTER_ASSERT(reporter, SkScalarIsFinite(0)); in unittest_isfinite()
342 static void unittest_half(skiatest::Reporter* reporter) { in unittest_half() argument
351 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(f, gFloats[i])); in unittest_half()
363 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(f, largestPositiveHalf.fF)); in unittest_half()
368 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(f, largestNegativeHalf.fF)); in unittest_half()
373 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(f, smallestPositiveHalf.fF)); in unittest_half()
378 REPORTER_ASSERT(reporter, !SkScalarIsFinite(f) ); in unittest_half()
383 REPORTER_ASSERT(reporter, f == 0.0f ); in unittest_half()
388 REPORTER_ASSERT(reporter, !SkScalarIsFinite(f) ); in unittest_half()
393 REPORTER_ASSERT(reporter, SkScalarIsNaN(f) ); in unittest_half()
398 static void test_rsqrt(skiatest::Reporter* reporter, RSqrtFn rsqrt) { in test_rsqrt() argument
407 REPORTER_ASSERT(reporter, relativeError <= maxRelativeError); in test_rsqrt()
417 REPORTER_ASSERT(reporter, relativeError <= maxRelativeError); in test_rsqrt()
427 REPORTER_ASSERT(reporter, relativeError <= maxRelativeError); in test_rsqrt()
432 static void test_muldiv255(skiatest::Reporter* reporter) { in test_muldiv255() argument
443 REPORTER_ASSERT(reporter, iround == round); in test_muldiv255()
444 REPORTER_ASSERT(reporter, itrunc == trunc); in test_muldiv255()
446 REPORTER_ASSERT(reporter, itrunc <= iround); in test_muldiv255()
447 REPORTER_ASSERT(reporter, iround <= a); in test_muldiv255()
448 REPORTER_ASSERT(reporter, iround <= b); in test_muldiv255()
453 static void test_muldiv255ceiling(skiatest::Reporter* reporter) { in test_muldiv255ceiling() argument
459 REPORTER_ASSERT(reporter, expected_ceiling == webkit_ceiling); in test_muldiv255ceiling()
461 REPORTER_ASSERT(reporter, skia_ceiling == webkit_ceiling); in test_muldiv255ceiling()
466 static void test_copysign(skiatest::Reporter* reporter) { in test_copysign() argument
480 REPORTER_ASSERT(reporter, in test_copysign()
485 REPORTER_ASSERT(reporter, sk_float_copysign(x, y) == expected); in test_copysign()
491 REPORTER_ASSERT(reporter, SkCopySign32(ix, ix) == ix); in test_copysign()
492 REPORTER_ASSERT(reporter, SkCopySign32(ix, -ix) == -ix); in test_copysign()
493 REPORTER_ASSERT(reporter, SkCopySign32(-ix, ix) == ix); in test_copysign()
494 REPORTER_ASSERT(reporter, SkCopySign32(-ix, -ix) == -ix); in test_copysign()
497 REPORTER_ASSERT(reporter, SkScalarCopySign(sx, sx) == sx); in test_copysign()
498 REPORTER_ASSERT(reporter, SkScalarCopySign(sx, -sx) == -sx); in test_copysign()
499 REPORTER_ASSERT(reporter, SkScalarCopySign(-sx, sx) == sx); in test_copysign()
500 REPORTER_ASSERT(reporter, SkScalarCopySign(-sx, -sx) == -sx); in test_copysign()
504 DEF_TEST(Math, reporter) { in DEF_TEST() argument
528 test_muldiv255(reporter); in DEF_TEST()
529 test_muldiv255ceiling(reporter); in DEF_TEST()
530 test_copysign(reporter); in DEF_TEST()
534 REPORTER_ASSERT(reporter, SkScalarIsNaN(x)); in DEF_TEST()
543 REPORTER_ASSERT(reporter, clamp == clamp2); in DEF_TEST()
554 check_length(reporter, p, SK_Scalar1); in DEF_TEST()
558 check_length(reporter, p, SK_Scalar1); in DEF_TEST()
563 REPORTER_ASSERT(reporter, result == SK_Fixed1); in DEF_TEST()
565 REPORTER_ASSERT(reporter, result == 1); in DEF_TEST()
567 REPORTER_ASSERT(reporter, result == 3); in DEF_TEST()
571 REPORTER_ASSERT(reporter, (SkFixedRoundToFixed(-SK_Fixed1 * 10) >> 1) == -SK_Fixed1 * 5); in DEF_TEST()
572 REPORTER_ASSERT(reporter, (SkFixedFloorToFixed(-SK_Fixed1 * 10) >> 1) == -SK_Fixed1 * 5); in DEF_TEST()
573 REPORTER_ASSERT(reporter, (SkFixedCeilToFixed(-SK_Fixed1 * 10) >> 1) == -SK_Fixed1 * 5); in DEF_TEST()
576 unittest_fastfloat(reporter); in DEF_TEST()
577 unittest_isfinite(reporter); in DEF_TEST()
578 unittest_half(reporter); in DEF_TEST()
579 test_rsqrt(reporter, sk_float_rsqrt); in DEF_TEST()
580 test_rsqrt(reporter, sk_float_rsqrt_portable); in DEF_TEST()
591 REPORTER_ASSERT(reporter, result != (SkFixed)SK_NaN32); in DEF_TEST()
598 ERRORF(reporter, "\nFixed Divide: %8x / %8x -> %8x %8x\n", numer, denom, result, check); in DEF_TEST()
600 REPORTER_ASSERT(reporter, result == (int32_t)check); in DEF_TEST()
603 test_blend(reporter); in DEF_TEST()
605 if (false) test_floor(reporter); in DEF_TEST()
610 test_muldivround(reporter); in DEF_TEST()
611 test_clz(reporter); in DEF_TEST()
612 test_quick_div(reporter); in DEF_TEST()
620 DEF_TEST(TestEndian, reporter) { in DEF_TEST() argument
637 REPORTER_ASSERT(reporter, 0x1122 == SkTEndianSwap16<0x2211>::value); in DEF_TEST()
638 REPORTER_ASSERT(reporter, 0x11223344 == SkTEndianSwap32<0x44332211>::value); in DEF_TEST()
639 … REPORTER_ASSERT(reporter, 0x1122334455667788ULL == SkTEndianSwap64<0x8877665544332211ULL>::value); in DEF_TEST()
642 REPORTER_ASSERT(reporter, g16[i].fYang == SkEndianSwap16(g16[i].fYin)); in DEF_TEST()
645 REPORTER_ASSERT(reporter, g32[i].fYang == SkEndianSwap32(g32[i].fYin)); in DEF_TEST()
648 REPORTER_ASSERT(reporter, g64[i].fYang == SkEndianSwap64(g64[i].fYin)); in DEF_TEST()
730 DEF_TEST(GrNextSizePow2, reporter) { in DEF_TEST() argument
735 test_nextsizepow2(reporter, test, expectedAns); in DEF_TEST()
740 test_nextsizepow2(reporter, test, expectedAns); in DEF_TEST()
745 test_nextsizepow2(reporter, test, expectedAns); in DEF_TEST()
753 test_nextsizepow2(reporter, test, test); in DEF_TEST()
756 test_nextsizepow2(reporter, test, test); in DEF_TEST()
758 test_nextsizepow2(reporter, SIZE_MAX, SIZE_MAX); in DEF_TEST()