diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2022-02-07 06:56:10 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2022-02-07 06:56:10 +0100 |
commit | 43f33c72804e63306580755049c09d5a81ad83e3 (patch) | |
tree | 805caeb00a832ed96a331907987d4e6a2056a391 /testsuite | |
parent | 0f86c5490ea7c2218a4394bf4c21bf3f9267a47c (diff) | |
parent | 6427d36e269d8c14e6bc55373102a4ebc971ca38 (diff) |
Merge branch 'release/debian/1.1.1-1'debian/1.1.1-1
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/backend/genesys/tests_image_pipeline.cpp | 38 | ||||
-rw-r--r-- | testsuite/tools/Makefile.am | 2 |
2 files changed, 36 insertions, 4 deletions
diff --git a/testsuite/backend/genesys/tests_image_pipeline.cpp b/testsuite/backend/genesys/tests_image_pipeline.cpp index 8edeff8..8c46e8d 100644 --- a/testsuite/backend/genesys/tests_image_pipeline.cpp +++ b/testsuite/backend/genesys/tests_image_pipeline.cpp @@ -468,7 +468,7 @@ void test_node_invert_1_bits() ASSERT_EQ(out_data, expected_data); } -void test_node_merge_mono_lines() +void test_node_merge_mono_lines_to_color() { using Data = std::vector<std::uint8_t>; @@ -481,7 +481,7 @@ void test_node_merge_mono_lines() ImagePipelineStack stack; stack.push_first_node<ImagePipelineNodeArraySource>(8, 3, PixelFormat::I8, std::move(in_data)); - stack.push_node<ImagePipelineNodeMergeMonoLines>(ColorOrder::RGB); + stack.push_node<ImagePipelineNodeMergeMonoLinesToColor>(ColorOrder::RGB); ASSERT_EQ(stack.get_output_width(), 8u); ASSERT_EQ(stack.get_output_height(), 1u); @@ -500,6 +500,37 @@ void test_node_merge_mono_lines() ASSERT_EQ(out_data, expected_data); } +void test_node_merge_color_to_gray() +{ + using Data = std::vector<std::uint8_t>; + + Data in_data = { + 0x10, 0x20, 0x30, 0x11, 0x21, 0x31, + 0x12, 0x22, 0x32, 0x13, 0x23, 0x33, + 0x14, 0x24, 0x34, 0x15, 0x25, 0x35, + 0x16, 0x26, 0x36, 0x17, 0x27, 0x37, + }; + + ImagePipelineStack stack; + stack.push_first_node<ImagePipelineNodeArraySource>(8, 1, PixelFormat::RGB888, + std::move(in_data)); + stack.push_node<ImagePipelineNodeMergeColorToGray>(); + + ASSERT_EQ(stack.get_output_width(), 8u); + ASSERT_EQ(stack.get_output_height(), 1u); + ASSERT_EQ(stack.get_output_row_bytes(), 8u); + ASSERT_EQ(stack.get_output_format(), PixelFormat::I8); + + auto out_data = stack.get_all_data(); + + Data expected_data = { + 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24 + }; + + ASSERT_EQ(out_data, expected_data); +} + + void test_node_split_mono_lines() { using Data = std::vector<std::uint8_t>; @@ -937,7 +968,8 @@ void test_image_pipeline() test_node_invert_16_bits(); test_node_invert_8_bits(); test_node_invert_1_bits(); - test_node_merge_mono_lines(); + test_node_merge_mono_lines_to_color(); + test_node_merge_color_to_gray(); test_node_split_mono_lines(); test_node_component_shift_lines(); test_node_pixel_shift_columns_no_switch(); diff --git a/testsuite/tools/Makefile.am b/testsuite/tools/Makefile.am index 99af9db..c9122ac 100644 --- a/testsuite/tools/Makefile.am +++ b/testsuite/tools/Makefile.am @@ -32,7 +32,7 @@ check.local: for mode in ascii html-backends-split html-mfgs xml statistics usermap db udev udev+acl udev+hwdb hwdb plist hal hal-new; \ do \ $(SANEDESC) -m $$mode -s $(srcdir)/data >$$mode.res ;\ - if diff -I "sane-backends 1\.0\.[0-9]\+\([-.0-9a-fgdirty]\+\)\?$$" \ + if diff -I "sane-backends 1\.[0-9]\.[0-9]\+\([-.0-9a-fgdirty]\+\)\?$$" \ $(srcdir)/data/$$mode.ref $$mode.res ; \ then \ echo "PASS: sane-desc -m $$mode -s $(srcdir)/data"; \ |