Skip to content

Commit f6041c0

Browse files
Revert "Update unit tests to use new accessibility information."
This reverts commit b1c1d48.
1 parent 78e27d4 commit f6041c0

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

jbmc/unit/java_bytecode/java_bytecode_parser/parse_java_attributes.cpp

+8-17
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,15 @@ SCENARIO(
8181
"InnerClassesDefault", "./java_bytecode/java_bytecode_parser");
8282
WHEN("Parsing the InnerClasses attribute for a public inner class")
8383
{
84-
THEN(
85-
"The inner class should be marked as package-private (default) because "
86-
"its "
87-
"containing class has stricter access ")
84+
THEN("The class should be marked as public")
8885
{
8986
const symbolt &class_symbol = new_symbol_table.lookup_ref(
9087
"java::InnerClassesDefault$PublicInnerClass");
9188
const java_class_typet java_class =
9289
to_java_class_type(class_symbol.type);
9390
REQUIRE_FALSE(java_class.get_is_anonymous_class());
9491
REQUIRE(java_class.get_is_inner_class());
95-
REQUIRE(java_class.get_access() == ID_default);
92+
REQUIRE(java_class.get_access() == ID_public);
9693
}
9794
}
9895
WHEN(
@@ -112,17 +109,15 @@ SCENARIO(
112109
}
113110
WHEN("Parsing the InnerClasses attribute for a protected inner class")
114111
{
115-
THEN(
116-
"The inner class should be marked as package-private (default) because "
117-
"its containing class has stricter access ")
112+
THEN("The class should be marked as protected")
118113
{
119114
const symbolt &class_symbol = new_symbol_table.lookup_ref(
120115
"java::InnerClassesDefault$ProtectedInnerClass");
121116
const java_class_typet java_class =
122117
to_java_class_type(class_symbol.type);
123118
REQUIRE_FALSE(java_class.get_is_anonymous_class());
124119
REQUIRE(java_class.get_is_inner_class());
125-
REQUIRE(java_class.get_access() == ID_default);
120+
REQUIRE(java_class.get_access() == ID_protected);
126121
}
127122
}
128123
WHEN("Parsing the InnerClasses attribute for a private inner class")
@@ -150,9 +145,7 @@ SCENARIO(
150145
"Parsing the InnerClasses attribute for a public doubly-nested inner "
151146
"class")
152147
{
153-
THEN(
154-
"The inner class should be marked as package-private (default) because "
155-
"its containing class has stricter access ")
148+
THEN("The class should be marked as public")
156149
{
157150
const symbolt &class_symbol = new_symbol_table.lookup_ref(
158151
"java::InnerClassesDeeplyNested$SinglyNestedClass$"
@@ -161,7 +154,7 @@ SCENARIO(
161154
to_java_class_type(class_symbol.type);
162155
REQUIRE_FALSE(java_class.get_is_anonymous_class());
163156
REQUIRE(java_class.get_is_inner_class());
164-
REQUIRE(java_class.get_access() == ID_default);
157+
REQUIRE(java_class.get_access() == ID_public);
165158
}
166159
}
167160
WHEN(
@@ -184,9 +177,7 @@ SCENARIO(
184177
"Parsing the InnerClasses attribute for a package private (default) "
185178
"doubly-nested inner class ")
186179
{
187-
THEN(
188-
"The inner class should be marked as package-private (default) because "
189-
"its containing class has stricter access ")
180+
THEN("The inner class should be marked as protected")
190181
{
191182
const symbolt &class_symbol = new_symbol_table.lookup_ref(
192183
"java::InnerClassesDeeplyNested$SinglyNestedClass$"
@@ -195,7 +186,7 @@ SCENARIO(
195186
to_java_class_type(class_symbol.type);
196187
REQUIRE_FALSE(java_class.get_is_anonymous_class());
197188
REQUIRE(java_class.get_is_inner_class());
198-
REQUIRE(java_class.get_access() == ID_default);
189+
REQUIRE(java_class.get_access() == ID_protected);
199190
}
200191
}
201192
WHEN(

0 commit comments

Comments
 (0)