Commit edd745c5 authored by Marcin Siodelski's avatar Marcin Siodelski

[#429,!217] Dropped "Signed" in StampedValue::getSignedInteger

parent 3179f303
......@@ -766,7 +766,7 @@ bool handleExplicitGlobal(SrvConfigPtr external_cfg, const data::StampedValuePtr
try {
const std::string& name = cb_global->getName();
if (name == "decline-probation-period") {
external_cfg->setDeclinePeriod(cb_global->getSignedIntegerValue());
external_cfg->setDeclinePeriod(cb_global->getIntegerValue());
}
else if (name == "echo-client-id") {
external_cfg->setEchoClientId(cb_global->getValue() == "true" ? true : false);
......
......@@ -508,7 +508,7 @@ TEST_F(MySqlConfigBackendDHCPv4Test, getAllGlobalParameters4) {
// Verify their values.
EXPECT_EQ("value1", (*parameters_index.find("name1"))->getValue());
EXPECT_EQ(65, (*parameters_index.find("name2"))->getSignedIntegerValue());
EXPECT_EQ(65, (*parameters_index.find("name2"))->getIntegerValue());
EXPECT_EQ("value3", (*parameters_index.find("name3"))->getValue());
EXPECT_TRUE((*parameters_index.find("name4"))->getBoolValue());
EXPECT_EQ(1.65, (*parameters_index.find("name5"))->getDoubleValue());
......
......@@ -129,7 +129,7 @@ StampedValue::getValue() const {
}
int64_t
StampedValue::getSignedIntegerValue() const {
StampedValue::getIntegerValue() const {
validateAccess(Element::integer);
return (value_->intValue());
}
......
......@@ -141,7 +141,7 @@ public:
/// @return Stored value as a signed integer.
/// @throw TypeError if the value is not of @c Element::integer
/// type.
int64_t getSignedIntegerValue() const;
int64_t getIntegerValue() const;
/// @brief Returns value as a boolean.
///
......
......@@ -25,7 +25,7 @@ TEST(StampedValueTest, createNull) {
EXPECT_THROW(value->getType(), InvalidOperation);
EXPECT_THROW(value->getValue(), InvalidOperation);
EXPECT_THROW(value->getSignedIntegerValue(), InvalidOperation);
EXPECT_THROW(value->getIntegerValue(), InvalidOperation);
EXPECT_THROW(value->getBoolValue(), InvalidOperation);
EXPECT_THROW(value->getDoubleValue(), InvalidOperation);
}
......@@ -39,7 +39,7 @@ TEST(StampedValueTest, createFromString) {
EXPECT_EQ("bar", value->getName());
EXPECT_EQ("foo", value->getValue());
EXPECT_THROW(value->getSignedIntegerValue(), TypeError);
EXPECT_THROW(value->getIntegerValue(), TypeError);
EXPECT_THROW(value->getBoolValue(), TypeError);
EXPECT_THROW(value->getDoubleValue(), TypeError);
}
......@@ -64,7 +64,7 @@ TEST(StampedValueTest, createFromInteger) {
EXPECT_EQ("bar", value->getName());
EXPECT_EQ("5", value->getValue());
int64_t signed_integer;
ASSERT_NO_THROW(signed_integer = value->getSignedIntegerValue());
ASSERT_NO_THROW(signed_integer = value->getIntegerValue());
EXPECT_EQ(5, signed_integer);
EXPECT_THROW(value->getBoolValue(), TypeError);
......@@ -78,7 +78,7 @@ TEST(StampedValueTest, convertStringToInteger) {
EXPECT_FALSE(value->amNull());
EXPECT_EQ(Element::integer, value->getType());
EXPECT_EQ("bar", value->getName());
EXPECT_EQ(123, value->getSignedIntegerValue());
EXPECT_EQ(123, value->getIntegerValue());
EXPECT_THROW(StampedValue::create("bar", "hoho", Element::integer), BadValue);
}
......@@ -95,7 +95,7 @@ TEST(StampedValueTest, createFromBool) {
ASSERT_NO_THROW(bool_value = value->getBoolValue());
EXPECT_TRUE(bool_value);
EXPECT_THROW(value->getSignedIntegerValue(), TypeError);
EXPECT_THROW(value->getIntegerValue(), TypeError);
EXPECT_THROW(value->getDoubleValue(), TypeError);
}
......@@ -129,7 +129,7 @@ TEST(StampedValueTest, createFromDouble) {
ASSERT_NO_THROW(double_value = value->getDoubleValue());
EXPECT_EQ(1.45, double_value);
EXPECT_THROW(value->getSignedIntegerValue(), TypeError);
EXPECT_THROW(value->getIntegerValue(), TypeError);
EXPECT_THROW(value->getBoolValue(), TypeError);
}
......
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