diff options
author | Scott Graham <scottmg@chromium.org> | 2014-11-12 20:32:45 (GMT) |
---|---|---|
committer | Scott Graham <scottmg@chromium.org> | 2014-11-12 20:32:45 (GMT) |
commit | fb320646918dac633bdb4e449e7d0f372d83d01d (patch) | |
tree | b94e0121ea799081509a2365ed36a2026b4ef6a4 /src/util_test.cc | |
parent | 6aa1b4b6d3d2d3efa55f91649271ed253ef5cab7 (diff) | |
download | Ninja-fb320646918dac633bdb4e449e7d0f372d83d01d.zip Ninja-fb320646918dac633bdb4e449e7d0f372d83d01d.tar.gz Ninja-fb320646918dac633bdb4e449e7d0f372d83d01d.tar.bz2 |
set *err when too many components in CanonicalizePath
Diffstat (limited to 'src/util_test.cc')
-rw-r--r-- | src/util_test.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util_test.cc b/src/util_test.cc index 5bbf397..13730af 100644 --- a/src/util_test.cc +++ b/src/util_test.cc @@ -272,15 +272,19 @@ TEST(CanonicalizePath, TooManyComponents) { EXPECT_EQ(slash_bits, 0xffff); // 33 is not. + err = ""; path = "a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/x.h"; EXPECT_FALSE(CanonicalizePath(&path, &slash_bits, &err)); + EXPECT_EQ(err, "too many path components"); // Backslashes version. + err = ""; path = "a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\." "\\a\\.\\a\\.\\a\\.\\a\\.\\a\\x.h"; EXPECT_FALSE(CanonicalizePath(&path, &slash_bits, &err)); + EXPECT_EQ(err, "too many path components"); } #endif |