Skip to content

Commit

Permalink
test: Catch up IO with switch to variant2 migration (#607)
Browse files Browse the repository at this point in the history
See discussion at
#453 (comment)

Closes #606
  • Loading branch information
mloskot authored May 11, 2021
1 parent 0a21d74 commit 4738a38
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 65 deletions.
6 changes: 2 additions & 4 deletions test/extension/io/bmp/bmp_old_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@ void test_old_write_view()

void test_old_dynamic_image()
{
using my_img_types = mp11::mp_list
gil::any_image
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::rgba8_image_t
>;

gil::any_image<my_img_types> image;
> image;
gil::bmp_read_image(bmp_filename.c_str(), image);

gil::bmp_write_view(bmp_out + "old_dynamic_image_test.bmp", gil::view(image));
Expand Down
16 changes: 7 additions & 9 deletions test/extension/io/bmp/bmp_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,13 @@ void test_subimage()

void test_dynamic_image()
{
using my_img_types = mp11::mp_list
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::rgba8_image_t
>;

gil::any_image<my_img_types> image;
gil::any_image
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::rgba8_image_t
> image;
gil::read_image(bmp_filename.c_str(), image, gil::bmp_tag());

gil::write_view(bmp_out + "dynamic_image_test.bmp", gil::view(image), gil::bmp_tag());
Expand Down
16 changes: 7 additions & 9 deletions test/extension/io/jpeg/jpeg_old_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,13 @@ void test_old_write_view()

void test_old_dynamic_image()
{
using my_img_types = mp11::mp_list
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::rgba8_image_t
>;

gil::any_image<my_img_types> image;
gil::any_image
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::rgba8_image_t
> image;
gil::jpeg_read_image(jpeg_filename.c_str(), image);

#ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
Expand Down
6 changes: 2 additions & 4 deletions test/extension/io/jpeg/jpeg_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,13 @@ void test_subimage()

void test_dynamic_image()
{
using my_img_types = mp11::mp_list
gil::any_image
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::rgba8_image_t
>;

gil::any_image<my_img_types> image;
> image;
gil::read_image(jpeg_filename.c_str(), image, gil::jpeg_tag());

#ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
Expand Down
5 changes: 2 additions & 3 deletions test/extension/io/png/png_old_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,13 @@ void test_old_write_view()

void test_old_dynamic_image()
{
using my_img_types = mp11::mp_list
gil::any_image
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::rgba8_image_t
>;
gil::any_image<my_img_types> image;
> image;

gil::png_read_image(png_filename.c_str(), image);

Expand Down
5 changes: 2 additions & 3 deletions test/extension/io/png/png_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,13 @@ void test_subimage()

void test_dynamic_image()
{
using my_img_types = mp11::mp_list
gil::any_image
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::rgba8_image_t
>;
gil::any_image<my_img_types> image;
> image;

gil::read_image(png_filename.c_str(), image, gil::png_tag());

Expand Down
11 changes: 7 additions & 4 deletions test/extension/io/pnm/pnm_old_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ void test_old_write_view()

void test_old_dynamic_image()
{
using my_img_types =
mp11::mp_list<gil::gray8_image_t, gil::gray16_image_t, gil::rgb8_image_t, gil::gray1_image_t>;

gil::any_image<my_img_types> image;
gil::any_image
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::gray1_image_t
> image;

gil::pnm_read_image(pnm_filename.c_str(), image);

Expand Down
6 changes: 2 additions & 4 deletions test/extension/io/pnm/pnm_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,13 @@ void test_subimage()

void test_dynamic_image_test()
{
using my_img_types = mp11::mp_list
gil::any_image
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::gray1_image_t
>;

gil::any_image<my_img_types> image;
> image;

gil::read_image(pnm_filename.c_str(), image, gil::pnm_tag());

Expand Down
18 changes: 8 additions & 10 deletions test/extension/io/raw/raw_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,14 @@ void test_subimage()

void test_dynamic_image()
{
using my_img_types = mp11::mp_list
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::rgba8_image_t
>;

gil::any_image<my_img_types> image;
gil::read_image(raw_filename.c_str(), image, gil::raw_tag());
gil::any_image
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::rgba8_image_t
> image;
gil::read_image(raw_filename.c_str(), image, gil::raw_tag());
}

int main()
Expand Down
7 changes: 3 additions & 4 deletions test/extension/io/targa/targa_old_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,14 @@ void test_old_write_view()

void test_old_dynamic_image()
{
using my_img_types = mp11::mp_list
gil::any_image
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::rgba8_image_t
>;

gil::any_image<my_img_types> image;
> image;

gil::targa_read_image(targa_filename.c_str(), image);

targa_write_view(targa_out + "old_dynamic_image_test.tga", gil::view(image));
Expand Down
5 changes: 2 additions & 3 deletions test/extension/io/targa/targa_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,14 @@ void test_subimage()

void test_dynamic_image()
{
using my_img_types = mp11::mp_list
gil::any_image
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::rgba8_image_t
>;
> image;

gil::any_image<my_img_types> image;
gil::read_image(targa_filename.c_str(), image, gil::targa_tag());
gil::write_view(targa_out + "dynamic_image_test.tga", gil::view(image), gil::targa_tag());
}
Expand Down
5 changes: 2 additions & 3 deletions test/extension/io/tiff/tiff_old_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ void test_old_read_and_convert_view()

void test_old_dynamic_image()
{
using my_img_types = mp11::mp_list
gil::any_image
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgba8_image_t,
gil::gray1_image_t
>;
gil::any_image<my_img_types> image;
> image;

gil::tiff_read_image(tiff_filename.c_str(), image);

Expand Down
8 changes: 3 additions & 5 deletions test/extension/io/tiff/tiff_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,13 @@ void test_dynamic_image()
{
// FIXME: This test has been disabled for now because of compilation issues with MSVC10.

using my_img_types = mp11::mp_list
gil::any_image
<
gil::gray8_image_t,
gil::gray16_image_t,
gil::rgb8_image_t,
gil::rgba8_image_t,
gil::gray1_image_t
>;
gil::any_image<my_img_types> image;
gil::rgba8_image_t
> image;

gil::read_image(tiff_filename.c_str(), image, gil::tiff_tag());

Expand Down

0 comments on commit 4738a38

Please sign in to comment.