From 9cca066ee81edde4f5599adfb7977afe3d5b57be Mon Sep 17 00:00:00 2001 From: rpici Date: Wed, 13 Mar 2019 09:42:47 -0500 Subject: [PATCH] Fix bug in test_tiff.cpp The big endian data in the tiff_sample_data array was never being tested. This could be observed by e.g. changing the 9th byte in the big endian data from 0xde to something that should fail the test, e.g. 0xdd, and the test would still pass even though it should fail. --- modules/imgcodecs/test/test_tiff.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/imgcodecs/test/test_tiff.cpp b/modules/imgcodecs/test/test_tiff.cpp index 0c9d7ae908..76a2cd4cd4 100644 --- a/modules/imgcodecs/test/test_tiff.cpp +++ b/modules/imgcodecs/test/test_tiff.cpp @@ -76,7 +76,7 @@ TEST(Imgcodecs_Tiff, write_read_16bit_big_little_endian) // Write sample TIFF file FILE* fp = fopen(filename.c_str(), "wb"); ASSERT_TRUE(fp != NULL); - ASSERT_EQ((size_t)1, fwrite(tiff_sample_data, 86, 1, fp)); + ASSERT_EQ((size_t)1, fwrite(tiff_sample_data[i], 86, 1, fp)); fclose(fp); Mat img = imread(filename, IMREAD_UNCHANGED);