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

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

Issue 24205004: Rollback trunk to 3.21.16.2 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | « test/cctest/test-api.cc ('k') | test/cctest/test-heap.cc » ('j') | 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 a1d2405ad5818065a483ef3186c38d1c5f45cdea..9cb12c4787f59995e6807e7cdae2d52fdfa57824 100644
--- a/test/cctest/test-flags.cc
+++ b/test/cctest/test-flags.cc
@@ -54,18 +54,15 @@ TEST(Flags1) {
TEST(Flags2) {
SetFlagsToDefault();
- int argc = 8;
- const char* argv[] = { "Test2", "-notesting-bool-flag",
- "--notesting-maybe-bool-flag", "notaflag",
+ int argc = 7;
+ const char* argv[] = { "Test2", "-notesting-bool-flag", "notaflag",
"--testing_int_flag=77", "-testing_float_flag=.25",
"--testing_string_flag", "no way!" };
CHECK_EQ(0, FlagList::SetFlagsFromCommandLine(&argc,
const_cast<char **>(argv),
false));
- CHECK_EQ(8, argc);
+ CHECK_EQ(7, argc);
CHECK(!FLAG_testing_bool_flag);
- CHECK(FLAG_testing_maybe_bool_flag.has_value);
- CHECK(!FLAG_testing_maybe_bool_flag.value);
CHECK_EQ(77, FLAG_testing_int_flag);
CHECK_EQ(.25, FLAG_testing_float_flag);
CHECK_EQ(0, strcmp(FLAG_testing_string_flag, "no way!"));
@@ -76,13 +73,10 @@ TEST(Flags2b) {
SetFlagsToDefault();
const char* str =
" -notesting-bool-flag notaflag --testing_int_flag=77 "
- "-notesting-maybe-bool-flag "
"-testing_float_flag=.25 "
"--testing_string_flag no_way! ";
CHECK_EQ(0, FlagList::SetFlagsFromString(str, StrLength(str)));
CHECK(!FLAG_testing_bool_flag);
- CHECK(FLAG_testing_maybe_bool_flag.has_value);
- CHECK(!FLAG_testing_maybe_bool_flag.value);
CHECK_EQ(77, FLAG_testing_int_flag);
CHECK_EQ(.25, FLAG_testing_float_flag);
CHECK_EQ(0, strcmp(FLAG_testing_string_flag, "no_way!"));
@@ -91,9 +85,9 @@ TEST(Flags2b) {
TEST(Flags3) {
SetFlagsToDefault();
- int argc = 9;
+ int argc = 8;
const char* argv[] =
- { "Test3", "--testing_bool_flag", "--testing-maybe-bool-flag", "notaflag",
+ { "Test3", "--testing_bool_flag", "notaflag",
"--testing_int_flag", "-666",
"--testing_float_flag", "-12E10", "-testing-string-flag=foo-bar" };
CHECK_EQ(0, FlagList::SetFlagsFromCommandLine(&argc,
@@ -101,8 +95,6 @@ TEST(Flags3) {
true));
CHECK_EQ(2, argc);
CHECK(FLAG_testing_bool_flag);
- CHECK(FLAG_testing_maybe_bool_flag.has_value);
- CHECK(FLAG_testing_maybe_bool_flag.value);
CHECK_EQ(-666, FLAG_testing_int_flag);
CHECK_EQ(-12E10, FLAG_testing_float_flag);
CHECK_EQ(0, strcmp(FLAG_testing_string_flag, "foo-bar"));
@@ -112,14 +104,11 @@ TEST(Flags3) {
TEST(Flags3b) {
SetFlagsToDefault();
const char* str =
- "--testing_bool_flag --testing-maybe-bool-flag notaflag "
- "--testing_int_flag -666 "
+ "--testing_bool_flag notaflag --testing_int_flag -666 "
"--testing_float_flag -12E10 "
"-testing-string-flag=foo-bar";
CHECK_EQ(0, FlagList::SetFlagsFromString(str, StrLength(str)));
CHECK(FLAG_testing_bool_flag);
- CHECK(FLAG_testing_maybe_bool_flag.has_value);
- CHECK(FLAG_testing_maybe_bool_flag.value);
CHECK_EQ(-666, FLAG_testing_int_flag);
CHECK_EQ(-12E10, FLAG_testing_float_flag);
CHECK_EQ(0, strcmp(FLAG_testing_string_flag, "foo-bar"));
@@ -134,7 +123,6 @@ TEST(Flags4) {
const_cast<char **>(argv),
true));
CHECK_EQ(2, argc);
- CHECK(!FLAG_testing_maybe_bool_flag.has_value);
}
@@ -142,7 +130,6 @@ TEST(Flags4b) {
SetFlagsToDefault();
const char* str = "--testing_bool_flag --foo";
CHECK_EQ(2, FlagList::SetFlagsFromString(str, StrLength(str)));
- CHECK(!FLAG_testing_maybe_bool_flag.has_value);
}
@@ -194,7 +181,7 @@ TEST(FlagsJSArguments1) {
true));
CHECK_EQ(42, FLAG_testing_int_flag);
CHECK_EQ(2.5, FLAG_testing_float_flag);
- CHECK_EQ(2, FLAG_js_arguments.argc);
+ CHECK_EQ(2, FLAG_js_arguments.argc());
CHECK_EQ(0, strcmp(FLAG_js_arguments[0], "testing-float-flag"));
CHECK_EQ(0, strcmp(FLAG_js_arguments[1], "7"));
CHECK_EQ(1, argc);
@@ -207,7 +194,7 @@ TEST(FlagsJSArguments1b) {
CHECK_EQ(0, FlagList::SetFlagsFromString(str, StrLength(str)));
CHECK_EQ(42, FLAG_testing_int_flag);
CHECK_EQ(2.5, FLAG_testing_float_flag);
- CHECK_EQ(2, FLAG_js_arguments.argc);
+ CHECK_EQ(2, FLAG_js_arguments.argc());
CHECK_EQ(0, strcmp(FLAG_js_arguments[0], "testing-float-flag"));
CHECK_EQ(0, strcmp(FLAG_js_arguments[1], "7"));
}
@@ -219,7 +206,7 @@ TEST(FlagsJSArguments2) {
CHECK_EQ(0, FlagList::SetFlagsFromString(str, StrLength(str)));
CHECK_EQ(42, FLAG_testing_int_flag);
CHECK_EQ(2.5, FLAG_testing_float_flag);
- CHECK_EQ(2, FLAG_js_arguments.argc);
+ CHECK_EQ(2, FLAG_js_arguments.argc());
CHECK_EQ(0, strcmp(FLAG_js_arguments[0], "testing-float-flag"));
CHECK_EQ(0, strcmp(FLAG_js_arguments[1], "7"));
}
@@ -231,7 +218,7 @@ TEST(FlagsJSArguments3) {
CHECK_EQ(0, FlagList::SetFlagsFromString(str, StrLength(str)));
CHECK_EQ(42, FLAG_testing_int_flag);
CHECK_EQ(2.5, FLAG_testing_float_flag);
- CHECK_EQ(2, FLAG_js_arguments.argc);
+ CHECK_EQ(2, FLAG_js_arguments.argc());
CHECK_EQ(0, strcmp(FLAG_js_arguments[0], "testing-float-flag"));
CHECK_EQ(0, strcmp(FLAG_js_arguments[1], "7"));
}
@@ -242,7 +229,7 @@ TEST(FlagsJSArguments4) {
const char* str = "--testing-int-flag 42 --";
CHECK_EQ(0, FlagList::SetFlagsFromString(str, StrLength(str)));
CHECK_EQ(42, FLAG_testing_int_flag);
- CHECK_EQ(0, FLAG_js_arguments.argc);
+ CHECK_EQ(0, FLAG_js_arguments.argc());
}
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698