| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 #include "../../../testing/fx_string_testhelpers.h" | 6 #include "../../../testing/fx_string_testhelpers.h" |
| 7 #include "../../include/fxcrt/fx_basic.h" | 7 #include "../../include/fxcrt/fx_basic.h" |
| 8 | 8 |
| 9 TEST(fxcrt, ByteStringOperatorSubscript) { | 9 TEST(fxcrt, ByteStringOperatorSubscript) { |
| 10 // CFX_ByteString includes the NUL terminator for non-empty strings. | 10 // CFX_ByteString includes the NUL terminator for non-empty strings. |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 EXPECT_EQ(null_string, empty_string); | 271 EXPECT_EQ(null_string, empty_string); |
| 272 | 272 |
| 273 CFX_ByteStringC assigned_null_string("initially not NULL"); | 273 CFX_ByteStringC assigned_null_string("initially not NULL"); |
| 274 assigned_null_string = null_string; | 274 assigned_null_string = null_string; |
| 275 EXPECT_EQ(assigned_null_string.GetPtr(), nullptr); | 275 EXPECT_EQ(assigned_null_string.GetPtr(), nullptr); |
| 276 EXPECT_EQ(assigned_null_string.GetLength(), 0); | 276 EXPECT_EQ(assigned_null_string.GetLength(), 0); |
| 277 EXPECT_TRUE(assigned_null_string.IsEmpty()); | 277 EXPECT_TRUE(assigned_null_string.IsEmpty()); |
| 278 EXPECT_EQ(null_string, assigned_null_string); | 278 EXPECT_EQ(null_string, assigned_null_string); |
| 279 | 279 |
| 280 CFX_ByteStringC assigned_nullptr_string("initially not NULL"); | 280 CFX_ByteStringC assigned_nullptr_string("initially not NULL"); |
| 281 assigned_nullptr_string = (FX_LPCSTR)nullptr; | 281 assigned_nullptr_string = (const FX_CHAR*)nullptr; |
| 282 EXPECT_EQ(assigned_nullptr_string.GetPtr(), nullptr); | 282 EXPECT_EQ(assigned_nullptr_string.GetPtr(), nullptr); |
| 283 EXPECT_EQ(assigned_nullptr_string.GetLength(), 0); | 283 EXPECT_EQ(assigned_nullptr_string.GetLength(), 0); |
| 284 EXPECT_TRUE(assigned_nullptr_string.IsEmpty()); | 284 EXPECT_TRUE(assigned_nullptr_string.IsEmpty()); |
| 285 EXPECT_EQ(null_string, assigned_nullptr_string); | 285 EXPECT_EQ(null_string, assigned_nullptr_string); |
| 286 | 286 |
| 287 CFX_ByteStringC non_null_string("a"); | 287 CFX_ByteStringC non_null_string("a"); |
| 288 EXPECT_NE(null_string, non_null_string); | 288 EXPECT_NE(null_string, non_null_string); |
| 289 } | 289 } |
| 290 | 290 |
| 291 TEST(fxcrt, ByteStringConcatInPlace) { | 291 TEST(fxcrt, ByteStringConcatInPlace) { |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 const char* c_string2 = "hellp"; | 596 const char* c_string2 = "hellp"; |
| 597 const char* c_string3 = "hellod"; | 597 const char* c_string3 = "hellod"; |
| 598 EXPECT_TRUE(byte_string_c != c_string1); | 598 EXPECT_TRUE(byte_string_c != c_string1); |
| 599 EXPECT_TRUE(byte_string_c != c_string2); | 599 EXPECT_TRUE(byte_string_c != c_string2); |
| 600 EXPECT_TRUE(byte_string_c != c_string3); | 600 EXPECT_TRUE(byte_string_c != c_string3); |
| 601 | 601 |
| 602 EXPECT_TRUE(c_string1 != byte_string_c); | 602 EXPECT_TRUE(c_string1 != byte_string_c); |
| 603 EXPECT_TRUE(c_string2 != byte_string_c); | 603 EXPECT_TRUE(c_string2 != byte_string_c); |
| 604 EXPECT_TRUE(c_string3 != byte_string_c); | 604 EXPECT_TRUE(c_string3 != byte_string_c); |
| 605 } | 605 } |
| OLD | NEW |