24 const std::string &lambda_method_ref,
25 const std::string &method_type)
27 typedef java_bytecode_parse_treet::classt::lambda_method_handle_mapt::
28 value_type lambda_method_entryt;
31 "Looking for entry with lambda_method_ref: " << lambda_method_ref
32 <<
" and method_type: " 34 std::vector<lambda_method_entryt> matches;
38 back_inserter(matches),
40 &lambda_method_ref](
const lambda_method_entryt &entry) {
42 entry.second.method_type == method_type &&
43 entry.second.lambda_method_ref == lambda_method_ref);
45 REQUIRE(matches.size() == 1);
46 return matches.at(0).second;
57 const auto method = std::find_if(
61 return method.name == method_name;
64 INFO(
"Looking for method: " << method_name);
65 std::ostringstream found_methods;
66 for(
const auto entry : parsed_class.
methods)
68 found_methods <<
id2string(entry.name) << std::endl;
70 INFO(
"Found methods:\n" << found_methods.str());
72 REQUIRE(method != parsed_class.
methods.end());
84 REQUIRE(instructions.size() == expected_instructions.size());
85 auto actual_instruction_it = instructions.begin();
86 for(
const auto expected_instruction : expected_instructions)
88 expected_instruction.require_instructions_equal(*actual_instruction_it);
89 ++actual_instruction_it;
100 auto actual_arg_it = actual_instruction.
args.begin();
101 for(
const exprt &expected_arg : actual_instruction.
args)
103 INFO(
"Expected argument" << expected_arg.
pretty());
104 INFO(
"Actual argument" << actual_arg_it->pretty());
105 REQUIRE(*actual_arg_it == expected_arg);
irep_idt instruction_mnemoic
const std::string & id2string(const irep_idt &d)
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
void require_instructions_equal(java_bytecode_parse_treet::instructiont actual_instruction) const
Check whether a given instruction matches an expectation of the instruction.
const methodt require_method(const java_bytecode_parse_treet::classt &parsed_class, const irep_idt &method_name)
Finds a specific method in the parsed class with a matching name.
void require_instructions_match_expectation(const expected_instructionst &expected_instructions, const java_bytecode_parse_treet::methodt::instructionst instructions)
Verify whether a given methods instructions match an expectation.
std::vector< exprt > instruction_arguments
lambda_method_handle_mapt lambda_method_handle_map
lambda_method_handlet require_lambda_entry_for_descriptor(const java_bytecode_parse_treet::classt &parsed_class, const std::string &lambda_method_ref, const std::string &method_type)
Find in the parsed class a specific entry within the lambda_method_handle_map with a matching descrip...
std::vector< instructiont > instructionst
std::vector< expected_instructiont > expected_instructionst
Base class for all expressions.
Utilties for inspecting java_parse_treet.