diff options
author | mmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 03:12:41 +0000 |
---|---|---|
committer | mmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 03:12:41 +0000 |
commit | 4e44b4d3cc5f4ea5c57ce9b495d1357563388962 (patch) | |
tree | 0a4909fc08d36dc16682e79ae8a9023370fbdfb3 /base/command_line_unittest.cc | |
parent | 67c72c75d2fde3ab75dd6e531dbc113d3fcfb6de (diff) | |
download | chromium_src-4e44b4d3cc5f4ea5c57ce9b495d1357563388962.zip chromium_src-4e44b4d3cc5f4ea5c57ce9b495d1357563388962.tar.gz chromium_src-4e44b4d3cc5f4ea5c57ce9b495d1357563388962.tar.bz2 |
Fix command_line unit test now that argv is no longer const. (Doh!) Remove a technically illegal zero-length array. Fix a couple of warnings for good measure as long as I'm in here.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@701 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/command_line_unittest.cc')
-rw-r--r-- | base/command_line_unittest.cc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/base/command_line_unittest.cc b/base/command_line_unittest.cc index ae619d5..a564f0b 100644 --- a/base/command_line_unittest.cc +++ b/base/command_line_unittest.cc @@ -47,13 +47,13 @@ TEST(CommandLineTest, CommandLineConstructor) { L"-spaetzle=Crepe -=loosevalue flan " L"--input-translation=\"45\"--output-rotation " L"\"in the time of submarines...\""); -#elif OS_POSIX - const char* argv[] = {"program", "--foo=", "-bAr", - "-Spaetzel=pierogi", "-Baz", "flim", - "--other-switches=--dog=canine --cat=feline", - "-spaetzle=Crepe", "-=loosevalue", "flan", - "--input-translation=45--output-rotation", - "in the time of submarines..."}; +#elif defined(OS_POSIX) + char* argv[] = {"program", "--foo=", "-bAr", + "-Spaetzel=pierogi", "-Baz", "flim", + "--other-switches=--dog=canine --cat=feline", + "-spaetzle=Crepe", "-=loosevalue", "flan", + "--input-translation=45--output-rotation", + "in the time of submarines..."}; CommandLine cl(arraysize(argv), argv); #endif EXPECT_FALSE(cl.command_line_string().empty()); @@ -81,7 +81,7 @@ TEST(CommandLineTest, CommandLineConstructor) { EXPECT_EQ(L"--dog=canine --cat=feline", cl.GetSwitchValue(L"other-switches")); EXPECT_EQ(L"45--output-rotation", cl.GetSwitchValue(L"input-translation")); - EXPECT_EQ(3, cl.GetLooseValueCount()); + EXPECT_EQ(static_cast<size_t>(3), cl.GetLooseValueCount()); CommandLine::LooseValueIterator iter = cl.GetLooseValuesBegin(); EXPECT_EQ(L"flim", *iter); @@ -105,12 +105,11 @@ TEST(CommandLineTest, EmptyString) { #if defined(OS_WIN) CommandLine cl(L""); #elif defined(OS_POSIX) - const char* argv[] = {}; - CommandLine cl(ARRAYSIZE_UNSAFE(argv), argv); + CommandLine cl(0, NULL); #endif EXPECT_TRUE(cl.command_line_string().empty()); EXPECT_TRUE(cl.program().empty()); - EXPECT_EQ(0, cl.GetLooseValueCount()); + EXPECT_EQ(static_cast<size_t>(0), cl.GetLooseValueCount()); } // Test static functions for appending switches to a command line. |