diff options
author | epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-05-07 15:51:54 +0000 |
---|---|---|
committer | epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-05-07 15:51:54 +0000 |
commit | 366a770159611031f4cda6d471043b7045f84072 (patch) | |
tree | e15ea44edcf2587ab927ff203d91d797fe6eb6d7 /gm | |
parent | b5e34e22aa0e019e25f9f913f0e119a9a97e5562 (diff) |
GM: now that we use MD5 instead of CityHash, the JSON should say so
(this should have been part of https://code.google.com/p/skia/source/detail?r=8992 )
R=bungeman@google.com
Review URL: https://codereview.chromium.org/14758003
git-svn-id: http://skia.googlecode.com/svn/trunk@9038 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
14 files changed, 73 insertions, 65 deletions
diff --git a/gm/gm_expectations.cpp b/gm/gm_expectations.cpp index 1aa1ef4804..16e655ed43 100644 --- a/gm/gm_expectations.cpp +++ b/gm/gm_expectations.cpp @@ -16,20 +16,28 @@ const static char kJsonKey_ActualResults_Failed[] = "failed"; const static char kJsonKey_ActualResults_FailureIgnored[]= "failure-ignored"; const static char kJsonKey_ActualResults_NoComparison[] = "no-comparison"; const static char kJsonKey_ActualResults_Succeeded[] = "succeeded"; -const static char kJsonKey_ActualResults_AnyStatus_BitmapCityhash[] = "bitmap-cityhash"; +#ifdef BITMAPHASHER_USES_TRUNCATED_MD5 +const static char kJsonKey_ActualResults_AnyStatus_BitmapHash[] = "bitmap-64bitMD5"; +#else +const static char kJsonKey_ActualResults_AnyStatus_BitmapHash[] = "bitmap-cityhash"; +#endif const static char kJsonKey_ExpectedResults[] = "expected-results"; -const static char kJsonKey_ExpectedResults_AllowedBitmapCityhashes[] = "allowed-bitmap-cityhashes"; +#ifdef BITMAPHASHER_USES_TRUNCATED_MD5 +const static char kJsonKey_ExpectedResults_AllowedBitmapHashes[] = "allowed-bitmap-64bitMD5s"; +#else +const static char kJsonKey_ExpectedResults_AllowedBitmapHashes[] = "allowed-bitmap-cityhashes"; +#endif const static char kJsonKey_ExpectedResults_IgnoreFailure[] = "ignore-failure"; namespace skiagm { // TODO(epoger): This currently assumes that the result SkHashDigest was - // generated as a CityHash of an SkBitmap. We'll need to allow for other - // hash types to cover non-bitmaps, MD5 instead of CityHash, etc. + // generated as an SkHashDigest of an SkBitmap. We'll need to allow for other + // hash types to cover non-bitmaps. Json::Value ActualResultAsJsonValue(const SkHashDigest& result) { Json::Value jsonValue; - jsonValue[kJsonKey_ActualResults_AnyStatus_BitmapCityhash] = asJsonValue(result); + jsonValue[kJsonKey_ActualResults_AnyStatus_BitmapHash] = asJsonValue(result); return jsonValue; } @@ -65,7 +73,7 @@ namespace skiagm { if (!SkBitmapHasher::ComputeDigest(bitmap, &digest)) { digest = 0; } - fAllowedBitmapCityhashes.push_back() = digest; + fAllowedBitmapChecksums.push_back() = digest; } Expectations::Expectations(Json::Value jsonElement) { @@ -87,13 +95,13 @@ namespace skiagm { } Json::Value allowedChecksums = - jsonElement[kJsonKey_ExpectedResults_AllowedBitmapCityhashes]; + jsonElement[kJsonKey_ExpectedResults_AllowedBitmapHashes]; if (allowedChecksums.isNull()) { // ok, we'll just assume there aren't any expected checksums to compare against } else if (!allowedChecksums.isArray()) { gm_fprintf(stderr, "found non-array json value" " for key '%s' in element '%s'\n", - kJsonKey_ExpectedResults_AllowedBitmapCityhashes, + kJsonKey_ExpectedResults_AllowedBitmapHashes, jsonElement.toStyledString().c_str()); DEBUGFAIL_SEE_STDERR; } else { @@ -105,7 +113,7 @@ namespace skiagm { jsonElement.toStyledString().c_str()); DEBUGFAIL_SEE_STDERR; } else { - fAllowedBitmapCityhashes.push_back() = asChecksum(checksumElement); + fAllowedBitmapChecksums.push_back() = asChecksum(checksumElement); } } } @@ -113,8 +121,8 @@ namespace skiagm { } bool Expectations::match(Checksum actualChecksum) const { - for (int i=0; i < this->fAllowedBitmapCityhashes.count(); i++) { - Checksum allowedChecksum = this->fAllowedBitmapCityhashes[i]; + for (int i=0; i < this->fAllowedBitmapChecksums.count(); i++) { + Checksum allowedChecksum = this->fAllowedBitmapChecksums[i]; if (allowedChecksum == actualChecksum) { return true; } @@ -124,15 +132,15 @@ namespace skiagm { Json::Value Expectations::asJsonValue() const { Json::Value allowedChecksumArray; - if (!this->fAllowedBitmapCityhashes.empty()) { - for (int i=0; i < this->fAllowedBitmapCityhashes.count(); i++) { - Checksum allowedChecksum = this->fAllowedBitmapCityhashes[i]; + if (!this->fAllowedBitmapChecksums.empty()) { + for (int i=0; i < this->fAllowedBitmapChecksums.count(); i++) { + Checksum allowedChecksum = this->fAllowedBitmapChecksums[i]; allowedChecksumArray.append(Json::UInt64(allowedChecksum)); } } Json::Value jsonValue; - jsonValue[kJsonKey_ExpectedResults_AllowedBitmapCityhashes] = allowedChecksumArray; + jsonValue[kJsonKey_ExpectedResults_AllowedBitmapHashes] = allowedChecksumArray; jsonValue[kJsonKey_ExpectedResults_IgnoreFailure] = this->ignoreFailure(); return jsonValue; } diff --git a/gm/gm_expectations.h b/gm/gm_expectations.h index df99c6ebbf..2506a98127 100644 --- a/gm/gm_expectations.h +++ b/gm/gm_expectations.h @@ -101,7 +101,7 @@ namespace skiagm { /** * Returns true iff there are no allowed checksums. */ - bool empty() const { return this->fAllowedBitmapCityhashes.empty(); } + bool empty() const { return this->fAllowedBitmapChecksums.empty(); } /** * Returns true iff actualChecksum matches any allowedChecksum, @@ -128,7 +128,7 @@ namespace skiagm { private: const static bool kDefaultIgnoreFailure = false; - SkTArray<Checksum> fAllowedBitmapCityhashes; + SkTArray<Checksum> fAllowedBitmapChecksums; bool fIgnoreFailure; SkBitmap fBitmap; }; diff --git a/gm/tests/outputs/compared-against-different-pixels-images/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-different-pixels-images/output-expected/json-summary.txt index b8d43a37e3..1bc40b73bb 100644 --- a/gm/tests/outputs/compared-against-different-pixels-images/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-different-pixels-images/output-expected/json-summary.txt @@ -2,10 +2,10 @@ "actual-results" : { "failed" : { "565/selftest1" : { - "bitmap-cityhash" : 12927999507540085554 + "bitmap-64bitMD5" : 12927999507540085554 }, "8888/selftest1" : { - "bitmap-cityhash" : 1209453360120438698 + "bitmap-64bitMD5" : 1209453360120438698 } }, "failure-ignored" : null, @@ -14,11 +14,11 @@ }, "expected-results" : { "565/selftest1" : { - "allowed-bitmap-cityhashes" : [ 8863920166200910451 ], + "allowed-bitmap-64bitMD5s" : [ 8863920166200910451 ], "ignore-failure" : false }, "8888/selftest1" : { - "allowed-bitmap-cityhashes" : [ 13451349865803053525 ], + "allowed-bitmap-64bitMD5s" : [ 13451349865803053525 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt index b8d43a37e3..1bc40b73bb 100644 --- a/gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt @@ -2,10 +2,10 @@ "actual-results" : { "failed" : { "565/selftest1" : { - "bitmap-cityhash" : 12927999507540085554 + "bitmap-64bitMD5" : 12927999507540085554 }, "8888/selftest1" : { - "bitmap-cityhash" : 1209453360120438698 + "bitmap-64bitMD5" : 1209453360120438698 } }, "failure-ignored" : null, @@ -14,11 +14,11 @@ }, "expected-results" : { "565/selftest1" : { - "allowed-bitmap-cityhashes" : [ 8863920166200910451 ], + "allowed-bitmap-64bitMD5s" : [ 8863920166200910451 ], "ignore-failure" : false }, "8888/selftest1" : { - "allowed-bitmap-cityhashes" : [ 13451349865803053525 ], + "allowed-bitmap-64bitMD5s" : [ 13451349865803053525 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/compared-against-empty-dir/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-empty-dir/output-expected/json-summary.txt index e55c38c5fa..c5edc8aff9 100644 --- a/gm/tests/outputs/compared-against-empty-dir/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-empty-dir/output-expected/json-summary.txt @@ -4,21 +4,21 @@ "failure-ignored" : null, "no-comparison" : { "565/selftest1" : { - "bitmap-cityhash" : 12927999507540085554 + "bitmap-64bitMD5" : 12927999507540085554 }, "8888/selftest1" : { - "bitmap-cityhash" : 1209453360120438698 + "bitmap-64bitMD5" : 1209453360120438698 } }, "succeeded" : null }, "expected-results" : { "565/selftest1" : { - "allowed-bitmap-cityhashes" : null, + "allowed-bitmap-64bitMD5s" : null, "ignore-failure" : false }, "8888/selftest1" : { - "allowed-bitmap-cityhashes" : null, + "allowed-bitmap-64bitMD5s" : null, "ignore-failure" : false } } diff --git a/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/json-summary.txt index e050124767..52256f435b 100644 --- a/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/json-summary.txt @@ -5,20 +5,20 @@ "no-comparison" : null, "succeeded" : { "565/selftest1" : { - "bitmap-cityhash" : 12927999507540085554 + "bitmap-64bitMD5" : 12927999507540085554 }, "8888/selftest1" : { - "bitmap-cityhash" : 1209453360120438698 + "bitmap-64bitMD5" : 1209453360120438698 } } }, "expected-results" : { "565/selftest1" : { - "allowed-bitmap-cityhashes" : [ 12927999507540085554 ], + "allowed-bitmap-64bitMD5s" : [ 12927999507540085554 ], "ignore-failure" : false }, "8888/selftest1" : { - "allowed-bitmap-cityhashes" : [ 1209453360120438698 ], + "allowed-bitmap-64bitMD5s" : [ 1209453360120438698 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt index e050124767..52256f435b 100644 --- a/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt @@ -5,20 +5,20 @@ "no-comparison" : null, "succeeded" : { "565/selftest1" : { - "bitmap-cityhash" : 12927999507540085554 + "bitmap-64bitMD5" : 12927999507540085554 }, "8888/selftest1" : { - "bitmap-cityhash" : 1209453360120438698 + "bitmap-64bitMD5" : 1209453360120438698 } } }, "expected-results" : { "565/selftest1" : { - "allowed-bitmap-cityhashes" : [ 12927999507540085554 ], + "allowed-bitmap-64bitMD5s" : [ 12927999507540085554 ], "ignore-failure" : false }, "8888/selftest1" : { - "allowed-bitmap-cityhashes" : [ 1209453360120438698 ], + "allowed-bitmap-64bitMD5s" : [ 1209453360120438698 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/json-summary.txt index e050124767..52256f435b 100644 --- a/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/json-summary.txt @@ -5,20 +5,20 @@ "no-comparison" : null, "succeeded" : { "565/selftest1" : { - "bitmap-cityhash" : 12927999507540085554 + "bitmap-64bitMD5" : 12927999507540085554 }, "8888/selftest1" : { - "bitmap-cityhash" : 1209453360120438698 + "bitmap-64bitMD5" : 1209453360120438698 } } }, "expected-results" : { "565/selftest1" : { - "allowed-bitmap-cityhashes" : [ 12927999507540085554 ], + "allowed-bitmap-64bitMD5s" : [ 12927999507540085554 ], "ignore-failure" : false }, "8888/selftest1" : { - "allowed-bitmap-cityhashes" : [ 1209453360120438698 ], + "allowed-bitmap-64bitMD5s" : [ 1209453360120438698 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt index e050124767..52256f435b 100644 --- a/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt @@ -5,20 +5,20 @@ "no-comparison" : null, "succeeded" : { "565/selftest1" : { - "bitmap-cityhash" : 12927999507540085554 + "bitmap-64bitMD5" : 12927999507540085554 }, "8888/selftest1" : { - "bitmap-cityhash" : 1209453360120438698 + "bitmap-64bitMD5" : 1209453360120438698 } } }, "expected-results" : { "565/selftest1" : { - "allowed-bitmap-cityhashes" : [ 12927999507540085554 ], + "allowed-bitmap-64bitMD5s" : [ 12927999507540085554 ], "ignore-failure" : false }, "8888/selftest1" : { - "allowed-bitmap-cityhashes" : [ 1209453360120438698 ], + "allowed-bitmap-64bitMD5s" : [ 1209453360120438698 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/ignore-expectations-mismatch/output-expected/json-summary.txt b/gm/tests/outputs/ignore-expectations-mismatch/output-expected/json-summary.txt index b8d43a37e3..1bc40b73bb 100644 --- a/gm/tests/outputs/ignore-expectations-mismatch/output-expected/json-summary.txt +++ b/gm/tests/outputs/ignore-expectations-mismatch/output-expected/json-summary.txt @@ -2,10 +2,10 @@ "actual-results" : { "failed" : { "565/selftest1" : { - "bitmap-cityhash" : 12927999507540085554 + "bitmap-64bitMD5" : 12927999507540085554 }, "8888/selftest1" : { - "bitmap-cityhash" : 1209453360120438698 + "bitmap-64bitMD5" : 1209453360120438698 } }, "failure-ignored" : null, @@ -14,11 +14,11 @@ }, "expected-results" : { "565/selftest1" : { - "allowed-bitmap-cityhashes" : [ 8863920166200910451 ], + "allowed-bitmap-64bitMD5s" : [ 8863920166200910451 ], "ignore-failure" : false }, "8888/selftest1" : { - "allowed-bitmap-cityhashes" : [ 13451349865803053525 ], + "allowed-bitmap-64bitMD5s" : [ 13451349865803053525 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/intentionally-skipped-tests/output-expected/json-summary.txt b/gm/tests/outputs/intentionally-skipped-tests/output-expected/json-summary.txt index 3d3e1e4d0f..8865b0ce38 100644 --- a/gm/tests/outputs/intentionally-skipped-tests/output-expected/json-summary.txt +++ b/gm/tests/outputs/intentionally-skipped-tests/output-expected/json-summary.txt @@ -4,16 +4,16 @@ "failure-ignored" : null, "no-comparison" : { "565/selftest1" : { - "bitmap-cityhash" : 12927999507540085554 + "bitmap-64bitMD5" : 12927999507540085554 }, "565/selftest2" : { - "bitmap-cityhash" : 8863920166200910451 + "bitmap-64bitMD5" : 8863920166200910451 }, "8888/selftest1" : { - "bitmap-cityhash" : 1209453360120438698 + "bitmap-64bitMD5" : 1209453360120438698 }, "8888/selftest2" : { - "bitmap-cityhash" : 13451349865803053525 + "bitmap-64bitMD5" : 13451349865803053525 } }, "succeeded" : null diff --git a/gm/tests/outputs/no-readpath/output-expected/json-summary.txt b/gm/tests/outputs/no-readpath/output-expected/json-summary.txt index 5140616bf0..1009e926a5 100644 --- a/gm/tests/outputs/no-readpath/output-expected/json-summary.txt +++ b/gm/tests/outputs/no-readpath/output-expected/json-summary.txt @@ -4,10 +4,10 @@ "failure-ignored" : null, "no-comparison" : { "565/selftest1" : { - "bitmap-cityhash" : 12927999507540085554 + "bitmap-64bitMD5" : 12927999507540085554 }, "8888/selftest1" : { - "bitmap-cityhash" : 1209453360120438698 + "bitmap-64bitMD5" : 1209453360120438698 } }, "succeeded" : null diff --git a/gm/tests/outputs/nonverbose/output-expected/json-summary.txt b/gm/tests/outputs/nonverbose/output-expected/json-summary.txt index e55c38c5fa..c5edc8aff9 100644 --- a/gm/tests/outputs/nonverbose/output-expected/json-summary.txt +++ b/gm/tests/outputs/nonverbose/output-expected/json-summary.txt @@ -4,21 +4,21 @@ "failure-ignored" : null, "no-comparison" : { "565/selftest1" : { - "bitmap-cityhash" : 12927999507540085554 + "bitmap-64bitMD5" : 12927999507540085554 }, "8888/selftest1" : { - "bitmap-cityhash" : 1209453360120438698 + "bitmap-64bitMD5" : 1209453360120438698 } }, "succeeded" : null }, "expected-results" : { "565/selftest1" : { - "allowed-bitmap-cityhashes" : null, + "allowed-bitmap-64bitMD5s" : null, "ignore-failure" : false }, "8888/selftest1" : { - "allowed-bitmap-cityhashes" : null, + "allowed-bitmap-64bitMD5s" : null, "ignore-failure" : false } } diff --git a/gm/tests/outputs/pipe-playback-failure/output-expected/json-summary.txt b/gm/tests/outputs/pipe-playback-failure/output-expected/json-summary.txt index 506191d981..5c12f9e983 100644 --- a/gm/tests/outputs/pipe-playback-failure/output-expected/json-summary.txt +++ b/gm/tests/outputs/pipe-playback-failure/output-expected/json-summary.txt @@ -2,31 +2,31 @@ "actual-results" : { "failed" : { "comparison/selftest1-pipe" : { - "bitmap-cityhash" : 6140979239232854774 + "bitmap-64bitMD5" : 6140979239232854774 } }, "failure-ignored" : null, "no-comparison" : null, "succeeded" : { "565/selftest1" : { - "bitmap-cityhash" : 12927999507540085554 + "bitmap-64bitMD5" : 12927999507540085554 }, "8888/selftest1" : { - "bitmap-cityhash" : 1209453360120438698 + "bitmap-64bitMD5" : 1209453360120438698 } } }, "expected-results" : { "565/selftest1" : { - "allowed-bitmap-cityhashes" : [ 12927999507540085554 ], + "allowed-bitmap-64bitMD5s" : [ 12927999507540085554 ], "ignore-failure" : false }, "8888/selftest1" : { - "allowed-bitmap-cityhashes" : [ 1209453360120438698 ], + "allowed-bitmap-64bitMD5s" : [ 1209453360120438698 ], "ignore-failure" : false }, "comparison/selftest1-pipe" : { - "allowed-bitmap-cityhashes" : [ 1209453360120438698 ], + "allowed-bitmap-64bitMD5s" : [ 1209453360120438698 ], "ignore-failure" : false } } |