| 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_string.h" | 5 #include "core/include/fxcrt/fx_string.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, 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. |
| 11 CFX_ByteString abc("abc"); | 11 CFX_ByteString abc("abc"); |
| 12 EXPECT_EQ('a', abc[0]); | 12 EXPECT_EQ('a', abc[0]); |
| 13 EXPECT_EQ('b', abc[1]); | 13 EXPECT_EQ('b', abc[1]); |
| 14 EXPECT_EQ('c', abc[2]); | 14 EXPECT_EQ('c', abc[2]); |
| 15 EXPECT_EQ(0, abc[3]); | 15 EXPECT_EQ(0, abc[3]); |
| 16 } | 16 } |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 str.Format("%0f", 1.12345); | 672 str.Format("%0f", 1.12345); |
| 673 EXPECT_EQ("1.123450", str); | 673 EXPECT_EQ("1.123450", str); |
| 674 } | 674 } |
| 675 | 675 |
| 676 { | 676 { |
| 677 CFX_ByteString str; | 677 CFX_ByteString str; |
| 678 str.Format("%.1048576f", 1.2); | 678 str.Format("%.1048576f", 1.2); |
| 679 EXPECT_EQ("Bad precision", str); | 679 EXPECT_EQ("Bad precision", str); |
| 680 } | 680 } |
| 681 } | 681 } |
| OLD | NEW |