Bug 1891332 - Replace debug MOZ_ASSERT with MOZ_RELEASE_ASSERT in image tests. r=tnikkel

And MOZ_ASSERT_UNREACHABLE with MOZ_CRASH.

MOZ_ASSERT and MOZ_ASSERT_UNREACHABLE are only checked in debug builds, so release builds' tests are not checking these assertions.

Differential Revision: https://phabricator.services.mozilla.com/D207372
This commit is contained in:
Chris Peterson 2024-04-17 03:26:28 +00:00
Родитель b4f52c1006
Коммит 05289b2c2d
2 изменённых файлов: 7 добавлений и 11 удалений

Просмотреть файл

@ -59,7 +59,7 @@ struct BGRAColor {
}
BGRAColor DeviceColor() const {
MOZ_ASSERT(!mPremultiplied);
MOZ_RELEASE_ASSERT(!mPremultiplied);
if (msRGB) {
gfx::DeviceColor color = gfx::ToDeviceColor(
gfx::sRGBColor(float(mRed) / 255.0f, float(mGreen) / 255.0f,
@ -72,8 +72,8 @@ struct BGRAColor {
}
BGRAColor sRGBColor() const {
MOZ_ASSERT(msRGB);
MOZ_ASSERT(!mPremultiplied);
MOZ_RELEASE_ASSERT(msRGB);
MOZ_RELEASE_ASSERT(!mPremultiplied);
return *this;
}

Просмотреть файл

@ -186,8 +186,7 @@ TEST_F(ImageDeinterlacingFilter, WritePixelsNonProgressiveOutput51_52) {
return AsVariant(BGRAColor::Red().AsPixel());
default:
MOZ_ASSERT_UNREACHABLE("Unexpected row");
return AsVariant(BGRAColor::Transparent().AsPixel());
MOZ_CRASH("Unexpected row");
}
});
EXPECT_EQ(WriteState::FINISHED, result);
@ -259,8 +258,7 @@ TEST_F(ImageDeinterlacingFilter, WritePixelsOutput20_20) {
return AsVariant(BGRAColor::Red().AsPixel());
default:
MOZ_ASSERT_UNREACHABLE("Unexpected row");
return AsVariant(BGRAColor::Transparent().AsPixel());
MOZ_CRASH("Unexpected row");
}
});
EXPECT_EQ(WriteState::FINISHED, result);
@ -319,8 +317,7 @@ TEST_F(ImageDeinterlacingFilter, WritePixelsOutput7_7) {
return AsVariant(BGRAColor::Green().AsPixel());
default:
MOZ_ASSERT_UNREACHABLE("Unexpected row");
return AsVariant(BGRAColor::Transparent().AsPixel());
MOZ_CRASH("Unexpected row");
}
});
EXPECT_EQ(WriteState::FINISHED, result);
@ -373,8 +370,7 @@ TEST_F(ImageDeinterlacingFilter, WritePixelsOutput3_3) {
return AsVariant(BGRAColor::Red().AsPixel());
default:
MOZ_ASSERT_UNREACHABLE("Unexpected row");
return AsVariant(BGRAColor::Transparent().AsPixel());
MOZ_CRASH("Unexpected row");
}
});
EXPECT_EQ(WriteState::FINISHED, result);