2022-03-06 13:46:03 +01:00
|
|
|
#include <Bmp.h>
|
|
|
|
#include <stdexcept>
|
|
|
|
#include "Catch2.h"
|
|
|
|
|
|
|
|
using namespace Leonetienne::BmpPP;
|
|
|
|
using namespace Eule;
|
|
|
|
|
|
|
|
// Tests the mirror horizontal function against reference images
|
|
|
|
TEST_CASE(__FILE__"/Mirroring produces the correct results", "[Mirroring][MirrorHorizontally]")
|
|
|
|
{
|
|
|
|
SECTION("RGB") {
|
|
|
|
// Read a gradient image
|
2022-03-06 15:09:15 +01:00
|
|
|
BMP bmp("base_fuwadera2.bmp");
|
2022-03-06 13:46:03 +01:00
|
|
|
|
|
|
|
// Mirror it
|
|
|
|
bmp = bmp.MirrorHorizontally();
|
|
|
|
|
|
|
|
// Read reference image
|
2022-03-06 15:09:15 +01:00
|
|
|
const BMP reference("base_fuwadera2_mirror_hor.bmp");
|
2022-03-06 13:46:03 +01:00
|
|
|
|
|
|
|
// Assert that they are equal
|
|
|
|
REQUIRE(bmp == reference);
|
|
|
|
}
|
|
|
|
|
|
|
|
SECTION("RGBA") {
|
|
|
|
// Read a gradient image
|
2022-03-06 15:09:15 +01:00
|
|
|
BMP bmp("basea_fuwadera2.bmp");
|
2022-03-06 13:46:03 +01:00
|
|
|
|
|
|
|
// Mirror it
|
|
|
|
bmp = bmp.MirrorHorizontally();
|
|
|
|
|
|
|
|
// Read reference image
|
2022-03-06 15:09:15 +01:00
|
|
|
const BMP reference("basea_fuwadera2_mirror_hor.bmp");
|
2022-03-06 13:46:03 +01:00
|
|
|
|
|
|
|
// Assert that they are equal
|
|
|
|
REQUIRE(bmp == reference);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|