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, ByteStringCNull) { | 9 TEST(fxcrt, ByteStringCNull) { |
10 CFX_ByteStringC null_string; | 10 CFX_ByteStringC null_string; |
11 EXPECT_EQ(null_string.GetPtr(), nullptr); | 11 EXPECT_EQ(null_string.GetPtr(), nullptr); |
12 EXPECT_EQ(null_string.GetLength(), 0); | 12 EXPECT_EQ(null_string.GetLength(), 0); |
13 EXPECT_TRUE(null_string.IsEmpty()); | 13 EXPECT_TRUE(null_string.IsEmpty()); |
14 | 14 |
15 CFX_ByteStringC another_null_string; | 15 CFX_ByteStringC another_null_string; |
16 EXPECT_EQ(null_string, another_null_string); | 16 EXPECT_EQ(null_string, another_null_string); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 CFX_ByteString short_string("a"); | 183 CFX_ByteString short_string("a"); |
184 CFX_ByteString longer_string("abc"); | 184 CFX_ByteString longer_string("abc"); |
185 CFX_ByteString embedded_nul_string("ab\0c", 4); | 185 CFX_ByteString embedded_nul_string("ab\0c", 4); |
186 | 186 |
187 EXPECT_EQ('a', short_string.GetAt(0)); | 187 EXPECT_EQ('a', short_string.GetAt(0)); |
188 EXPECT_EQ('c', longer_string.GetAt(2)); | 188 EXPECT_EQ('c', longer_string.GetAt(2)); |
189 EXPECT_EQ('b', embedded_nul_string.GetAt(1)); | 189 EXPECT_EQ('b', embedded_nul_string.GetAt(1)); |
190 EXPECT_EQ('\0', embedded_nul_string.GetAt(2)); | 190 EXPECT_EQ('\0', embedded_nul_string.GetAt(2)); |
191 EXPECT_EQ('c', embedded_nul_string.GetAt(3)); | 191 EXPECT_EQ('c', embedded_nul_string.GetAt(3)); |
192 } | 192 } |
OLD | NEW |