MCPcopy Create free account
hub / github.com/cinemast/libjson-rpc-cpp / WaitProcess

Method WaitProcess

src/test/testredisserver.cpp:64–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64bool TestRedisServer::WaitProcess(int pipefd[2]) {
65 close(pipefd[1]);
66 FILE *output = fdopen(pipefd[0], "r");
67
68 unsigned int i = 0;
69 do {
70 i++;
71 char *buffer = NULL;
72 size_t n;
73 getline(&buffer, &n, output);
74 if (n <= 0) {
75 free(buffer);
76 continue;
77 }
78 string line(buffer);
79 free(buffer);
80
81 size_t found = line.find(key);
82 if (found != string::npos) {
83 return true;
84 }
85
86 } while (i < maxlines);
87
88 return false;
89}
90
91void TestRedisServer::StartProcess(int pipefd[2]) {
92 // Close the unused read end

Callers 1

StartMethod · 0.95

Calls 1

findMethod · 0.80

Tested by

no test coverage detected