Commit ca62c0ae authored by Francis Dupont's avatar Francis Dupont

[429-Updated-StampedValue-to-support-reals] Added the 7.0 unit test

parent f72bb0f7
......@@ -133,6 +133,22 @@ TEST(StampedValueTest, createFromDouble) {
EXPECT_THROW(value->getBoolValue(), TypeError);
// Tests that stamped value from real can handle a round value.
TEST(StampedValueTest, createFromDoubleRound) {
StampedValuePtr value;
ASSERT_NO_THROW(value = StampedValue::create("bar", Element::create(static_cast<double>(7.0))));
EXPECT_EQ(Element::real, value->getType());
EXPECT_EQ("bar", value->getName());
EXPECT_EQ("7.0", value->getValue());
double double_value = 0;
ASSERT_NO_THROW(double_value = value->getDoubleValue());
EXPECT_EQ(7.0, double_value);
EXPECT_THROW(value->getIntegerValue(), TypeError);
EXPECT_THROW(value->getBoolValue(), TypeError);
// Tests that stamped value can be converted from string to real.
TEST(StampedValueTest, convertStringToDouble) {
StampedValuePtr value;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment