MCPcopy Create free account
hub / github.com/bbc/audiowaveform / compareImages

Function compareImages

test/OptionHandlerTest.cpp:118–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116//------------------------------------------------------------------------------
117
118static void compareImages(
119 gdImagePtr test_image,
120 gdImagePtr ref_image)
121{
122 const int test_width = gdImageSX(test_image);
123 const int ref_width = gdImageSX(ref_image);
124
125 const int test_height = gdImageSY(test_image);
126 const int ref_height = gdImageSY(ref_image);
127
128 ASSERT_THAT(test_width, Eq(ref_width));
129 ASSERT_THAT(test_height, Eq(ref_height));
130
131 for (int y = 0; y < ref_height; ++y) {
132 for (int x = 0; x < ref_width; ++x) {
133 const int test_pixel = gdImageGetPixel(test_image, x, y);
134 const int ref_pixel = gdImageGetPixel(ref_image, x, y);
135
136 ASSERT_THAT(test_pixel, Eq(ref_pixel));
137 }
138 }
139}
140
141//------------------------------------------------------------------------------
142

Callers 1

compareImageFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected