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

Unified Diff: base/environment_unittest.cc

Issue 632103004: Cleanup: Better constify some strings in base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad refactoring Created 6 years, 2 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 | « base/debug/trace_event_unittest.cc ('k') | base/files/file_path.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/environment_unittest.cc
diff --git a/base/environment_unittest.cc b/base/environment_unittest.cc
index e8c19060d6e873a73d677aab7ac11c2692ecd908..f0577a8a82bbae73e9efb1cb33b66cd89448644e 100644
--- a/base/environment_unittest.cc
+++ b/base/environment_unittest.cc
@@ -21,8 +21,8 @@ TEST_F(EnvironmentTest, GetVar) {
TEST_F(EnvironmentTest, GetVarReverse) {
scoped_ptr<Environment> env(Environment::Create());
- const char* kFooUpper = "FOO";
- const char* kFooLower = "foo";
+ const char kFooUpper[] = "FOO";
+ const char kFooLower[] = "foo";
// Set a variable in UPPER case.
EXPECT_TRUE(env->SetVar(kFooUpper, kFooLower));
@@ -35,7 +35,7 @@ TEST_F(EnvironmentTest, GetVarReverse) {
EXPECT_TRUE(env->UnSetVar(kFooUpper));
- const char* kBar = "bar";
+ const char kBar[] = "bar";
// Now do the opposite, set the variable in the lower case.
EXPECT_TRUE(env->SetVar(kFooLower, kBar));
@@ -56,8 +56,8 @@ TEST_F(EnvironmentTest, HasVar) {
TEST_F(EnvironmentTest, SetVar) {
scoped_ptr<Environment> env(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.
@@ -71,8 +71,8 @@ TEST_F(EnvironmentTest, SetVar) {
TEST_F(EnvironmentTest, UnSetVar) {
scoped_ptr<Environment> env(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));
@@ -95,7 +95,7 @@ TEST_F(EnvironmentTest, AlterEnvironment) {
string16 e;
e = AlterEnvironment(empty, changes);
- EXPECT_TRUE(e[0] == 0);
+ EXPECT_EQ(0, e[0]);
changes[L"A"] = L"1";
e = AlterEnvironment(empty, changes);
« no previous file with comments | « base/debug/trace_event_unittest.cc ('k') | base/files/file_path.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698