Skip to content

Unit tests for invokedynamic with static lambdas [TG-2811] #1946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
770eb2a
Remove methods without a implementation or usage
Mar 15, 2018
39282a6
Add debug information for working directory
Mar 19, 2018
6df8d6b
Extended require_goto_statements to provide meaningful errors
Mar 19, 2018
46fa176
Extending require utilities to be used in test
Mar 19, 2018
2348d10
Adding unit test for checking local lambda conversion
Mar 19, 2018
ee2179c
Introduce checks the the function body for Execute calls the correct …
Mar 19, 2018
bea730d
Adding utility for verifying a set of statements contains a function …
Mar 19, 2018
7b0cee1
Refactored test method to allow reuse
Mar 19, 2018
5610aca
Added unit test for lambda assigned
Mar 19, 2018
99c21ed
Extended find pointer assignment to take a regex
Mar 20, 2018
d171f64
Swap finding variable values to use regex
Mar 20, 2018
d2ed92b
Adding test for lambda taking array parameters
Mar 20, 2018
db6756e
Adding checks for parameters of the called function
Mar 20, 2018
f3ddee6
Adding tests to verify the return of the lambda wrapper method
Mar 20, 2018
3e0e12e
Adding tests for the other two returning lambdas that don't capture
Mar 20, 2018
8999cf6
Added utiltity for getting this member components
Mar 21, 2018
fa27117
Introduce tests for lambdas that are member variables
Mar 21, 2018
7f843a7
Add natural language explanation of the test's checks
Mar 21, 2018
5f5994b
Pull out the logic for getting the inital assignment
Mar 21, 2018
f9adaa6
Adding tests for member methods
Mar 22, 2018
4201db9
Adding tests for static lambdas
Mar 22, 2018
ac33761
Use raw strings to avoid unnecessary escaping
Mar 23, 2018
d7356be
Modified behaviour to find function calls
Mar 23, 2018
e27151b
Correcting typo in the scenario name
Mar 26, 2018
28bfc37
Amending path to reflect new location
Mar 26, 2018
44a5dcb
Adding check for inheritance
Mar 26, 2018
df895d3
Temp checkin for checking components
Mar 26, 2018
54f1c54
Adding checks for the super class of the generated class
Mar 27, 2018
397c14e
Correcting typos and adding documentation to unit tests
Mar 27, 2018
31fa0fe
Addressing review comments
Mar 27, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/java_bytecode/java_bytecode_convert_method_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,6 @@ class java_bytecode_convert_methodt:public messaget

const bytecode_infot &get_bytecode_info(const irep_idt &statement);

bool class_needs_clinit(const irep_idt &classname);
exprt get_or_create_clinit_wrapper(const irep_idt &classname);
codet get_clinit_call(const irep_idt &classname);

bool is_method_inherited(
Expand Down
1 change: 1 addition & 0 deletions unit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ SRC += unit_tests.cpp \
goto-programs/class_hierarchy_graph.cpp \
goto-programs/remove_virtual_functions_without_fallback.cpp \
java_bytecode/java_bytecode_convert_class/convert_abstract_class.cpp \
java_bytecode/java_bytecode_convert_method/convert_invoke_dynamic.cpp \
java_bytecode/java_bytecode_parse_generics/parse_generic_class.cpp \
java_bytecode/java_object_factory/gen_nondet_string_init.cpp \
java_bytecode/java_bytecode_parse_lambdas/java_bytecode_parse_lambda_method_table.cpp \
Expand Down
15 changes: 10 additions & 5 deletions unit/java_bytecode/ci_lazy_methods/lazy_load_lambdas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ SCENARIO(
{
const symbol_tablet symbol_table = load_java_class_lazy(
"LocalLambdas",
"./java_bytecode/java_bytecode_parse_lambdas/lambda_examples/",
"./java_bytecode/java_bytecode_parse_lambdas/lambda_examples/"
"openjdk_8_classes",
"LocalLambdas.test");

THEN("Then the lambdas should be loaded")
Expand Down Expand Up @@ -68,7 +69,8 @@ SCENARIO(
{
const symbol_tablet symbol_table = load_java_class_lazy(
"MemberLambdas",
"./java_bytecode/java_bytecode_parse_lambdas/lambda_examples/",
"./java_bytecode/java_bytecode_parse_lambdas/lambda_examples/"
"openjdk_8_classes",
"MemberLambdas.test");

THEN("Then the lambdas should be loaded")
Expand Down Expand Up @@ -117,7 +119,8 @@ SCENARIO(
{
const symbol_tablet symbol_table = load_java_class_lazy(
"StaticLambdas",
"./java_bytecode/java_bytecode_parse_lambdas/lambda_examples/",
"./java_bytecode/java_bytecode_parse_lambdas/lambda_examples/"
"openjdk_8_classes",
"StaticLambdas.test");

THEN("Then the lambdas should be loaded")
Expand Down Expand Up @@ -166,7 +169,8 @@ SCENARIO(
{
const symbol_tablet symbol_table = load_java_class_lazy(
"OuterMemberLambdas$Inner",
"./java_bytecode/java_bytecode_parse_lambdas/lambda_examples/",
"./java_bytecode/java_bytecode_parse_lambdas/lambda_examples/"
"openjdk_8_classes",
"OuterMemberLambdas$Inner.test");

THEN("Then the lambdas should be loaded")
Expand All @@ -192,7 +196,8 @@ SCENARIO(
{
const symbol_tablet symbol_table = load_java_class_lazy(
"ExternalLambdaAccessor",
"./java_bytecode/java_bytecode_parse_lambdas/lambda_examples/",
"./java_bytecode/java_bytecode_parse_lambdas/lambda_examples/"
"openjdk_8_classes",
"ExternalLambdaAccessor.test");

THEN("Then the lambdas should be loaded")
Expand Down
Loading