diff options
author | Pete Bentley <prb@google.com> | 2021-03-01 13:27:52 +0000 |
---|---|---|
committer | Pete Bentley <prb@google.com> | 2021-03-02 23:57:41 +0000 |
commit | d3857e49835c77c9f8000af18904d05b43b24ce1 (patch) | |
tree | 9d0ef66d108d76d38341cb002d5a46f74299983f /src/main/java/org | |
parent | adac35f1ea1f9987d9843236991ad4120e704bcb (diff) | |
download | junit-d3857e49835c77c9f8000af18904d05b43b24ce1.tar.gz |
Don't convert assumption failures into errors in ErrorCollector.addError().
It makes more sense to pass assumption failures through this path
unchanged (unlike ErrorCollector.checkSucceeds) and converting them to
errors breaks tests which use ErrorCollector in a wrapper Rule.
Upstream issue: https://github.com/junit-team/junit4/issues/1703
Bug: 129054170
Test: m checkbuild
Change-Id: I578a2676e52882c7d25d99061310ea38101883f6
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/junit/rules/ErrorCollector.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/org/junit/rules/ErrorCollector.java b/src/main/java/org/junit/rules/ErrorCollector.java index 9711e50..18d94b8 100644 --- a/src/main/java/org/junit/rules/ErrorCollector.java +++ b/src/main/java/org/junit/rules/ErrorCollector.java @@ -49,6 +49,9 @@ public class ErrorCollector extends Verifier { if (error == null) { throw new NullPointerException("Error cannot be null"); } + // BEGIN Android-changed: Don't convert assumption failures to errors. b/181123057 + // Submitted upstream: https://github.com/junit-team/junit4/issues/1703 + /* if (error instanceof AssumptionViolatedException) { AssertionError e = new AssertionError(error.getMessage()); e.initCause(error); @@ -56,6 +59,9 @@ public class ErrorCollector extends Verifier { } else { errors.add(error); } + */ + // END Android-changed: Don't convert assumption failures to errors. b/181123057 + errors.add(error); } /** |