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

Function TEST_F

core/tests/gtest_db_thread.cpp:40–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40TEST_F(KVDBTest, AbstractKVDB_Thread_Test) {
41 if (my_argc != 3) {
42 std::cerr << "illegal input! should be db_thread ${num_of_thread} "
43 "${num_of_ops_each_thread}"
44 << std::endl;
45 return;
46 }
47 int num_of_thread = atoi(my_argv[1]);
48 int nums_of_ops_each_thread = atoi(my_argv[2]);
49 std::vector<AbsKVDBPtr> kvdbptrs;
50 for (int i = 0; i < num_of_thread; i++) {
51 kvdbptrs.push_back(std::make_shared<RocksKVDB>());
52 kvdbptrs[i]->CreateDB();
53 }
54 std::vector<std::thread> tarr;
55 for (int i = 0; i < num_of_thread; i++) {
56 tarr.push_back(
57 std::thread(db_thread_test, kvdbptrs[i], nums_of_ops_each_thread));
58 }
59 for (int i = 0; i < num_of_thread; i++) {
60 tarr[i].join();
61 }
62 return;
63}
64
65int main(int argc, char** argv) {
66 my_argc = argc;

Callers

nothing calls this directly

Calls 3

push_backMethod · 0.80
CreateDBMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected