diff options
| author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-20 02:49:49 +0000 |
|---|---|---|
| committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-20 02:49:49 +0000 |
| commit | c3b3e06a5b08d71e8fe0642c2aacd480cee5b691 (patch) | |
| tree | 96fc1dd0b2768dee4e2dcee62cd3272569cbe832 /base/environment_unittest.cc | |
| parent | eee2c0f944f3c374020dc247e893d5ef607f1b07 (diff) | |
| download | chromium_src-c3b3e06a5b08d71e8fe0642c2aacd480cee5b691.zip chromium_src-c3b3e06a5b08d71e8fe0642c2aacd480cee5b691.tar.gz chromium_src-c3b3e06a5b08d71e8fe0642c2aacd480cee5b691.tar.bz2 | |
Don't use const char kFoo[] in the stack place.
It creates a variable and copy the value all around. Instead use pointer so the other places where the variable is used
just point to the orignal variable instead of copying the value.
BUG=None
TEST=out/Debug/base_unittests --gtest_filter=EnvironmentTest.*
Review URL: http://codereview.chromium.org/3186017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56802 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/environment_unittest.cc')
| -rw-r--r-- | base/environment_unittest.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/base/environment_unittest.cc b/base/environment_unittest.cc index 3d7ab3c..5081459 100644 --- a/base/environment_unittest.cc +++ b/base/environment_unittest.cc @@ -26,8 +26,8 @@ TEST_F(EnvironmentTest, HasVar) { TEST_F(EnvironmentTest, SetVar) { scoped_ptr<base::Environment> env(base::Environment::Create()); - const char kFooUpper[] = "FOO"; - const char kFooLower[] = "foo"; + const char* kFooUpper = "FOO"; + const char* kFooLower = "foo"; EXPECT_TRUE(env->SetVar(kFooUpper, kFooLower)); // Now verify that the environment has the new variable. @@ -41,8 +41,8 @@ TEST_F(EnvironmentTest, SetVar) { TEST_F(EnvironmentTest, UnSetVar) { scoped_ptr<base::Environment> env(base::Environment::Create()); - const char kFooUpper[] = "FOO"; - const char kFooLower[] = "foo"; + const char* kFooUpper = "FOO"; + const char* kFooLower = "foo"; // First set some environment variable. EXPECT_TRUE(env->SetVar(kFooUpper, kFooLower)); |
