diff options
author | Lei Zhang <thestig@chromium.org> | 2017-11-06 18:51:02 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-06 18:51:02 +0000 |
commit | ac7ce6ec217ba7b4753f4cf2ed80c921d8ea6898 (patch) | |
tree | 069033fa9f14086621a0cdc034dbbdd99d40b706 /core/fxcrt | |
parent | 438b1e32fb6cc096c65969405fd14cba21071d85 (diff) | |
download | pdfium-ac7ce6ec217ba7b4753f4cf2ed80c921d8ea6898.tar.xz |
Mark string pointers as const in string unit tests.
Change-Id: I4895ee9c0cbe1aaf1fe9913d39ce11e6ad855dd3
Reviewed-on: https://pdfium-review.googlesource.com/17873
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcrt')
-rw-r--r-- | core/fxcrt/bytestring_unittest.cpp | 40 | ||||
-rw-r--r-- | core/fxcrt/widestring_unittest.cpp | 40 |
2 files changed, 40 insertions, 40 deletions
diff --git a/core/fxcrt/bytestring_unittest.cpp b/core/fxcrt/bytestring_unittest.cpp index ed20abcc8e..9812367fe8 100644 --- a/core/fxcrt/bytestring_unittest.cpp +++ b/core/fxcrt/bytestring_unittest.cpp @@ -153,8 +153,8 @@ TEST(ByteString, OperatorEQ) { EXPECT_FALSE(byte_string_c2 == byte_string); EXPECT_FALSE(byte_string_c3 == byte_string); - const char* c_null_string = nullptr; - const char* c_empty_string = ""; + const char* const c_null_string = nullptr; + const char* const c_empty_string = ""; EXPECT_TRUE(null_string == c_null_string); EXPECT_TRUE(null_string == c_empty_string); EXPECT_TRUE(empty_string == c_null_string); @@ -168,13 +168,13 @@ TEST(ByteString, OperatorEQ) { EXPECT_TRUE(c_null_string == deleted_string); EXPECT_TRUE(c_empty_string == deleted_string); - const char* c_string_same1 = "hello"; + const char* const c_string_same1 = "hello"; EXPECT_TRUE(byte_string == c_string_same1); EXPECT_TRUE(c_string_same1 == byte_string); - const char* c_string1 = "he"; - const char* c_string2 = "hellp"; - const char* c_string3 = "hellod"; + const char* const c_string1 = "he"; + const char* const c_string2 = "hellp"; + const char* const c_string3 = "hellod"; EXPECT_FALSE(byte_string == c_string1); EXPECT_FALSE(byte_string == c_string2); EXPECT_FALSE(byte_string == c_string3); @@ -254,8 +254,8 @@ TEST(ByteString, OperatorNE) { EXPECT_TRUE(byte_string_c2 != byte_string); EXPECT_TRUE(byte_string_c3 != byte_string); - const char* c_null_string = nullptr; - const char* c_empty_string = ""; + const char* const c_null_string = nullptr; + const char* const c_empty_string = ""; EXPECT_FALSE(null_string != c_null_string); EXPECT_FALSE(null_string != c_empty_string); EXPECT_FALSE(empty_string != c_null_string); @@ -269,13 +269,13 @@ TEST(ByteString, OperatorNE) { EXPECT_FALSE(c_null_string != deleted_string); EXPECT_FALSE(c_empty_string != deleted_string); - const char* c_string_same1 = "hello"; + const char* const c_string_same1 = "hello"; EXPECT_FALSE(byte_string != c_string_same1); EXPECT_FALSE(c_string_same1 != byte_string); - const char* c_string1 = "he"; - const char* c_string2 = "hellp"; - const char* c_string3 = "hellod"; + const char* const c_string1 = "he"; + const char* const c_string2 = "hellp"; + const char* const c_string3 = "hellod"; EXPECT_TRUE(byte_string != c_string1); EXPECT_TRUE(byte_string != c_string2); EXPECT_TRUE(byte_string != c_string3); @@ -1153,13 +1153,13 @@ TEST(ByteStringView, OperatorEQ) { EXPECT_FALSE(byte_string2 == byte_string_c); EXPECT_FALSE(byte_string3 == byte_string_c); - const char* c_string_same1 = "hello"; + const char* const c_string_same1 = "hello"; EXPECT_TRUE(byte_string_c == c_string_same1); EXPECT_TRUE(c_string_same1 == byte_string_c); - const char* c_string1 = "he"; - const char* c_string2 = "hellp"; - const char* c_string3 = "hellod"; + const char* const c_string1 = "he"; + const char* const c_string2 = "hellp"; + const char* const c_string3 = "hellod"; EXPECT_FALSE(byte_string_c == c_string1); EXPECT_FALSE(byte_string_c == c_string2); EXPECT_FALSE(byte_string_c == c_string3); @@ -1205,13 +1205,13 @@ TEST(ByteStringView, OperatorNE) { EXPECT_TRUE(byte_string2 != byte_string_c); EXPECT_TRUE(byte_string3 != byte_string_c); - const char* c_string_same1 = "hello"; + const char* const c_string_same1 = "hello"; EXPECT_FALSE(byte_string_c != c_string_same1); EXPECT_FALSE(c_string_same1 != byte_string_c); - const char* c_string1 = "he"; - const char* c_string2 = "hellp"; - const char* c_string3 = "hellod"; + const char* const c_string1 = "he"; + const char* const c_string2 = "hellp"; + const char* const c_string3 = "hellod"; EXPECT_TRUE(byte_string_c != c_string1); EXPECT_TRUE(byte_string_c != c_string2); EXPECT_TRUE(byte_string_c != c_string3); diff --git a/core/fxcrt/widestring_unittest.cpp b/core/fxcrt/widestring_unittest.cpp index 7824c2bd72..681fb472a2 100644 --- a/core/fxcrt/widestring_unittest.cpp +++ b/core/fxcrt/widestring_unittest.cpp @@ -152,8 +152,8 @@ TEST(WideString, OperatorEQ) { EXPECT_FALSE(wide_string_c2 == wide_string); EXPECT_FALSE(wide_string_c3 == wide_string); - const wchar_t* c_null_string = nullptr; - const wchar_t* c_empty_string = L""; + const wchar_t* const c_null_string = nullptr; + const wchar_t* const c_empty_string = L""; EXPECT_TRUE(null_string == c_null_string); EXPECT_TRUE(null_string == c_empty_string); EXPECT_TRUE(empty_string == c_null_string); @@ -167,13 +167,13 @@ TEST(WideString, OperatorEQ) { EXPECT_TRUE(c_null_string == deleted_string); EXPECT_TRUE(c_empty_string == deleted_string); - const wchar_t* c_string_same1 = L"hello"; + const wchar_t* const c_string_same1 = L"hello"; EXPECT_TRUE(wide_string == c_string_same1); EXPECT_TRUE(c_string_same1 == wide_string); - const wchar_t* c_string1 = L"he"; - const wchar_t* c_string2 = L"hellp"; - const wchar_t* c_string3 = L"hellod"; + const wchar_t* const c_string1 = L"he"; + const wchar_t* const c_string2 = L"hellp"; + const wchar_t* const c_string3 = L"hellod"; EXPECT_FALSE(wide_string == c_string1); EXPECT_FALSE(wide_string == c_string2); EXPECT_FALSE(wide_string == c_string3); @@ -253,8 +253,8 @@ TEST(WideString, OperatorNE) { EXPECT_TRUE(wide_string_c2 != wide_string); EXPECT_TRUE(wide_string_c3 != wide_string); - const wchar_t* c_null_string = nullptr; - const wchar_t* c_empty_string = L""; + const wchar_t* const c_null_string = nullptr; + const wchar_t* const c_empty_string = L""; EXPECT_FALSE(null_string != c_null_string); EXPECT_FALSE(null_string != c_empty_string); EXPECT_FALSE(empty_string != c_null_string); @@ -268,13 +268,13 @@ TEST(WideString, OperatorNE) { EXPECT_FALSE(c_null_string != deleted_string); EXPECT_FALSE(c_empty_string != deleted_string); - const wchar_t* c_string_same1 = L"hello"; + const wchar_t* const c_string_same1 = L"hello"; EXPECT_FALSE(wide_string != c_string_same1); EXPECT_FALSE(c_string_same1 != wide_string); - const wchar_t* c_string1 = L"he"; - const wchar_t* c_string2 = L"hellp"; - const wchar_t* c_string3 = L"hellod"; + const wchar_t* const c_string1 = L"he"; + const wchar_t* const c_string2 = L"hellp"; + const wchar_t* const c_string3 = L"hellod"; EXPECT_TRUE(wide_string != c_string1); EXPECT_TRUE(wide_string != c_string2); EXPECT_TRUE(wide_string != c_string3); @@ -940,13 +940,13 @@ TEST(WideStringView, OperatorEQ) { EXPECT_FALSE(wide_string2 == wide_string_c); EXPECT_FALSE(wide_string3 == wide_string_c); - const wchar_t* c_string_same1 = L"hello"; + const wchar_t* const c_string_same1 = L"hello"; EXPECT_TRUE(wide_string_c == c_string_same1); EXPECT_TRUE(c_string_same1 == wide_string_c); - const wchar_t* c_string1 = L"he"; - const wchar_t* c_string2 = L"hellp"; - const wchar_t* c_string3 = L"hellod"; + const wchar_t* const c_string1 = L"he"; + const wchar_t* const c_string2 = L"hellp"; + const wchar_t* const c_string3 = L"hellod"; EXPECT_FALSE(wide_string_c == c_string1); EXPECT_FALSE(wide_string_c == c_string2); EXPECT_FALSE(wide_string_c == c_string3); @@ -992,13 +992,13 @@ TEST(WideStringView, OperatorNE) { EXPECT_TRUE(wide_string2 != wide_string_c); EXPECT_TRUE(wide_string3 != wide_string_c); - const wchar_t* c_string_same1 = L"hello"; + const wchar_t* const c_string_same1 = L"hello"; EXPECT_FALSE(wide_string_c != c_string_same1); EXPECT_FALSE(c_string_same1 != wide_string_c); - const wchar_t* c_string1 = L"he"; - const wchar_t* c_string2 = L"hellp"; - const wchar_t* c_string3 = L"hellod"; + const wchar_t* const c_string1 = L"he"; + const wchar_t* const c_string2 = L"hellp"; + const wchar_t* const c_string3 = L"hellod"; EXPECT_TRUE(wide_string_c != c_string1); EXPECT_TRUE(wide_string_c != c_string2); EXPECT_TRUE(wide_string_c != c_string3); |