Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

16 static void test_clz(skiatest::Reporter* reporter) {
17 REPORTER_ASSERT(reporter, 32 == SkCLZ(0));
18 REPORTER_ASSERT(reporter, 31 == SkCLZ(1));
19 REPORTER_ASSERT(reporter, 1 == SkCLZ(1 << 30));
20 REPORTER_ASSERT(reporter, 0 == SkCLZ(~0U));
30 REPORTER_ASSERT(reporter, intri == porta);
50 static void test_floor_value(skiatest::Reporter* reporter, float value) {
53 REPORTER_ASSERT(reporter, std == fast);
58 static void test_floor(skiatest::Reporter* reporter) {
64 test_floor_value(reporter, gVals[i]);
65 // test_floor_value(reporter, -gVals[i]);
72 static void test_muldivround(skiatest::Reporter* reporter) {
93 REPORTER_ASSERT(reporter, prod0 == prod1);
165 static void test_blend(skiatest::Reporter* reporter) {
181 REPORTER_ASSERT(reporter, false);
211 static void check_length(skiatest::Reporter* reporter,
219 REPORTER_ASSERT(reporter, len > 0.999f && len < 1.001f);
245 static void assert_float_equal(skiatest::Reporter* reporter, const char op[],
251 reporter->reportFailed(desc);
255 static void test_float_cast(skiatest::Reporter* reporter, float x) {
258 assert_float_equal(reporter, "cast", x, ix, iix);
261 static void test_float_floor(skiatest::Reporter* reporter, float x) {
264 assert_float_equal(reporter, "floor", x, ix, iix);
267 static void test_float_round(skiatest::Reporter* reporter, float x) {
271 assert_float_equal(reporter, "round", x, ix, iix);
274 static void test_float_ceil(skiatest::Reporter* reporter, float x) {
277 assert_float_equal(reporter, "ceil", x, ix, iix);
280 static void test_float_conversions(skiatest::Reporter* reporter, float x) {
281 test_float_cast(reporter, x);
282 test_float_floor(reporter, x);
283 test_float_round(reporter, x);
284 test_float_ceil(reporter, x);
287 static void test_int2float(skiatest::Reporter* reporter, int ival) {
291 REPORTER_ASSERT(reporter, x0 == x1);
292 REPORTER_ASSERT(reporter, x0 == x2);
295 static void unittest_fastfloat(skiatest::Reporter* reporter) {
305 test_float_conversions(reporter, gFloats[i]);
306 test_float_conversions(reporter, -gFloats[i]);
313 test_float_conversions(reporter, x);
316 test_int2float(reporter, 0);
317 test_int2float(reporter, 1);
318 test_int2float(reporter, -1);
323 test_int2float(reporter, ival);
324 test_int2float(reporter, -ival);
335 static void unittest_isfinite(skiatest::Reporter* reporter) {
341 REPORTER_ASSERT(reporter, !SkScalarIsNaN(inf));
342 REPORTER_ASSERT(reporter, !SkScalarIsNaN(-inf));
343 REPORTER_ASSERT(reporter, !SkScalarIsFinite(inf));
344 REPORTER_ASSERT(reporter, !SkScalarIsFinite(-inf));
350 REPORTER_ASSERT(reporter, SkScalarIsNaN(nan));
351 REPORTER_ASSERT(reporter, !SkScalarIsNaN(big));
352 REPORTER_ASSERT(reporter, !SkScalarIsNaN(-big));
353 REPORTER_ASSERT(reporter, !SkScalarIsNaN(0));
355 REPORTER_ASSERT(reporter, !SkScalarIsFinite(nan));
356 REPORTER_ASSERT(reporter, SkScalarIsFinite(big));
357 REPORTER_ASSERT(reporter, SkScalarIsFinite(-big));
358 REPORTER_ASSERT(reporter, SkScalarIsFinite(0));
361 static void test_muldiv255(skiatest::Reporter* reporter) {
372 REPORTER_ASSERT(reporter, iround == round);
373 REPORTER_ASSERT(reporter, itrunc == trunc);
375 REPORTER_ASSERT(reporter, itrunc <= iround);
376 REPORTER_ASSERT(reporter, iround <= a);
377 REPORTER_ASSERT(reporter, iround <= b);
382 static void test_muldiv255ceiling(skiatest::Reporter* reporter) {
388 REPORTER_ASSERT(reporter, expected_ceiling == webkit_ceiling);
390 REPORTER_ASSERT(reporter, skia_ceiling == webkit_ceiling);
395 static void test_copysign(skiatest::Reporter* reporter) {
409 REPORTER_ASSERT(reporter,
414 REPORTER_ASSERT(reporter, sk_float_copysign(x, y) == expected);
420 REPORTER_ASSERT(reporter, SkCopySign32(ix, ix) == ix);
421 REPORTER_ASSERT(reporter, SkCopySign32(ix, -ix) == -ix);
422 REPORTER_ASSERT(reporter, SkCopySign32(-ix, ix) == ix);
423 REPORTER_ASSERT(reporter, SkCopySign32(-ix, -ix) == -ix);
426 REPORTER_ASSERT(reporter, SkScalarCopySign(sx, sx) == sx);
427 REPORTER_ASSERT(reporter, SkScalarCopySign(sx, -sx) == -sx);
428 REPORTER_ASSERT(reporter, SkScalarCopySign(-sx, sx) == sx);
429 REPORTER_ASSERT(reporter, SkScalarCopySign(-sx, -sx) == -sx);
433 static void TestMath(skiatest::Reporter* reporter) {
458 test_muldiv255(reporter);
459 test_muldiv255ceiling(reporter);
460 test_copysign(reporter);
464 REPORTER_ASSERT(reporter, SkScalarIsNaN(x));
469 REPORTER_ASSERT(reporter, x == i);
473 REPORTER_ASSERT(reporter, x == SK_Fixed1);
475 REPORTER_ASSERT(reporter, x == SK_Fixed1/2);
477 REPORTER_ASSERT(reporter, x == SK_Fixed1*2);
480 REPORTER_ASSERT(reporter, x == SK_Fract1);
482 REPORTER_ASSERT(reporter, x == SK_Fract1/2);
484 REPORTER_ASSERT(reporter, x == SK_Fract1/4);
488 REPORTER_ASSERT(reporter, x == SK_Fixed1 * i);
497 REPORTER_ASSERT(reporter, clamp == clamp2);
508 check_length(reporter, p, SK_Scalar1);
512 check_length(reporter, p, SK_Scalar1);
517 REPORTER_ASSERT(reporter, result == SK_Fixed1);
519 REPORTER_ASSERT(reporter, result == 1);
522 unittest_fastfloat(reporter);
523 unittest_isfinite(reporter);
535 REPORTER_ASSERT(reporter, result != (SkFixed)SK_NaN32);
541 REPORTER_ASSERT(reporter, result == (int32_t)check);
546 REPORTER_ASSERT(reporter, result != (SkFixed)SK_NaN32);
552 REPORTER_ASSERT(reporter, result == (int32_t)check);
564 REPORTER_ASSERT(reporter, result == r2);
572 REPORTER_ASSERT(reporter, diff <= 1);
581 REPORTER_ASSERT(reporter, mod == 0 || (mod < 0) == (m < 0));
583 REPORTER_ASSERT(reporter, (diff >> 7) == 0);
593 REPORTER_ASSERT(reporter, xr == check ||
600 REPORTER_ASSERT(reporter, xr == check || xr == check-1);
605 REPORTER_ASSERT(reporter, xr == check || xr == check-1);
612 REPORTER_ASSERT(reporter, s == 0);
613 REPORTER_ASSERT(reporter, c == SK_Fixed1);
637 test_blend(reporter);
640 if (false) test_floor(reporter);
645 test_muldivround(reporter);
646 test_clz(reporter);
661 static void TestEndian(skiatest::Reporter* reporter) {
678 REPORTER_ASSERT(reporter, 0x1122 == SkTEndianSwap16<0x2211>::value);
679 REPORTER_ASSERT(reporter, 0x11223344 == SkTEndianSwap32<0x44332211>::value);
680 REPORTER_ASSERT(reporter, 0x1122334455667788ULL == SkTEndianSwap64<0x8877665544332211ULL>::value);
683 REPORTER_ASSERT(reporter, g16[i].fYang == SkEndianSwap16(g16[i].fYin));
686 REPORTER_ASSERT(reporter, g32[i].fYang == SkEndianSwap32(g32[i].fYin));
689 REPORTER_ASSERT(reporter, g64[i].fYang == SkEndianSwap64(g64[i].fYin));