summaryrefslogtreecommitdiffstats
path: root/src/manifest_parser_test.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2015-01-20 05:20:15 (GMT)
committerNico Weber <nicolasweber@gmx.de>2015-01-20 05:20:15 (GMT)
commita87516edd643e15d3a2a51048e6b507683f63ea7 (patch)
tree6ca0dcfef7aab4aefb5aad5de1011ed886392749 /src/manifest_parser_test.cc
parent81d43ed3ee5b399f69fdff4b520523d43ae0c2d4 (diff)
downloadNinja-a87516edd643e15d3a2a51048e6b507683f63ea7.zip
Ninja-a87516edd643e15d3a2a51048e6b507683f63ea7.tar.gz
Ninja-a87516edd643e15d3a2a51048e6b507683f63ea7.tar.bz2
Remove an incorrect assert.
The assert fires on cyclic manifests (found by afl-fuzz). Since there was explicit error handing for this case already, just remove the assert.
Diffstat (limited to 'src/manifest_parser_test.cc')
-rw-r--r--src/manifest_parser_test.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/manifest_parser_test.cc b/src/manifest_parser_test.cc
index 6909ea9..a8f2e53 100644
--- a/src/manifest_parser_test.cc
+++ b/src/manifest_parser_test.cc
@@ -891,6 +891,16 @@ TEST_F(ParserTest, DefaultDefault) {
EXPECT_EQ("", err);
}
+TEST_F(ParserTest, DefaultDefaultCycle) {
+ ASSERT_NO_FATAL_FAILURE(AssertParse(
+"rule cat\n command = cat $in > $out\n"
+"build a: cat a\n"));
+
+ string err;
+ EXPECT_EQ(0u, state.DefaultNodes(&err).size());
+ EXPECT_EQ("could not determine root nodes of build graph", err);
+}
+
TEST_F(ParserTest, DefaultStatements) {
ASSERT_NO_FATAL_FAILURE(AssertParse(
"rule cat\n command = cat $in > $out\n"