aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/tests/skimage
diff options
context:
space:
mode:
authorGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-15 20:29:37 +0000
committerGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-15 20:29:37 +0000
commit36c5bdb097f13ede159543a57b7035dbf1f4b3cb (patch)
treeb0c9c331830d15fa8e86fac3ea27fb3318bcc3e7 /tools/tests/skimage
parent23d0ab724129a517ea1bc6cf60830169b524f3bf (diff)
Truly ignore failures in skimage.
If the expectation is set to ignore failures, do not return a negative 1 (indicating a failure) when a successful decode does not match the expectation. If the file could not be decoded at all, report this to the user depending on the input expectations file: No expectations: Report failure. The user wanted to know if the file could be decoded. Expectations expected a valid result: Report failure. The decode should have matched the result. Empty expectations: Print a message that the expectation was missing, but still return success from skimage, since this is a newly added file (i.e. it has no expectation yet). Ignore failure: Return success from skimage, since it is a known failure. Update the self tests to ensure these behaviors. R=epoger@google.com Review URL: https://codereview.chromium.org/22293006 git-svn-id: http://skia.googlecode.com/svn/trunk@11790 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools/tests/skimage')
-rw-r--r--tools/tests/skimage/input/bad-images/empty-results.json12
-rw-r--r--tools/tests/skimage/input/bad-images/ignore-results.json16
-rw-r--r--tools/tests/skimage/input/bad-images/incorrect-results.json16
-rw-r--r--tools/tests/skimage/input/bad-images/invalid.png2
-rw-r--r--tools/tests/skimage/input/images-with-known-hashes/ignore-failures.json16
-rw-r--r--tools/tests/skimage/input/images-with-known-hashes/incorrect-results.json16
6 files changed, 78 insertions, 0 deletions
diff --git a/tools/tests/skimage/input/bad-images/empty-results.json b/tools/tests/skimage/input/bad-images/empty-results.json
new file mode 100644
index 0000000000..8ae56100de
--- /dev/null
+++ b/tools/tests/skimage/input/bad-images/empty-results.json
@@ -0,0 +1,12 @@
+{
+ "actual-results" : {
+ "failed" : null,
+ "failure-ignored" : null,
+ "no-comparison" : null,
+ "succeeded" : null
+ },
+ "expected-results" : {
+ "invalid.png" : {
+ }
+ }
+}
diff --git a/tools/tests/skimage/input/bad-images/ignore-results.json b/tools/tests/skimage/input/bad-images/ignore-results.json
new file mode 100644
index 0000000000..4a0326e108
--- /dev/null
+++ b/tools/tests/skimage/input/bad-images/ignore-results.json
@@ -0,0 +1,16 @@
+{
+ "actual-results" : {
+ "failed" : null,
+ "failure-ignored" : null,
+ "no-comparison" : null,
+ "succeeded" : null
+ },
+ "expected-results" : {
+ "invalid.png" : {
+ "allowed-digests" : [
+ [ "bitmap-64bitMD5", 8011846386646810712 ]
+ ],
+ "ignore-failure" : true
+ }
+ }
+}
diff --git a/tools/tests/skimage/input/bad-images/incorrect-results.json b/tools/tests/skimage/input/bad-images/incorrect-results.json
new file mode 100644
index 0000000000..67b8bdb0c0
--- /dev/null
+++ b/tools/tests/skimage/input/bad-images/incorrect-results.json
@@ -0,0 +1,16 @@
+{
+ "actual-results" : {
+ "failed" : null,
+ "failure-ignored" : null,
+ "no-comparison" : null,
+ "succeeded" : null
+ },
+ "expected-results" : {
+ "invalid.png" : {
+ "allowed-digests" : [
+ [ "bitmap-64bitMD5", 8011846386646810712 ]
+ ],
+ "ignore-failure" : false
+ }
+ }
+}
diff --git a/tools/tests/skimage/input/bad-images/invalid.png b/tools/tests/skimage/input/bad-images/invalid.png
new file mode 100644
index 0000000000..0dd1608e45
--- /dev/null
+++ b/tools/tests/skimage/input/bad-images/invalid.png
@@ -0,0 +1,2 @@
+‰PNG
+
diff --git a/tools/tests/skimage/input/images-with-known-hashes/ignore-failures.json b/tools/tests/skimage/input/images-with-known-hashes/ignore-failures.json
new file mode 100644
index 0000000000..a99cd3e321
--- /dev/null
+++ b/tools/tests/skimage/input/images-with-known-hashes/ignore-failures.json
@@ -0,0 +1,16 @@
+{
+ "actual-results" : {
+ "failed" : null,
+ "failure-ignored" : null,
+ "no-comparison" : null,
+ "succeeded" : null
+ },
+ "expected-results" : {
+ "1209453360120438698.png" : {
+ "allowed-digests" : [
+ [ "bitmap-64bitMD5", 1111111111111111111 ]
+ ],
+ "ignore-failure" : true
+ }
+ }
+}
diff --git a/tools/tests/skimage/input/images-with-known-hashes/incorrect-results.json b/tools/tests/skimage/input/images-with-known-hashes/incorrect-results.json
new file mode 100644
index 0000000000..9cf72c3cd3
--- /dev/null
+++ b/tools/tests/skimage/input/images-with-known-hashes/incorrect-results.json
@@ -0,0 +1,16 @@
+{
+ "actual-results" : {
+ "failed" : null,
+ "failure-ignored" : null,
+ "no-comparison" : null,
+ "succeeded" : null
+ },
+ "expected-results" : {
+ "1209453360120438698.png" : {
+ "allowed-digests" : [
+ [ "bitmap-64bitMD5", 1111111111111111111 ]
+ ],
+ "ignore-failure" : false
+ }
+ }
+}