MCPcopy Create free account
hub / github.com/PaddlePaddle/Serving / TEST_F

Function TEST_F

core/tests/gtest_db_func.cpp:43–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43TEST_F(KVDBTest, AbstractKVDB_Func_Test) {
44 AbsKVDBPtr kvdb = std::make_shared<RocksKVDB>();
45 kvdb->CreateDB();
46 std::string set_list = "setlist.txt";
47 std::string get_list = "getlist.txt";
48 std::ifstream set_file(set_list);
49 std::ifstream get_file(get_list);
50 for (std::string line; getline(set_file, line);) {
51 std::vector<std::string> strs = StringSplit(line, ' ');
52 kvdb->Set(strs[0], strs[1]);
53 }
54
55 for (std::string line; getline(get_file, line);) {
56 std::vector<std::string> strs = StringSplit(line, ' ');
57 std::string val = kvdb->Get(strs[0]);
58 ASSERT_EQ(val, strs[1]);
59 }
60}
61
62int main(int argc, char** argv) {
63 my_argc = argc;

Callers

nothing calls this directly

Calls 4

StringSplitFunction · 0.85
CreateDBMethod · 0.80
SetMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected