| 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 "core/fxcrt/include/fx_basic.h" | 5 #include "core/fxcrt/fx_basic.h" |
| 6 #include "testing/fx_string_testhelpers.h" | 6 #include "testing/fx_string_testhelpers.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 TEST(fxcrt, WideStringOperatorSubscript) { | 9 TEST(fxcrt, WideStringOperatorSubscript) { |
| 10 // CFX_WideString includes the NUL terminator for non-empty strings. | 10 // CFX_WideString includes the NUL terminator for non-empty strings. |
| 11 CFX_WideString abc(L"abc"); | 11 CFX_WideString abc(L"abc"); |
| 12 EXPECT_EQ(L'a', abc[0]); | 12 EXPECT_EQ(L'a', abc[0]); |
| 13 EXPECT_EQ(L'b', abc[1]); | 13 EXPECT_EQ(L'b', abc[1]); |
| 14 EXPECT_EQ(L'c', abc[2]); | 14 EXPECT_EQ(L'c', abc[2]); |
| 15 EXPECT_EQ(L'\0', abc[3]); | 15 EXPECT_EQ(L'\0', abc[3]); |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 } | 932 } |
| 933 } | 933 } |
| 934 | 934 |
| 935 TEST(fxcrt, EmptyWideString) { | 935 TEST(fxcrt, EmptyWideString) { |
| 936 CFX_WideString empty_str; | 936 CFX_WideString empty_str; |
| 937 EXPECT_TRUE(empty_str.IsEmpty()); | 937 EXPECT_TRUE(empty_str.IsEmpty()); |
| 938 EXPECT_EQ(0, empty_str.GetLength()); | 938 EXPECT_EQ(0, empty_str.GetLength()); |
| 939 const FX_WCHAR* cstr = empty_str.c_str(); | 939 const FX_WCHAR* cstr = empty_str.c_str(); |
| 940 EXPECT_EQ(0, FXSYS_wcslen(cstr)); | 940 EXPECT_EQ(0, FXSYS_wcslen(cstr)); |
| 941 } | 941 } |
| OLD | NEW |