Skip to content

Commit ee2179c

Browse files
author
thk123
committed
Introduce checks the the function body for Execute calls the correct lambda
1 parent 2348d10 commit ee2179c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

unit/java_bytecode/java_bytecode_convert_method/convert_invoke_dynamic.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,23 @@ SCENARIO(
8686
lambda_implementor_type_symbol.type);
8787

8888
REQUIRE(tmp_lambda_class_type.has_base("java::SimpleLambda"));
89+
90+
THEN("The function in the class should call the lambda method")
91+
{
92+
const irep_idt method_identifier =
93+
id2string(tmp_class_identifier) + ".Execute:()V";
94+
const symbolt &method_symbol =
95+
require_symbol::require_symbol_exists(
96+
symbol_table, method_identifier);
97+
98+
REQUIRE(method_symbol.is_function());
99+
100+
const std::vector<codet> &assignments =
101+
require_goto_statements::get_all_statements(method_symbol.value);
102+
103+
require_goto_statements::require_function_call(
104+
assignments, "java::LocalLambdas.lambda$test$0:()V");
105+
}
89106
}
90107
}
91108
}

0 commit comments

Comments
 (0)