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

Unified Diff: base/sys_info_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/sys_info_chromeos.cc ('k') | base/test/expectations/expectation_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sys_info_unittest.cc
diff --git a/base/sys_info_unittest.cc b/base/sys_info_unittest.cc
index bfd822470af75daa31456ff27c38956086afdae4..29409eed340c0af2f93e8419b054b04fbd0eca1e 100644
--- a/base/sys_info_unittest.cc
+++ b/base/sys_info_unittest.cc
@@ -71,7 +71,7 @@ TEST_F(SysInfoTest, GoogleChromeOSVersionNumbers) {
int32 os_major_version = -1;
int32 os_minor_version = -1;
int32 os_bugfix_version = -1;
- const char* kLsbRelease =
+ const char kLsbRelease[] =
"FOO=1234123.34.5\n"
"CHROMEOS_RELEASE_VERSION=1.2.3.4\n";
base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
@@ -87,7 +87,7 @@ TEST_F(SysInfoTest, GoogleChromeOSVersionNumbersFirst) {
int32 os_major_version = -1;
int32 os_minor_version = -1;
int32 os_bugfix_version = -1;
- const char* kLsbRelease =
+ const char kLsbRelease[] =
"CHROMEOS_RELEASE_VERSION=1.2.3.4\n"
"FOO=1234123.34.5\n";
base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
@@ -103,7 +103,7 @@ TEST_F(SysInfoTest, GoogleChromeOSNoVersionNumbers) {
int32 os_major_version = -1;
int32 os_minor_version = -1;
int32 os_bugfix_version = -1;
- const char* kLsbRelease = "FOO=1234123.34.5\n";
+ const char kLsbRelease[] = "FOO=1234123.34.5\n";
base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
base::SysInfo::OperatingSystemVersionNumbers(&os_major_version,
&os_minor_version,
@@ -114,7 +114,7 @@ TEST_F(SysInfoTest, GoogleChromeOSNoVersionNumbers) {
}
TEST_F(SysInfoTest, GoogleChromeOSLsbReleaseTime) {
- const char* kLsbRelease = "CHROMEOS_RELEASE_VERSION=1.2.3.4";
+ const char kLsbRelease[] = "CHROMEOS_RELEASE_VERSION=1.2.3.4";
// Use a fake time that can be safely displayed as a string.
const base::Time lsb_release_time(base::Time::FromDoubleT(12345.6));
base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, lsb_release_time);
@@ -127,19 +127,19 @@ TEST_F(SysInfoTest, IsRunningOnChromeOS) {
base::SysInfo::SetChromeOSVersionInfoForTest("", base::Time());
EXPECT_FALSE(base::SysInfo::IsRunningOnChromeOS());
- const char* kLsbRelease1 =
+ const char kLsbRelease1[] =
"CHROMEOS_RELEASE_NAME=Non Chrome OS\n"
"CHROMEOS_RELEASE_VERSION=1.2.3.4\n";
base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease1, base::Time());
EXPECT_FALSE(base::SysInfo::IsRunningOnChromeOS());
- const char* kLsbRelease2 =
+ const char kLsbRelease2[] =
"CHROMEOS_RELEASE_NAME=Chrome OS\n"
"CHROMEOS_RELEASE_VERSION=1.2.3.4\n";
base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, base::Time());
EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS());
- const char* kLsbRelease3 =
+ const char kLsbRelease3[] =
"CHROMEOS_RELEASE_NAME=Chromium OS\n";
base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease3, base::Time());
EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS());
« no previous file with comments | « base/sys_info_chromeos.cc ('k') | base/test/expectations/expectation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698