[cost] Add Java tests for ZERO_EXECUTION_TIME

Reviewed By: skcho

Differential Revision: D20117064

fbshipit-source-id: 15c5eae64
master
Ezgi Çiçek 5 years ago committed by Facebook Github Bot
parent 0397b8248d
commit 43350f7c6b

@ -4,7 +4,19 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import com.google.common.base.Preconditions;
class Zero {
void zero_cost() {};
// cost: 1
void unit_cost() {};
public void infeasible_path_zero() {
Preconditions.checkState(false); // pruned to bottom
}
// we can't handle doubles properly in Inferbo
public void double_prune_FN(double fpp) {
Preconditions.checkArgument(fpp > 0.0 && fpp < 0.0);
}
}

@ -219,3 +219,5 @@ codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.read_max_
codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.read_sum_cost(java.io.InputStream,byte[],int,int,java.util.ArrayList):int, 3, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 15 + 6 ⋅ 2⋅byteCount, O(2⋅byteCount), degree = 1,{2⋅byteCount},Loop at line 33]
codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.throw_exception():int, 0, UNREACHABLE_CODE, no_bucket, ERROR, [Here]
codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.unmodeled_impure_linear(java.util.ArrayList):void, 0, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 2 + 13 ⋅ list.length + 3 ⋅ (list.length + 1), O(list.length), degree = 1,{list.length + 1},Loop at line 61,{list.length},Loop at line 61]
codetoanalyze/java/performance/Zero.java, Zero.infeasible_path_zero():void, 0, UNREACHABLE_CODE, no_bucket, ERROR, [Here]
codetoanalyze/java/performance/Zero.java, Zero.infeasible_path_zero():void, 0, ZERO_EXECUTION_TIME, no_bucket, ERROR, []

Loading…
Cancel
Save