diff options
Diffstat (limited to 'tests/unistd_test.cpp')
-rw-r--r-- | tests/unistd_test.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unistd_test.cpp b/tests/unistd_test.cpp index f54a461..79c16d7 100644 --- a/tests/unistd_test.cpp +++ b/tests/unistd_test.cpp @@ -176,6 +176,13 @@ TEST(unistd, ftruncate64) { ASSERT_EQ(123, sb.st_size); } +TEST(unistd, ftruncate_negative) { + TemporaryFile tf; + errno = 0; + ASSERT_EQ(-1, ftruncate(tf.fd, -123)); + ASSERT_EQ(EINVAL, errno); +} + static bool g_pause_test_flag = false; static void PauseTestSignalHandler(int) { g_pause_test_flag = true; |