Skip to content

Commit

Permalink
Core (Tests): Add test for BMP image loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaixiong committed Jan 18, 2025
1 parent 8dc42f2 commit 08a18e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Binary file not shown.
Binary file added libvisual/tests/images/additive-colors-rgb24.bmp
Binary file not shown.
8 changes: 8 additions & 0 deletions libvisual/tests/video_test/video_load_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ namespace

void test_load_indexed8 ()
{
auto bmp_image {LV::Video::create_from_file ("../images/additive-colors-indexed8.bmp")};
LV_TEST_ASSERT (bmp_image);

auto png_image {LV::Video::create_from_file ("../images/additive-colors-indexed8.png")};
LV_TEST_ASSERT (png_image);

Expand All @@ -102,11 +105,15 @@ namespace
auto raw_image_rgb24 {LV::Video::create (raw_image->get_width (), raw_image->get_height (), VISUAL_VIDEO_DEPTH_24BIT)};
raw_image_rgb24->convert_depth (raw_image);

LV_TEST_ASSERT (bmp_image->has_same_content (raw_image));
LV_TEST_ASSERT (png_image->has_same_content (raw_image_rgb24));
}

void test_load_rgb24 ()
{
auto bmp_image {LV::Video::create_from_file ("../images/additive-colors-rgb24.bmp")};
LV_TEST_ASSERT (bmp_image);

auto png_image {LV::Video::create_from_file ("../images/additive-colors-rgb24.png")};
LV_TEST_ASSERT (png_image);

Expand All @@ -115,6 +122,7 @@ namespace
png_image->get_height (),
VISUAL_VIDEO_DEPTH_24BIT)};

LV_TEST_ASSERT (bmp_image->has_same_content (raw_image));
LV_TEST_ASSERT (png_image->has_same_content (raw_image));
}

Expand Down

0 comments on commit 08a18e1

Please sign in to comment.