Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: tests/ColorSpaceTest.cpp

Issue 1769953002: Disable color space test for old versions of libpng (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ColorSpaceTest.cpp
diff --git a/tests/ColorSpaceTest.cpp b/tests/ColorSpaceTest.cpp
index cf7560228fdf8704f32d52725ac50af87f495291..555f41ec6ac5b84fd58d4ec40c12b634baaa323b 100644
--- a/tests/ColorSpaceTest.cpp
+++ b/tests/ColorSpaceTest.cpp
@@ -10,14 +10,18 @@
#include "SkColorSpace.h"
#include "Test.h"
+#include "png.h"
+
static SkStreamAsset* resource(const char path[]) {
SkString fullPath = GetResourcePath(path);
return SkStream::NewFromFile(fullPath.c_str());
}
+#if (PNG_LIBPNG_VER_MAJOR > 1) || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 6)
static bool almost_equal(float a, float b) {
return SkTAbs(a - b) < 0.0001f;
}
+#endif
DEF_TEST(ColorSpaceParseICCProfile, r) {
SkAutoTDelete<SkStream> stream(resource("color_wheel_with_profile.png"));
@@ -26,6 +30,7 @@ DEF_TEST(ColorSpaceParseICCProfile, r) {
SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(stream.detach()));
REPORTER_ASSERT(r, nullptr != codec);
+#if (PNG_LIBPNG_VER_MAJOR > 1) || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 6)
SkColorSpace* colorSpace = codec->getColorSpace();
REPORTER_ASSERT(r, nullptr != colorSpace);
@@ -48,4 +53,5 @@ DEF_TEST(ColorSpaceParseICCProfile, r) {
REPORTER_ASSERT(r, almost_equal(0.143066f, xyz.fMat[6]));
REPORTER_ASSERT(r, almost_equal(0.0606079f, xyz.fMat[7]));
REPORTER_ASSERT(r, almost_equal(0.714096f, xyz.fMat[8]));
+#endif
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698