Skip to content

Commit bd907a4

Browse files
author
thk123
committed
Diversified the test for multiple fields
Though this wasn't the problem, makes the tests more robust as more than one type used in specialising the same generic type.
1 parent 6f98511 commit bd907a4

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed
Binary file not shown.

jbmc/unit/java_bytecode/goto_program_generics/GenericFields.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ public void foo() {
1111

1212
class MultipleGenericFields {
1313
Wrapper<IWrapper> field_input1;
14-
Wrapper<IWrapper> field_input2;
14+
Wrapper<BWrapper> field_input2;
1515
public void foo() {
1616
field_input1.field.i = 10;
17-
field_input2.field.i = 20;
17+
field_input2.field.b = true;
1818
}
1919
}
2020

jbmc/unit/java_bytecode/goto_program_generics/GenericHelper.java

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ public IWrapper(int ii) {
66
}
77
}
88

9+
// boolean wrapper
10+
class BWrapper {
11+
public boolean b;
12+
public BWrapper(boolean bb) {
13+
b = bb;
14+
}
15+
}
16+
917
// simple generic class
1018
class Wrapper<T> {
1119
public T field;

jbmc/unit/java_bytecode/goto_program_generics/generic_parameters_test.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,13 @@ SCENARIO(
136136
{},
137137
entry_point_code);
138138

139-
THEN("Object 'field_input1' has field 'field' of type IWrapper")
139+
THEN("Object 'field_input2' has field 'field' of type BWrapper")
140140
{
141141
require_goto_statements::require_struct_component_assignment(
142142
field_input2_name,
143143
{},
144144
"field",
145-
"java::IWrapper",
145+
"java::BWrapper",
146146
{},
147147
entry_point_code);
148148
}

0 commit comments

Comments
 (0)