| 41 | } |
| 42 | |
| 43 | TEST_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 | |
| 62 | int main(int argc, char** argv) { |
| 63 | my_argc = argc; |
nothing calls this directly
no test coverage detected