Skip to content

Commit 3e6cf35

Browse files
author
svorenova
committed
Extending test for signature/descriptor mismatch
1 parent 80be2fd commit 3e6cf35

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

unit/java_bytecode/java_bytecode_parse_generics/SignatureDescriptorMismatch.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
public class SignatureDescriptorMismatch<T>
22
{
3+
// this models ArrayList.Sublist.<init> for which we were getting an error
34
private class Inner
45
{
56
private final AbstractGeneric<T> u;
@@ -10,6 +11,7 @@ private class Inner
1011
}
1112
}
1213

14+
// this models another situation in which the error occurred
1315
private enum InnerEnum
1416
{
1517

unit/java_bytecode/java_bytecode_parse_generics/parse_signature_descriptor_mismatch.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ SCENARIO(
5252
const code_typet func_code=
5353
to_code_type(new_symbol_table.lookup_ref(process_func_name).type);
5454
REQUIRE(func_code.parameters().size()==3);
55+
56+
// TODO: for now, the parameters are not generic because we fall back to
57+
// descriptor due to mismatch; enable tests when fixed
58+
// code_typet::parametert param_parent=
59+
// require_type::require_parameter(func_code,"arg1a");
60+
// REQUIRE(is_java_generic_type(param_parent.type()));
61+
// code_typet::parametert param_t=
62+
// require_type::require_parameter(func_code,"t");
63+
// REQUIRE(is_java_generic_type(param_t.type()));
5564
}
5665

5766
const std::string inner_enum_prefix=class_prefix+"$InnerEnum";
@@ -78,5 +87,14 @@ SCENARIO(
7887
const code_typet func_code=
7988
to_code_type(new_symbol_table.lookup_ref(process_func_name).type);
8089
REQUIRE(func_code.parameters().size()==3);
90+
91+
// TODO: for now, the parameters are not generic because we fall back to
92+
// descriptor due to mismatch; enable tests when fixed
93+
// code_typet::parametert param_parent=
94+
// require_type::require_parameter(func_code,"arg1a");
95+
// REQUIRE(is_java_generic_type(param_parent.type()));
96+
// code_typet::parametert param_t=
97+
// require_type::require_parameter(func_code,"arg2i");
98+
// REQUIRE(is_java_generic_type(param_t.type()));
8199
}
82100
}

0 commit comments

Comments
 (0)