27 # include <sys/resource.h> 39 ASSERT_TRUE(c.
execute(
"Hello", noArgs, result));
43 EXPECT_EQ(result, hello);
53 struct rlimit limit = {.rlim_cur = 0, .rlim_max = 0};
54 ASSERT_EQ(0, getrlimit(RLIMIT_NOFILE, &limit));
55 ASSERT_LT(64u, limit.rlim_max);
56 ASSERT_LT(64u, limit.rlim_cur);
64 ASSERT_EQ(0, setrlimit(RLIMIT_NOFILE, &limit));
67 EXPECT_FALSE(c2.
execute(
"Hello", noArgs, result));
70 limit.rlim_cur = limit.rlim_max;
71 ASSERT_EQ(0, setrlimit(RLIMIT_NOFILE, &limit));
73 EXPECT_TRUE(c2.
execute(
"Hello", noArgs, result));
74 EXPECT_EQ(result, hello);
78 int main(
int argc,
char **argv)
80 ::testing::InitGoogleTest(&argc, argv);
81 return RUN_ALL_TESTS();
RPC method arguments and results are represented by Values.
int main(int argc, char **argv)
void clear()
Erase the current value.
virtual void close()
Close the connection.
A class to send XML RPC requests to a server and return the results.
bool execute(const char *method, XmlRpcValue const ¶ms, XmlRpcValue &result)
TEST_F(XmlRpcTest, Ulimit)
bool isFault() const
Returns true if the result of the last execute() was a fault response.