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();