From d99b6ca492d5aaf9d627e58c74bba851f5ffd94a Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Fri, 11 Dec 2015 15:54:11 -0800 Subject: [PATCH] Use doesNotContain instead of containsExactly none Summary: public Remove double negation in test check as per jrm's comment on D2695548. Reviewed By: jeremydubreil Differential Revision: D2743862 fb-gh-sync-id: d7cc0d0 --- .../NoReuseUndefFunctionValuesTest.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/infer/tests/endtoend/java/eradicate/NoReuseUndefFunctionValuesTest.java b/infer/tests/endtoend/java/eradicate/NoReuseUndefFunctionValuesTest.java index 62a35ffbc..0e717e6fe 100644 --- a/infer/tests/endtoend/java/eradicate/NoReuseUndefFunctionValuesTest.java +++ b/infer/tests/endtoend/java/eradicate/NoReuseUndefFunctionValuesTest.java @@ -10,7 +10,7 @@ package endtoend.java.eradicate; import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; +import static utils.matchers.ResultContainsNoErrorInMethod.doesNotContain; import org.junit.BeforeClass; import org.junit.Test; @@ -23,10 +23,10 @@ import utils.InferResults; public class NoReuseUndefFunctionValuesTest { public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/eradicate/NoReuseUndefFunctionValues.java"; + "infer/tests/codetoanalyze/java/eradicate/NoReuseUndefFunctionValues.java"; public static final String FIELD_NOT_INITIALIZED = - "ERADICATE_FIELD_NOT_INITIALIZED"; + "ERADICATE_FIELD_NOT_INITIALIZED"; private static InferResults inferResults; @@ -37,16 +37,14 @@ public class NoReuseUndefFunctionValuesTest { } @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] noMethods = {}; + public void matchErrors() throws IOException, InterruptedException, InferException { assertThat( - "Results should contain " + FIELD_NOT_INITIALIZED, - inferResults, - containsExactly( - FIELD_NOT_INITIALIZED, - SOURCE_FILE, - noMethods)); + "Results should not contain " + FIELD_NOT_INITIALIZED, + inferResults, + doesNotContain( + FIELD_NOT_INITIALIZED, + SOURCE_FILE, + "")); } }