diff options
author | Elliott Hughes <enh@google.com> | 2014-09-30 16:15:42 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-09-30 16:40:41 -0700 |
commit | 31e072fc9bcf6517d763c7af6d872efd1784629e (patch) | |
tree | 579255b857eac677bec2b2e74e1ecf827b04059b /tests/stdlib_test.cpp | |
parent | 1f7d5ac53854a09bbcace08b3a1d1b9cf3f2eed3 (diff) |
Update our FreeBSD realpath(3) to upstream head.
Change-Id: I8c89728184ecd2c1a28a05cefa84a5037d28b552
Diffstat (limited to 'tests/stdlib_test.cpp')
-rw-r--r-- | tests/stdlib_test.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/stdlib_test.cpp b/tests/stdlib_test.cpp index e814ef714..9ad96fd81 100644 --- a/tests/stdlib_test.cpp +++ b/tests/stdlib_test.cpp @@ -99,6 +99,18 @@ TEST(stdlib, realpath__ENOENT) { ASSERT_EQ(ENOENT, errno); } +TEST(stdlib, realpath__component_after_non_directory) { + errno = 0; + char* p = realpath("/dev/null/.", NULL); + ASSERT_TRUE(p == NULL); + ASSERT_EQ(ENOTDIR, errno); + + errno = 0; + p = realpath("/dev/null/..", NULL); + ASSERT_TRUE(p == NULL); + ASSERT_EQ(ENOTDIR, errno); +} + TEST(stdlib, realpath) { // Get the name of this executable. char executable_path[PATH_MAX]; |