Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: test/cctest/test-flags.cc

Issue 10534137: Ensure removing processed command line arguments. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flags.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-flags.cc
diff --git a/test/cctest/test-flags.cc b/test/cctest/test-flags.cc
index 32f1264f7f1ab7a8fd783596ca60dbeff1f0d1e8..9cb12c4787f59995e6807e7cdae2d52fdfa57824 100644
--- a/test/cctest/test-flags.cc
+++ b/test/cctest/test-flags.cc
@@ -159,7 +159,7 @@ TEST(Flags6) {
CHECK_EQ(3, FlagList::SetFlagsFromCommandLine(&argc,
const_cast<char **>(argv),
true));
- CHECK_EQ(4, argc);
+ CHECK_EQ(2, argc);
}
@@ -232,3 +232,16 @@ TEST(FlagsJSArguments4) {
CHECK_EQ(0, FLAG_js_arguments.argc());
}
+
+TEST(FlagsRemoveIncomplete) {
+ // Test that processed command line arguments are removed, even
+ // if the list of arguments ends unexpectedly.
+ SetFlagsToDefault();
+ int argc = 3;
+ const char* argv[] = { "", "--crankshaft", "--expose-debug-as" };
+ CHECK_EQ(2, FlagList::SetFlagsFromCommandLine(&argc,
+ const_cast<char **>(argv),
+ true));
+ CHECK_NE(NULL, argv[1]);
+ CHECK_EQ(argc, 2);
+}
« no previous file with comments | « src/flags.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698