Browse Source

DebugTools: use Debug instead of Error for testing comparator output.

Otherwise unrelated error messages such as file read failures would get
included, making the tests fail. The Debug output on the other hand
isn't used for any internal reporting.
pull/556/head
Vladimír Vondruš 4 years ago
parent
commit
37f826c85c
  1. 8
      src/Magnum/DebugTools/Test/CompareImageTest.cpp

8
src/Magnum/DebugTools/Test/CompareImageTest.cpp

@ -591,8 +591,8 @@ void CompareImageTest::compareDifferentSize() {
TestSuite::ComparisonStatusFlags flags = compare(a, b); TestSuite::ComparisonStatusFlags flags = compare(a, b);
/* No diagnostic as we don't have any expected filename */ /* No diagnostic as we don't have any expected filename */
CORRADE_COMPARE(flags, TestSuite::ComparisonStatusFlag::Failed); CORRADE_COMPARE(flags, TestSuite::ComparisonStatusFlag::Failed);
Error e(&out); Debug d{&out};
compare.printMessage(flags, e, "a", "b"); compare.printMessage(flags, d, "a", "b");
} }
CORRADE_COMPARE(out.str(), "Images a and b have different size, actual Vector(3, 4) but Vector(3, 5) expected.\n"); CORRADE_COMPARE(out.str(), "Images a and b have different size, actual Vector(3, 4) but Vector(3, 5) expected.\n");
@ -610,8 +610,8 @@ void CompareImageTest::compareDifferentFormat() {
TestSuite::ComparisonStatusFlags flags = compare(a, b); TestSuite::ComparisonStatusFlags flags = compare(a, b);
/* No diagnostic as we don't have any expected filename */ /* No diagnostic as we don't have any expected filename */
CORRADE_COMPARE(flags, TestSuite::ComparisonStatusFlag::Failed); CORRADE_COMPARE(flags, TestSuite::ComparisonStatusFlag::Failed);
Error e(&out); Debug d{&out};
compare.printMessage(flags, e, "a", "b"); compare.printMessage(flags, d, "a", "b");
} }
CORRADE_COMPARE(out.str(), "Images a and b have different format, actual PixelFormat::RGBA32F but PixelFormat::RGB32F expected.\n"); CORRADE_COMPARE(out.str(), "Images a and b have different format, actual PixelFormat::RGBA32F but PixelFormat::RGB32F expected.\n");

Loading…
Cancel
Save