TEST_F(TestApiBlackSolver, getOptionInfo)
{
{
- EXPECT_THROW(d_solver.getOptionInfo("asdf-invalid"), CVC5ApiException);
+ ASSERT_THROW(d_solver.getOptionInfo("asdf-invalid"), CVC5ApiException);
}
{
cvc5::OptionInfo info = d_solver.getOptionInfo("verbose");
- EXPECT_EQ("verbose", info.name);
- EXPECT_EQ(std::vector<std::string>{}, info.aliases);
- EXPECT_TRUE(std::holds_alternative<OptionInfo::VoidInfo>(info.valueInfo));
+ ASSERT_EQ("verbose", info.name);
+ ASSERT_EQ(std::vector<std::string>{}, info.aliases);
+ ASSERT_TRUE(std::holds_alternative<OptionInfo::VoidInfo>(info.valueInfo));
std::stringstream ss;
ss << info;
ASSERT_EQ(ss.str(), "OptionInfo{ verbose | void }");
{
// bool type with default
cvc5::OptionInfo info = d_solver.getOptionInfo("print-success");
- EXPECT_EQ("print-success", info.name);
- EXPECT_EQ(std::vector<std::string>{}, info.aliases);
- EXPECT_TRUE(
+ ASSERT_EQ("print-success", info.name);
+ ASSERT_EQ(std::vector<std::string>{}, info.aliases);
+ ASSERT_TRUE(
std::holds_alternative<OptionInfo::ValueInfo<bool>>(info.valueInfo));
auto valInfo = std::get<OptionInfo::ValueInfo<bool>>(info.valueInfo);
- EXPECT_EQ(false, valInfo.defaultValue);
- EXPECT_EQ(false, valInfo.currentValue);
+ ASSERT_EQ(false, valInfo.defaultValue);
+ ASSERT_EQ(false, valInfo.currentValue);
ASSERT_EQ(info.boolValue(), false);
std::stringstream ss;
ss << info;
{
// int64 type with default
cvc5::OptionInfo info = d_solver.getOptionInfo("verbosity");
- EXPECT_EQ("verbosity", info.name);
- EXPECT_EQ(std::vector<std::string>{}, info.aliases);
- EXPECT_TRUE(std::holds_alternative<OptionInfo::NumberInfo<int64_t>>(
+ ASSERT_EQ("verbosity", info.name);
+ ASSERT_EQ(std::vector<std::string>{}, info.aliases);
+ ASSERT_TRUE(std::holds_alternative<OptionInfo::NumberInfo<int64_t>>(
info.valueInfo));
auto numInfo = std::get<OptionInfo::NumberInfo<int64_t>>(info.valueInfo);
- EXPECT_EQ(0, numInfo.defaultValue);
- EXPECT_EQ(0, numInfo.currentValue);
- EXPECT_FALSE(numInfo.minimum || numInfo.maximum);
+ ASSERT_EQ(0, numInfo.defaultValue);
+ ASSERT_EQ(0, numInfo.currentValue);
+ ASSERT_FALSE(numInfo.minimum || numInfo.maximum);
ASSERT_EQ(info.intValue(), 0);
std::stringstream ss;
ss << info;
{
// uint64 type with default
cvc5::OptionInfo info = d_solver.getOptionInfo("rlimit");
- EXPECT_EQ("rlimit", info.name);
- EXPECT_EQ(std::vector<std::string>{}, info.aliases);
- EXPECT_TRUE(std::holds_alternative<OptionInfo::NumberInfo<uint64_t>>(
+ ASSERT_EQ("rlimit", info.name);
+ ASSERT_EQ(std::vector<std::string>{}, info.aliases);
+ ASSERT_TRUE(std::holds_alternative<OptionInfo::NumberInfo<uint64_t>>(
info.valueInfo));
auto numInfo = std::get<OptionInfo::NumberInfo<uint64_t>>(info.valueInfo);
- EXPECT_EQ(0, numInfo.defaultValue);
- EXPECT_EQ(0, numInfo.currentValue);
- EXPECT_FALSE(numInfo.minimum || numInfo.maximum);
+ ASSERT_EQ(0, numInfo.defaultValue);
+ ASSERT_EQ(0, numInfo.currentValue);
+ ASSERT_FALSE(numInfo.minimum || numInfo.maximum);
ASSERT_EQ(info.uintValue(), 0);
std::stringstream ss;
ss << info;
{
// string type with default
cvc5::OptionInfo info = d_solver.getOptionInfo("force-logic");
- EXPECT_EQ("force-logic", info.name);
- EXPECT_EQ(std::vector<std::string>{}, info.aliases);
- EXPECT_TRUE(std::holds_alternative<OptionInfo::ValueInfo<std::string>>(
+ ASSERT_EQ("force-logic", info.name);
+ ASSERT_EQ(std::vector<std::string>{}, info.aliases);
+ ASSERT_TRUE(std::holds_alternative<OptionInfo::ValueInfo<std::string>>(
info.valueInfo));
auto valInfo = std::get<OptionInfo::ValueInfo<std::string>>(info.valueInfo);
- EXPECT_EQ("", valInfo.defaultValue);
- EXPECT_EQ("", valInfo.currentValue);
+ ASSERT_EQ("", valInfo.defaultValue);
+ ASSERT_EQ("", valInfo.currentValue);
ASSERT_EQ(info.stringValue(), "");
std::stringstream ss;
ss << info;
{
// mode option
cvc5::OptionInfo info = d_solver.getOptionInfo("simplification");
- EXPECT_EQ("simplification", info.name);
- EXPECT_EQ(std::vector<std::string>{"simplification-mode"}, info.aliases);
- EXPECT_TRUE(std::holds_alternative<OptionInfo::ModeInfo>(info.valueInfo));
+ ASSERT_EQ("simplification", info.name);
+ ASSERT_EQ(std::vector<std::string>{"simplification-mode"}, info.aliases);
+ ASSERT_TRUE(std::holds_alternative<OptionInfo::ModeInfo>(info.valueInfo));
auto modeInfo = std::get<OptionInfo::ModeInfo>(info.valueInfo);
- EXPECT_EQ("batch", modeInfo.defaultValue);
- EXPECT_EQ("batch", modeInfo.currentValue);
- EXPECT_EQ(2, modeInfo.modes.size());
- EXPECT_TRUE(std::find(modeInfo.modes.begin(), modeInfo.modes.end(), "batch")
+ ASSERT_EQ("batch", modeInfo.defaultValue);
+ ASSERT_EQ("batch", modeInfo.currentValue);
+ ASSERT_EQ(2, modeInfo.modes.size());
+ ASSERT_TRUE(std::find(modeInfo.modes.begin(), modeInfo.modes.end(), "batch")
!= modeInfo.modes.end());
- EXPECT_TRUE(std::find(modeInfo.modes.begin(), modeInfo.modes.end(), "none")
+ ASSERT_TRUE(std::find(modeInfo.modes.begin(), modeInfo.modes.end(), "none")
!= modeInfo.modes.end());
std::stringstream ss;
ss << info;
TEST_F(TestApiBlackSolver, getDriverOptions)
{
auto dopts = d_solver.getDriverOptions();
- EXPECT_EQ(dopts.err().rdbuf(), std::cerr.rdbuf());
- EXPECT_EQ(dopts.in().rdbuf(), std::cin.rdbuf());
- EXPECT_EQ(dopts.out().rdbuf(), std::cout.rdbuf());
+ ASSERT_EQ(dopts.err().rdbuf(), std::cerr.rdbuf());
+ ASSERT_EQ(dopts.in().rdbuf(), std::cin.rdbuf());
+ ASSERT_EQ(dopts.out().rdbuf(), std::cout.rdbuf());
}
TEST_F(TestApiBlackSolver, getStatistics)
{
+ ASSERT_NO_THROW(cvc5::Stat());
// do some array reasoning to make sure we have a double statistics
{
Sort s1 = d_solver.getIntegerSort();
}
{
auto s = stats.get("global::totalTime");
- EXPECT_FALSE(s.isInternal());
- EXPECT_FALSE(s.isDefault());
- EXPECT_TRUE(s.isString());
+ ASSERT_FALSE(s.isInternal());
+ ASSERT_FALSE(s.isDefault());
+ ASSERT_TRUE(s.isString());
std::string time = s.getString();
- EXPECT_TRUE(time.rfind("ms") == time.size() - 2); // ends with "ms"
- EXPECT_FALSE(s.isDouble());
+ ASSERT_TRUE(time.rfind("ms") == time.size() - 2); // ends with "ms"
+ ASSERT_FALSE(s.isDouble());
s = stats.get("resource::resourceUnitsUsed");
- EXPECT_TRUE(s.isInternal());
- EXPECT_FALSE(s.isDefault());
- EXPECT_TRUE(s.isInt());
- EXPECT_TRUE(s.getInt() >= 0);
+ ASSERT_TRUE(s.isInternal());
+ ASSERT_FALSE(s.isDefault());
+ ASSERT_TRUE(s.isInt());
+ ASSERT_TRUE(s.getInt() >= 0);
}
for (const auto& s: stats)
{
- EXPECT_FALSE(s.first.empty());
+ ASSERT_FALSE(s.first.empty());
}
for (auto it = stats.begin(true, true); it != stats.end(); ++it)
{
auto tmp1 = it, tmp2 = it;
++tmp1;
tmp2++;
- EXPECT_EQ(tmp1, tmp2);
+ ASSERT_EQ(tmp1, tmp2);
--tmp1;
tmp2--;
- EXPECT_EQ(tmp1, tmp2);
- EXPECT_EQ(tmp1, it);
- EXPECT_EQ(it, tmp2);
+ ASSERT_EQ(tmp1, tmp2);
+ ASSERT_EQ(tmp1, it);
+ ASSERT_EQ(it, tmp2);
}
const auto& s = *it;
// check some basic utility methods
- EXPECT_TRUE(!(it == stats.end()));
- EXPECT_EQ(s.first, it->first);
+ ASSERT_TRUE(!(it == stats.end()));
+ ASSERT_EQ(s.first, it->first);
if (s.first == "cvc5::CONSTANT")
{
- EXPECT_FALSE(s.second.isInternal());
- EXPECT_FALSE(s.second.isDefault());
- EXPECT_TRUE(s.second.isHistogram());
+ ASSERT_FALSE(s.second.isInternal());
+ ASSERT_FALSE(s.second.isDefault());
+ ASSERT_TRUE(s.second.isHistogram());
auto hist = s.second.getHistogram();
- EXPECT_FALSE(hist.empty());
+ ASSERT_FALSE(hist.empty());
std::stringstream ss;
ss << s.second;
- EXPECT_EQ(ss.str(), "{ integer type: 1 }");
+ ASSERT_EQ(ss.str(), "{ integer type: 1 }");
}
else if (s.first == "theory::arrays::avgIndexListLength")
{
- EXPECT_TRUE(s.second.isInternal());
- EXPECT_TRUE(s.second.isDouble());
- EXPECT_TRUE(std::isnan(s.second.getDouble()));
+ ASSERT_TRUE(s.second.isInternal());
+ ASSERT_TRUE(s.second.isDouble());
+ ASSERT_TRUE(std::isnan(s.second.getDouble()));
}
}
}