summaryrefslogtreecommitdiff
path: root/test/api
diff options
context:
space:
mode:
authorGereon Kremer <nafur42@gmail.com>2021-08-27 11:23:15 -0700
committerGitHub <noreply@github.com>2021-08-27 18:23:15 +0000
commit3183ca6685f6b0dcca538efb72e6840a56479b60 (patch)
treee6c51d6175d4a56c7849aa4f965ed49b743f0607 /test/api
parenta698b522d619c800a3401c7294cf1c6c663d7acc (diff)
Handle languages as strings in driver (#7074)
This PR moves the first chunk of code in the driver to use the proper options API for the language options. It is now handled as a string.
Diffstat (limited to 'test/api')
-rw-r--r--test/api/ouroborous.cpp8
-rw-r--r--test/api/smt2_compliance.cpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/test/api/ouroborous.cpp b/test/api/ouroborous.cpp
index 92e58085d..06b6e320b 100644
--- a/test/api/ouroborous.cpp
+++ b/test/api/ouroborous.cpp
@@ -96,14 +96,16 @@ std::string parse(std::string instr,
}
api::Solver solver;
- Language ilang = input_language == "smt2" ? Language::LANG_SMTLIB_V2_6
- : Language::LANG_CVC;
+ std::string ilang =
+ input_language == "smt2" ? "LANG_SMTLIB_V2_6" : "LANG_CVC";
solver.setOption("input-language", input_language);
solver.setOption("output-language", output_language);
SymbolManager symman(&solver);
std::unique_ptr<Parser> parser(
- ParserBuilder(&solver, &symman).withInputLanguage(ilang).build());
+ ParserBuilder(&solver, &symman, false)
+ .withInputLanguage(solver.getOption("input-language"))
+ .build());
parser->setInput(
Input::newStringInput(ilang, declarations, "internal-buffer"));
// we don't need to execute the commands, but we DO need to parse them to
diff --git a/test/api/smt2_compliance.cpp b/test/api/smt2_compliance.cpp
index 921d7585f..888f722a7 100644
--- a/test/api/smt2_compliance.cpp
+++ b/test/api/smt2_compliance.cpp
@@ -59,11 +59,9 @@ void testGetInfo(api::Solver* solver, const char* s)
{
std::unique_ptr<SymbolManager> symman(new SymbolManager(solver));
- std::unique_ptr<Parser> p(
- ParserBuilder(solver, symman.get(), solver->getOptions()).build());
- p->setInput(Input::newStringInput(Language::LANG_SMTLIB_V2_6,
- string("(get-info ") + s + ")",
- "<internal>"));
+ std::unique_ptr<Parser> p(ParserBuilder(solver, symman.get(), true).build());
+ p->setInput(Input::newStringInput(
+ "LANG_SMTLIB_V2_6", string("(get-info ") + s + ")", "<internal>"));
assert(p != NULL);
Command* c = p->nextCommand();
assert(c != NULL);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback