Add a basic unit test for system(3).
Change-Id: Ibc5ac21f3663685d89ce261b58d6ea386fc1ff88
This commit is contained in:
parent
dd8c7863c6
commit
3cdf5739cd
@ -172,3 +172,15 @@ TEST(stdlib, mkstemp64) {
|
|||||||
ASSERT_EQ(0, fstat64(tf.fd, &sb));
|
ASSERT_EQ(0, fstat64(tf.fd, &sb));
|
||||||
ASSERT_EQ(O_LARGEFILE, fcntl(tf.fd, F_GETFL) & O_LARGEFILE);
|
ASSERT_EQ(O_LARGEFILE, fcntl(tf.fd, F_GETFL) & O_LARGEFILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(stdlib, system) {
|
||||||
|
int status;
|
||||||
|
|
||||||
|
status = system("exit 0");
|
||||||
|
ASSERT_TRUE(WIFEXITED(status));
|
||||||
|
ASSERT_EQ(0, WEXITSTATUS(status));
|
||||||
|
|
||||||
|
status = system("exit 1");
|
||||||
|
ASSERT_TRUE(WIFEXITED(status));
|
||||||
|
ASSERT_EQ(1, WEXITSTATUS(status));
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user