Skip to content

Commit 2457bfc

Browse files
committed
test info output improved
1 parent f6a165d commit 2457bfc

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

modules/imgproc/test/test_color.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,11 +2385,11 @@ TEST(Imgproc_ColorLab_Full, bitExactness)
23852385
cvtColor(probe, result, codes[c]);
23862386

23872387
uint32_t h = adler32(result);
2388+
uint32_t goodHash = hashes[c*nIterations + iter];
23882389

2389-
if(h != hashes[c*nIterations + iter])
2390+
if(h != goodHash)
23902391
{
23912392
initLabTabs();
2392-
cvtest::TS* ts = cvtest::TS::ptr();
23932393

23942394
vector<uchar> goldBuf(probe.cols*4);
23952395
uchar* goldRow = &goldBuf[0];
@@ -2407,15 +2407,18 @@ TEST(Imgproc_ColorLab_Full, bitExactness)
24072407
if(gx[0] != rx[0] || gx[1] != rx[1] || gx[2] != rx[2])
24082408
{
24092409
next = false;
2410-
ts->printf(cvtest::TS::SUMMARY, "Error in: (%d, %d)\n", x, y);
2411-
ts->printf(cvtest::TS::SUMMARY, "Conversion code: %s\n", names[c].c_str());
2412-
ts->printf(cvtest::TS::SUMMARY, "Reference value: %d %d %d\n", gx[0], gx[1], gx[2]);
2413-
ts->printf(cvtest::TS::SUMMARY, "Actual value: %d %d %d\n", rx[0], rx[1], rx[2]);
2414-
ts->printf(cvtest::TS::SUMMARY, "Src value: %d %d %d\n", px[0], px[1], px[2]);
2415-
ts->printf(cvtest::TS::SUMMARY, "Size: (%d, %d)\n", probe.rows, probe.cols);
2416-
2417-
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
2418-
ts->set_gtest_status();
2410+
2411+
FAIL() << "Bad accuracy" << endl;
2412+
2413+
FAIL() << "Conversion code: " << names[c] << endl;
2414+
FAIL() << "Iteration: " << iter << endl;
2415+
FAIL() << "Hash vs Correct hash: " << h << ", " << goodHash << endl;
2416+
FAIL() << "Error in: (" << x << ", " << y << ")" << endl;
2417+
FAIL() << "Reference value: " << gx[0] << " " << gx[1] << " " << gx[2] << endl;
2418+
FAIL() << "Actual value: " << rx[0] << " " << rx[1] << " " << rx[2] << endl;
2419+
FAIL() << "Src value: " << px[0] << " " << px[1] << " " << px[2] << endl;
2420+
FAIL() << "Size: (" << probe.rows << ", " << probe.cols << ")" << endl;
2421+
24192422
break;
24202423
}
24212424
}

0 commit comments

Comments
 (0)