26 #include <sys/resource.h> 36 ASSERT_TRUE(c.
execute(
"Hello", noArgs, result));
40 EXPECT_EQ(result, hello);
50 struct rlimit limit = {.rlim_cur = 0, .rlim_max = 0};
51 ASSERT_EQ(0, getrlimit(RLIMIT_NOFILE, &limit));
52 ASSERT_LT(64u, limit.rlim_max);
53 ASSERT_LT(64u, limit.rlim_cur);
61 ASSERT_EQ(0, setrlimit(RLIMIT_NOFILE, &limit));
64 EXPECT_FALSE(c2.
execute(
"Hello", noArgs, result));
67 limit.rlim_cur = limit.rlim_max;
68 ASSERT_EQ(0, setrlimit(RLIMIT_NOFILE, &limit));
70 EXPECT_TRUE(c2.
execute(
"Hello", noArgs, result));
71 EXPECT_EQ(result, hello);
74 int main(
int argc,
char **argv)
76 ::testing::InitGoogleTest(&argc, argv);
77 return RUN_ALL_TESTS();
RPC method arguments and results are represented by Values.
int main(int argc, char **argv)
bool isFault() const
Returns true if the result of the last execute() was a fault response.
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)