Skip to content

Commit 2c175bd

Browse files
NlightNFotisthk123
authored and
thk123
committed
Update load_java_class to construct the entry point function
Take a language as a parameter to allow customisation on which language is used
1 parent 73808aa commit 2c175bd

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

unit/testing-utils/load_java_class.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
symbol_tablet load_java_class(
2727
const std::string &java_class_name,
2828
const std::string &class_path)
29+
{
30+
return load_java_class(
31+
java_class_name, class_path, new_java_bytecode_language());
32+
}
33+
34+
symbol_tablet load_java_class(
35+
const std::string &java_class_name,
36+
const std::string &class_path,
37+
std::unique_ptr<languaget> java_lang)
2938
{
3039
// We don't expect the .class suffix to allow us to check the name of the
3140
// class
@@ -39,8 +48,6 @@ symbol_tablet load_java_class(
3948

4049
symbol_tablet new_symbol_table;
4150

42-
std::unique_ptr<languaget>java_lang(new_java_bytecode_language());
43-
4451
std::istringstream java_code_stream("ignored");
4552
null_message_handlert message_handler;
4653

unit/testing-utils/load_java_class.h

+7
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,16 @@
1414
#define CPROVER_TESTING_UTILS_LOAD_JAVA_CLASS_H
1515

1616
#include <util/symbol_table.h>
17+
#include <util/language.h>
18+
#include <goto-programs/goto_model.h>
1719

1820
symbol_tablet load_java_class(
1921
const std::string &java_class_name,
2022
const std::string &class_path);
2123

24+
symbol_tablet load_java_class(
25+
const std::string &java_class_name,
26+
const std::string &class_path,
27+
std::unique_ptr<languaget> java_lang);
28+
2229
#endif // CPROVER_TESTING_UTILS_LOAD_JAVA_CLASS_H

0 commit comments

Comments
 (0)