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

Unified Diff: tools/skimage_main.cpp

Issue 15094011: skimage: report failure if expectation not found. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Respond to comments. Created 7 years, 7 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: tools/skimage_main.cpp
diff --git a/tools/skimage_main.cpp b/tools/skimage_main.cpp
index 2041f7bbcc5a4991fc81791519b65f4de86ea068..e434ff072d6c98d60b3bc7ada6ea61d4cec979af 100644
--- a/tools/skimage_main.cpp
+++ b/tools/skimage_main.cpp
@@ -202,9 +202,13 @@ static const char* SkBasename(const char* fullPath) {
* Compare against an expectation for this filename, if there is one.
* @param bitmap SkBitmap to compare to the expected value.
* @param filename String used to find the expected value.
- * @return bool True if the bitmap matched the expectation, or if there was no expectation. False
- * if there was an expecation that the bitmap did not match, or if an expectation could not be
- * computed from an expectation.
+ * @return bool True in any of these cases:
+ * - the bitmap matches the expectation.
+ * - there is no expectations file.
+ * False in any of these cases:
+ * - there is an expectations file, but no expectation for this bitmap.
+ * - there is an expectation for this bitmap, but it did not match.
+ * - expectation could not be computed from the bitmap.
*/
static bool compare_to_expectations_if_necessary(const SkBitmap& bitmap, const char* filename,
SkTArray<SkString, false>* failureArray) {
@@ -214,7 +218,11 @@ static bool compare_to_expectations_if_necessary(const SkBitmap& bitmap, const c
skiagm::Expectations jsExpectation = gJsonExpectations->get(filename);
if (jsExpectation.empty()) {
- return true;
+ if (failureArray != NULL) {
+ failureArray->push_back().printf("decoded %s, but could not find expectation.",
+ filename);
+ }
+ return false;
}
SkHashDigest checksum;
« 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