From ee2179c4f09eaf0c7708c05a27d68dd646ed7e57 Mon Sep 17 00:00:00 2001 From: thk123 Date: Mon, 19 Mar 2018 15:12:48 +0000 Subject: [PATCH] Introduce checks the the function body for Execute calls the correct lambda --- .../convert_invoke_dynamic.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/unit/java_bytecode/java_bytecode_convert_method/convert_invoke_dynamic.cpp b/unit/java_bytecode/java_bytecode_convert_method/convert_invoke_dynamic.cpp index 4cda50514f9..f6d40c954f5 100644 --- a/unit/java_bytecode/java_bytecode_convert_method/convert_invoke_dynamic.cpp +++ b/unit/java_bytecode/java_bytecode_convert_method/convert_invoke_dynamic.cpp @@ -86,6 +86,23 @@ SCENARIO( lambda_implementor_type_symbol.type); REQUIRE(tmp_lambda_class_type.has_base("java::SimpleLambda")); + + THEN("The function in the class should call the lambda method") + { + const irep_idt method_identifier = + id2string(tmp_class_identifier) + ".Execute:()V"; + const symbolt &method_symbol = + require_symbol::require_symbol_exists( + symbol_table, method_identifier); + + REQUIRE(method_symbol.is_function()); + + const std::vector &assignments = + require_goto_statements::get_all_statements(method_symbol.value); + + require_goto_statements::require_function_call( + assignments, "java::LocalLambdas.lambda$test$0:()V"); + } } } }