Skip to content

Commit

Permalink
Renmae get_value to fvGetValue
Browse files Browse the repository at this point in the history
Signed-off-by: Ze Gan <ganze718@gmail.com>
  • Loading branch information
Pterosaur committed Dec 23, 2020
1 parent cd10f06 commit d1ed78e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common/redisutility.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace swss
{

template <class T>
static bool get_value(
static bool fvGetValue(
const std::vector<FieldValueTuple> &fvt,
const std::string &field,
T &value)
Expand Down
10 changes: 5 additions & 5 deletions tests/redisutility_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

#include "gtest/gtest.h"

TEST(REDISUTILITY, get_value)
TEST(REDISUTILITY, fvGetValue)
{
std::vector<swss::FieldValueTuple> fvt;
fvt.push_back(std::make_pair("int", "123"));
fvt.push_back(std::make_pair("bool", "true"));
fvt.push_back(std::make_pair("string", "name"));

int i;
EXPECT_TRUE(swss::get_value(fvt, "int", i));
EXPECT_TRUE(swss::fvGetValue(fvt, "int", i));
EXPECT_EQ(i, 123);

bool b;
EXPECT_TRUE(swss::get_value(fvt, "bool", b));
EXPECT_TRUE(swss::fvGetValue(fvt, "bool", b));
EXPECT_EQ(b, true);

std::string s;
EXPECT_TRUE(swss::get_value(fvt, "string", s));
EXPECT_TRUE(swss::fvGetValue(fvt, "string", s));
EXPECT_EQ(s, "name");

double d;
EXPECT_FALSE(swss::get_value(fvt, "double", d));
EXPECT_FALSE(swss::fvGetValue(fvt, "double", d));
}

0 comments on commit d1ed78e

Please sign in to comment.