From f26573c0efbd1ea9ea462a16b60ecbc66702f17f Mon Sep 17 00:00:00 2001 From: Sungkeun Cho Date: Fri, 14 May 2021 07:39:13 -0700 Subject: [PATCH] [Cost] Comment out non-deterministic test Summary: This diff comments out a test that introduces non-deterministic analysis result. Reviewed By: rgrig Differential Revision: D28440794 fbshipit-source-id: 95e6fbe06 --- .../tests/codetoanalyze/java/performance/IteratorTest.java | 7 +++++++ infer/tests/codetoanalyze/java/performance/cost-issues.exp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/infer/tests/codetoanalyze/java/performance/IteratorTest.java b/infer/tests/codetoanalyze/java/performance/IteratorTest.java index e628f1a41..590f59797 100644 --- a/infer/tests/codetoanalyze/java/performance/IteratorTest.java +++ b/infer/tests/codetoanalyze/java/performance/IteratorTest.java @@ -31,9 +31,16 @@ public class IteratorTest { BLUE; // The cost of class initializer should be constant. + /* NOTE: Comment out the test because of non-deterministic analysis results. There are mutual + dependencies between `` and `Color.values`. + + - `` calls `Color.values` below. + - `Color.values` reads the global constant `$VALUE` and it is defined inside ``. */ + /* static { for (Color c : Color.values()) {} } + */ } public void enum_iter() { diff --git a/infer/tests/codetoanalyze/java/performance/cost-issues.exp b/infer/tests/codetoanalyze/java/performance/cost-issues.exp index ae912d27a..c8eb84841 100644 --- a/infer/tests/codetoanalyze/java/performance/cost-issues.exp +++ b/infer/tests/codetoanalyze/java/performance/cost-issues.exp @@ -224,7 +224,7 @@ codetoanalyze/java/performance/Invariant.java, Invariant.formal_not_invariant_FP codetoanalyze/java/performance/Invariant.java, Invariant.list_size_invariant(java.util.List):void, 4 + 5 ⋅ items.length + 3 ⋅ (items.length + 1), OnUIThread:false, [{items.length + 1},Loop,{items.length},Loop] codetoanalyze/java/performance/Invariant.java, Invariant.local_not_invariant_FP(int):void, 6 + 12 ⋅ (size + 5) + 7 ⋅ (size + 5) × (5+min(1, size)) + 4 ⋅ (5+min(0, size)), OnUIThread:false, [{5+min(0, size)},Loop,{5+min(1, size)},Loop,{size + 5},Loop] codetoanalyze/java/performance/Invariant.java, Invariant.x_is_invariant_ok(int):void, 11 + 6 ⋅ (size + 20), OnUIThread:false, [{size + 20},Loop] -codetoanalyze/java/performance/IteratorTest.java, IteratorTest$Color.():void, 73, OnUIThread:false, [] +codetoanalyze/java/performance/IteratorTest.java, IteratorTest$Color.():void, 37, OnUIThread:false, [] codetoanalyze/java/performance/IteratorTest.java, IteratorTest$Color.(java.lang.String,int), 4, OnUIThread:false, [] codetoanalyze/java/performance/IteratorTest.java, IteratorTest$Color.valueOf(java.lang.String):IteratorTest$Color, 6, OnUIThread:false, [] codetoanalyze/java/performance/IteratorTest.java, IteratorTest$Color.values():IteratorTest$Color[], 6, OnUIThread:false, []