| 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/fx_string_testhelpers.h" | |
| 6 #include "core/include/fxcrt/fx_basic.h" | 5 #include "core/include/fxcrt/fx_basic.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]); |
| 16 } | 16 } |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 str.Format(L"%0f", 1.12345); | 509 str.Format(L"%0f", 1.12345); |
| 510 EXPECT_EQ(L"1.123450", str); | 510 EXPECT_EQ(L"1.123450", str); |
| 511 } | 511 } |
| 512 | 512 |
| 513 { | 513 { |
| 514 CFX_WideString str; | 514 CFX_WideString str; |
| 515 str.Format(L"%.1048576f", 1.2); | 515 str.Format(L"%.1048576f", 1.2); |
| 516 EXPECT_EQ(L"Bad precision", str); | 516 EXPECT_EQ(L"Bad precision", str); |
| 517 } | 517 } |
| 518 } | 518 } |
| OLD | NEW |