Skip to content

Commit

Permalink
CR Feedback (Test Harness)
Browse files Browse the repository at this point in the history
  • Loading branch information
DHowett committed Dec 14, 2016
1 parent bdc4c1f commit d25a309
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/unittests/CoreGraphics.drawing/ImageComparison.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ struct Pixel {
bool operator==(const Pixel& o) const {
return r == o.r && g == o.g && g == o.g && a == o.a;
}
bool operator!=(const Pixel& o) const {
return !(*this == o);
}
};

struct ImagePixelAccess {
Expand Down Expand Up @@ -55,8 +58,8 @@ struct ImagePixelAccess {
}

public:
size_t width;
size_t height;
const size_t width;
const size_t height;

ImagePixelAccess(CGImageRef image)
: _image(CGImageRetain(image)),
Expand Down Expand Up @@ -141,8 +144,8 @@ struct RGBAImageBuffer {
RGBAImageBuffer(const RGBAImageBuffer& other) = delete;

public:
size_t width;
size_t height;
const size_t width;
const size_t height;

RGBAImageBuffer(size_t width, size_t height) : _pixels(width * height, { 0, 0, 0, 0 }), width(width), height(height) {
}
Expand Down Expand Up @@ -191,7 +194,7 @@ ImageDelta PixelByPixelImageComparator::CompareImages(CGImageRef left, CGImageRe
auto bp = leftAccess.at(x, y);
auto cp = rightAccess.at(x, y);
auto& gp = deltaBuffer.at(x, y);
if (!(bp == cp)) {
if (bp != cp) {
++npxchg;
if (cp == background) {
// Pixel is in EXPECTED but not ACTUAL
Expand Down

0 comments on commit d25a309

Please sign in to comment.