Skip to content

Commit 69d67ab

Browse files
Thomas Kileythk123
Thomas Kiley
authored and
thk123
committed
Modified unit test to compile
Updated the includes to point to new unit test utilties location Updated usages of symbol_table to respect new interface
1 parent 5d6ebfd commit 69d67ab

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

unit/java_bytecode/java_bytecode_parse_generics/parse_generic_class.cpp

+8-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
77
\*******************************************************************/
88

9-
#include <catch.hpp>
9+
#include <testing-utils/catch.hpp>
10+
#include <testing-utils/load_java_class.h>
1011

1112
#include <istream>
1213
#include <memory>
@@ -15,7 +16,6 @@
1516
#include <util/language.h>
1617
#include <util/message.h>
1718
#include <java_bytecode/java_bytecode_language.h>
18-
#include <src/java_bytecode/load_java_class.h>
1919

2020
SCENARIO(
2121
"java_bytecode_parse_generics",
@@ -32,7 +32,7 @@ SCENARIO(
3232
THEN("The symbol type should be generic")
3333
{
3434
const symbolt &class_symbol=
35-
new_symbol_table.lookup("java::generics$element").value().get();
35+
new_symbol_table.lookup_ref("java::generics$element");
3636
const typet &symbol_type=class_symbol.type;
3737

3838
REQUIRE(symbol_type.id()==ID_struct);
@@ -76,7 +76,7 @@ SCENARIO(
7676
THEN("The symbol type should be generic")
7777
{
7878
const symbolt &class_symbol=
79-
new_symbol_table.lookup("java::generics$bound_element").value().get();
79+
new_symbol_table.lookup_ref("java::generics$bound_element");
8080
const typet &symbol_type=class_symbol.type;
8181

8282
REQUIRE(symbol_type.id()==ID_struct);
@@ -127,8 +127,8 @@ SCENARIO(
127127

128128
THEN("The generic fields should be annotated with concrete types")
129129
{
130-
const symbolt &class_symbol=new_symbol_table.lookup("java::generics")
131-
.value().get();
130+
const symbolt &class_symbol=
131+
new_symbol_table.lookup_ref("java::generics");
132132
const typet &symbol_type=class_symbol.type;
133133

134134
REQUIRE(symbol_type.id()==ID_struct);
@@ -236,8 +236,7 @@ SCENARIO(
236236
THEN("The symbol should have a generic parameter")
237237
{
238238
const symbolt &class_symbol=
239-
new_symbol_table.lookup("java::generics$double_bound_element")
240-
.value().get();
239+
new_symbol_table.lookup_ref("java::generics$double_bound_element");
241240
const typet &symbol_type=class_symbol.type;
242241

243242
REQUIRE(symbol_type.id()==ID_struct);
@@ -276,7 +275,7 @@ SCENARIO(
276275
THEN("Both generic parameters should be encoded")
277276
{
278277
const symbolt &class_symbol=
279-
new_symbol_table.lookup("java::generics$two_elements").value().get();
278+
new_symbol_table.lookup_ref("java::generics$two_elements");
280279
const typet &symbol_type=class_symbol.type;
281280

282281
REQUIRE(symbol_type.id()==ID_struct);

0 commit comments

Comments
 (0)