88
99namespace visp {
1010
11- TEST_CASE (image_formats) {
11+ VISP_TEST (image_formats) {
1212 auto formats = std::array{image_format::rgba_u8, image_format::bgra_u8, image_format::argb_u8,
1313 image_format::rgb_u8, image_format::alpha_u8, image_format::rgba_f32,
1414 image_format::rgb_f32, image_format::alpha_f32};
@@ -36,14 +36,14 @@ TEST_CASE(image_formats) {
3636 }
3737}
3838
39- TEST_CASE (image_load) {
39+ VISP_TEST (image_load) {
4040 image_data img = image_load ((test_dir ().input / " cat-and-hat.jpg" ).string ().c_str ());
4141 CHECK (img.extent == i32x2{512 , 512 });
4242 CHECK (img.format == image_format::rgb_u8);
4343 CHECK (n_bytes (img) == 512 * 512 * 3 );
4444}
4545
46- TEST_CASE (image_save) {
46+ VISP_TEST (image_save) {
4747 image_data img = image_alloc (i32x2{16 , 16 }, image_format::rgba_u8);
4848 for (int i = 0 ; i < 16 * 16 ; ++i) {
4949 img.data .get ()[i * 4 + 0 ] = 255 ;
@@ -74,20 +74,20 @@ void test_image_u8_to_f32(
7474 CHECK_IMAGES_EQUAL (output, expected);
7575}
7676
77- TEST_CASE (image_alpha_u8_to_alpha_f32) {
77+ VISP_TEST (image_alpha_u8_to_alpha_f32) {
7878 test_image_u8_to_f32 (
7979 image_format::alpha_u8, image_format::alpha_f32, //
8080 std::array<uint8_t , 4 >{0 , 128 , 190 , 255 }, //
8181 std::array<float , 4 >{0 .05f , 0 .3f , 0 .4225f , 0 .55f });
8282}
83- TEST_CASE (image_rgb_u8_to_rgb_f32) {
83+ VISP_TEST (image_rgb_u8_to_rgb_f32) {
8484 test_image_u8_to_f32 (
8585 image_format::rgb_u8, image_format::rgb_f32, //
8686 std::array<uint8_t , 12 >{0 , 128 , 192 , 255 , 0 , 128 , 128 , 255 , 0 , 128 , 64 , 255 }, //
8787 std::array<float , 12 >{
8888 0 .05f , 0 .7f , -1 .05f , 0 .55f , 0 .2f , -0 .8f , 0 .3f , 1 .2f , -0 .3f , 0 .3f , 0 .45f , -1 .3f });
8989}
90- TEST_CASE (image_rgba_u8_to_rgb_f32) {
90+ VISP_TEST (image_rgba_u8_to_rgb_f32) {
9191 test_image_u8_to_f32 (
9292 image_format::rgba_u8, image_format::rgb_f32, //
9393 std::array<uint8_t , 16 >{
@@ -101,7 +101,7 @@ TEST_CASE(image_rgba_u8_to_rgb_f32) {
101101 0 .3f , 1 .2f , -0 .3f , //
102102 0 .3f , 0 .45f , -1 .3f });
103103}
104- TEST_CASE (image_rgba_u8_to_rgba_f32) {
104+ VISP_TEST (image_rgba_u8_to_rgba_f32) {
105105 test_image_u8_to_f32 (
106106 image_format::rgba_u8, image_format::rgba_f32, //
107107 std::array<uint8_t , 16 >{
@@ -115,7 +115,7 @@ TEST_CASE(image_rgba_u8_to_rgba_f32) {
115115 0 .3f , 1 .2f , -0 .3f , 0 .9f , 0 .3f , //
116116 0 .45f , -1 .3f , 1 .4f });
117117}
118- TEST_CASE (image_bgra_u8_to_rgb_f32) {
118+ VISP_TEST (image_bgra_u8_to_rgb_f32) {
119119 test_image_u8_to_f32 (
120120 image_format::bgra_u8, image_format::rgb_f32, //
121121 std::array<uint8_t , 16 >{
@@ -129,7 +129,7 @@ TEST_CASE(image_bgra_u8_to_rgb_f32) {
129129 0 .3f , 1 .2f , -0 .3f , //
130130 0 .3f , 0 .45f , -1 .3f });
131131}
132- TEST_CASE (image_argb_u8_to_rgb_f32) {
132+ VISP_TEST (image_argb_u8_to_rgb_f32) {
133133 test_image_u8_to_f32 (
134134 image_format::argb_u8, image_format::rgb_f32, //
135135 std::array<uint8_t , 16 >{
@@ -144,7 +144,7 @@ TEST_CASE(image_argb_u8_to_rgb_f32) {
144144 0 .3f , 0 .45f , -1 .3f });
145145}
146146
147- TEST_CASE (image_u8_to_f32_tiled_pad) {
147+ VISP_TEST (image_u8_to_f32_tiled_pad) {
148148 std::array<uint8_t , 9 > input_data = {0 , 0 , 102 , 0 , 0 , 255 , 0 , 0 , 102 };
149149 std::array<float , 4 > expected_data = {1 .0f , 1 .0f , 0 .4f , 0 .4f };
150150 image_view input (i32x2{3 , 3 }, image_format::alpha_u8, input_data);
@@ -159,7 +159,7 @@ TEST_CASE(image_u8_to_f32_tiled_pad) {
159159 CHECK_IMAGES_EQUAL (output, expected);
160160}
161161
162- TEST_CASE (image_alpha_f32_to_alpha_u8) {
162+ VISP_TEST (image_alpha_f32_to_alpha_u8) {
163163 std::array<float , 4 > input_data{0 .0f , 0 .3f , 0 .4225f , 1 .1f };
164164 std::array<uint8_t , 4 > expected_data = {0 , 76 , 107 , 255 };
165165 image_view input (i32x2{2 , 2 }, image_format::alpha_f32, input_data.data ());
@@ -171,7 +171,7 @@ TEST_CASE(image_alpha_f32_to_alpha_u8) {
171171 CHECK_IMAGES_EQUAL (output, expected);
172172}
173173
174- TEST_CASE (image_rgb_f32_to_rgba_u8) {
174+ VISP_TEST (image_rgb_f32_to_rgba_u8) {
175175 std::array<float , 6 > input_data{0 .0f , 0 .31f , -0 .51f , 1 .0f , 0 .2f , 1 .8f };
176176 std::array<uint8_t , 8 > expected_data = {0 , 79 , 0 , 255 , 255 , 51 , 255 , 255 };
177177 image_view input (i32x2{2 , 1 }, image_format::rgb_f32, input_data.data ());
@@ -183,7 +183,7 @@ TEST_CASE(image_rgb_f32_to_rgba_u8) {
183183 CHECK_IMAGES_EQUAL (output, expected);
184184}
185185
186- TEST_CASE (image_scale) {
186+ VISP_TEST (image_scale) {
187187 image_data img = image_alloc (i32x2{8 , 8 }, image_format::rgba_u8);
188188 for (int i = 0 ; i < 8 * 8 ; ++i) {
189189 img.data [i * 4 + 0 ] = uint8_t (255 );
@@ -202,7 +202,7 @@ TEST_CASE(image_scale) {
202202 }
203203}
204204
205- TEST_CASE (image_alpha_composite) {
205+ VISP_TEST (image_alpha_composite) {
206206 std::array<uint8_t , 2 * 2 * 4 > fg_data = {255 , 0 , 0 , 255 , 0 , 255 , 0 , 255 , //
207207 0 , 0 , 255 , 255 , 255 , 255 , 0 , 255 };
208208 image_view fg{i32x2{2 , 2 }, image_format::rgba_u8, fg_data};
@@ -222,7 +222,7 @@ TEST_CASE(image_alpha_composite) {
222222 CHECK_IMAGES_EQUAL (output, expected);
223223}
224224
225- TEST_CASE (image_blur) {
225+ VISP_TEST (image_blur) {
226226 constexpr i32x2 extent{6 , 6 };
227227 // clang-format off
228228 std::array<float , extent[0 ] * extent[1 ]> input_data = {
@@ -252,7 +252,7 @@ TEST_CASE(image_blur) {
252252 CHECK_IMAGES_EQUAL (output, expected);
253253}
254254
255- TEST_CASE (tile_merge) {
255+ VISP_TEST (tile_merge) {
256256 std::array<std::array<f32x3, 5 * 5 >, 4 > tiles;
257257 for (int t = 0 ; t < 4 ; ++t) {
258258 float v = float (t);
@@ -290,7 +290,7 @@ TEST_CASE(tile_merge) {
290290 CHECK_IMAGES_EQUAL (dst_span, expected);
291291}
292292
293- TEST_CASE (tile_merge_blending) {
293+ VISP_TEST (tile_merge_blending) {
294294 std::array<f32x3, 22 * 19 > dst{};
295295 auto dst_span = image_span ({22 , 19 }, dst);
296296
0 commit comments