Browse Source

Fixed some test.

Former-commit-id: 9750284b59
tempestpy_adaptions
dehnert 10 years ago
parent
commit
01d7bce205
  1. 2
      src/storage/expressions/ExprtkExpressionEvaluator.h
  2. 4
      test/functional/storage/ExpressionEvalutionTest.cpp

2
src/storage/expressions/ExprtkExpressionEvaluator.h

@ -18,7 +18,7 @@ namespace storm {
bool asBool(Expression const& expression) const override;
int_fast64_t asInt(Expression const& expression) const override;
void setBooleanValue(storm::expressions::Variable const& variable, bool value) override;
void setIntegerValue(storm::expressions::Variable const& variable, int_fast64_t value) override;
void setRationalValue(storm::expressions::Variable const& variable, double value) override;

4
test/functional/storage/ExpressionEvalutionTest.cpp

@ -50,13 +50,13 @@ TEST(ExpressionEvaluation, ExprTkEvaluation) {
eval.setBooleanValue(x, true);
for (int_fast64_t i = 0; i < 1000; ++i) {
eval.setIntegerValue(y, 3 + i);
EXPECT_NEAR(8.5 + i, eval.asDouble(iteExpression), 1e-6);
EXPECT_NEAR(8.5 + i, eval.asRational(iteExpression), 1e-6);
}
eval.setBooleanValue(x, false);
for (int_fast64_t i = 0; i < 1000; ++i) {
double zValue = i / static_cast<double>(10);
eval.setRationalValue(z, zValue);
EXPECT_NEAR(3 * zValue, eval.asDouble(iteExpression), 1e-6);
EXPECT_NEAR(3 * zValue, eval.asRational(iteExpression), 1e-6);
}
}
Loading…
Cancel
Save