diff --git a/infer/tests/build_systems/differential_of_costs_report_objc/costs_summary.json.exp b/infer/tests/build_systems/differential_of_costs_report_objc/costs_summary.json.exp index e486f3c0e..6aa1a7abe 100644 --- a/infer/tests/build_systems/differential_of_costs_report_objc/costs_summary.json.exp +++ b/infer/tests/build_systems/differential_of_costs_report_objc/costs_summary.json.exp @@ -1 +1 @@ -{"top":{"current":0,"previous":0},"unreachable":{"current":0,"previous":0},"zero":{"current":0,"previous":0},"degrees":[{"degree":0,"current":20,"previous":15},{"degree":100,"current":4,"previous":1}]} \ No newline at end of file +{"top":{"current":0,"previous":0},"unreachable":{"current":0,"previous":0},"zero":{"current":0,"previous":0},"degrees":[{"degree":0,"current":20,"previous":15},{"degree":100,"current":5,"previous":1},{"degree":200,"current":1,"previous":0}]} \ No newline at end of file diff --git a/infer/tests/build_systems/differential_of_costs_report_objc/introduced.exp b/infer/tests/build_systems/differential_of_costs_report_objc/introduced.exp index e69de29bb..d71ef366e 100644 --- a/infer/tests/build_systems/differential_of_costs_report_objc/introduced.exp +++ b/infer/tests/build_systems/differential_of_costs_report_objc/introduced.exp @@ -0,0 +1,2 @@ +EXECUTION_TIME_COMPLEXITY_INCREASE, no_bucket, src/DiffBlock.m, Handler.func_linear:, 0, [Previous Cost of func_linear: is 4 + 5 ⋅ (array->elements.length + 1) (degree is 1),{array->elements.length + 1},Loop,Updated Cost of func_linear: is 4 + 3 ⋅ array->elements.length × (array->elements.length + 1) + 8 ⋅ (array->elements.length + 1) + 3 ⋅ (array->elements.length + 1) × (array->elements.length + 1) (degree is 2),{array->elements.length + 1},Loop,{array->elements.length},Call to Handler.loop_linear:,Loop] +EXECUTION_TIME_COMPLEXITY_INCREASE, no_bucket, src/DiffBlock.m, objc_blockHandler.func_linear_1, 0, [Previous Cost of objc_blockHandler.func_linear_1 is 21 (degree is 0),Updated Cost of objc_blockHandler.func_linear_1 is 23 + 3 ⋅ str.length + 3 ⋅ (str.length + 1) (degree is 1),{str.length},Loop] diff --git a/infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.current.m b/infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.current.m index 925182a2c..ccd3962bd 100644 --- a/infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.current.m +++ b/infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.current.m @@ -37,11 +37,20 @@ - (void (^)(NSString*))func_linear { return ^(NSString* str) { NSLog(@"Report error : %@ \n", str); + for (int i = 0; i < str.length; i++) { + } // we get a complexity increase here for the block, but we should print it + // better }; } ++ (void)loop_linear:(NSArray*)array { + for (int i = 0; i < array.count; i++) { + } +} + - (void)func_linear:(NSArray*)array { for (id value in array) { + [Handler loop_linear:array]; } }