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

Unified Diff: tests/FlateTest.cpp

Issue 474433002: fix win compiler div/zero (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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/FlateTest.cpp
diff --git a/tests/FlateTest.cpp b/tests/FlateTest.cpp
index 3e8e5837e104d4cea58e2f1f40a959df1113f17d..75c6f3f9c66b70b6a5093360e573f70782f84f51 100644
--- a/tests/FlateTest.cpp
+++ b/tests/FlateTest.cpp
@@ -89,6 +89,8 @@ static void TestFlate(skiatest::Reporter* reporter, SkMemoryStream* testStream,
dataSize) == 0);
}
+ if (compressedSize < 1) { return; }
+
double compressionRatio = static_cast<double>(dataSize) / compressedSize;
// Assert that some compression took place.
REPORTER_ASSERT(reporter, compressionRatio > 1.2);
« 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