31 #include <sys/types.h> 32 #include <sys/socket.h> 33 #include <netinet/in.h> 38 #include <gtest/gtest.h> 50 ASSERT_TRUE(c.
execute(
"Hello", noArgs, result));
54 EXPECT_EQ(result, hello);
66 for (
int i = 0; i < 30; i++)
78 EXPECT_EQ(result, hello);
87 hello.hello_mutex.lock();
93 for (
int i = 0; i < 100; i++)
103 hello.hello_mutex.unlock();
109 EXPECT_EQ(result, hello);
118 hello.hello_mutex.lock();
127 hello.hello_mutex.unlock();
139 server_thread.join();
149 for (
int i = 0; i < 100; i++)
161 EXPECT_EQ(-1, c.
getfd());
173 server_thread.join();
175 shutdown(
s.
getfd(), SHUT_RD);
179 ASSERT_FALSE(c.
execute(
"Hello", noArgs, result));
182 EXPECT_EQ(result, hello);
185 int main(
int argc,
char **argv)
187 ::testing::InitGoogleTest(&argc, argv);
188 return RUN_ALL_TESTS();
TEST_F(XmlRpcTest, Hello)
RPC method arguments and results are represented by Values.
void shutdown()
Close all connections with clients and the socket file descriptor.
bool isFault() const
Returns true if the result of the last execute() was a fault response.
int getfd() const
Return the file descriptor being monitored.
void setVerbosity(int level)
Sets log message verbosity. This is short for XmlRpcLogHandler::setVerbosity(level) ...
A class to send XML RPC requests to a server and return the results.
int main(int argc, char **argv)
bool execute(const char *method, XmlRpcValue const ¶ms, XmlRpcValue &result)
bool executeNonBlock(const char *method, XmlRpcValue const ¶ms)
bool executeCheckDone(XmlRpcValue &result)