| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/cfx_string_pool_template.h" | 5 #include "core/fxcrt/cfx_string_pool_template.h" |
| 6 #include "core/fxcrt/include/fx_string.h" | 6 #include "core/fxcrt/fx_string.h" |
| 7 #include "testing/fx_string_testhelpers.h" | 7 #include "testing/fx_string_testhelpers.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 TEST(fxcrt, ByteStringPool) { | 10 TEST(fxcrt, ByteStringPool) { |
| 11 CFX_ByteStringPool pool; | 11 CFX_ByteStringPool pool; |
| 12 | 12 |
| 13 CFX_ByteString null1; | 13 CFX_ByteString null1; |
| 14 CFX_ByteString null2; | 14 CFX_ByteString null2; |
| 15 CFX_ByteString goats1("goats"); | 15 CFX_ByteString goats1("goats"); |
| 16 CFX_ByteString goats2("goats"); | 16 CFX_ByteString goats2("goats"); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 CFX_WideString reinterned_null1 = pool.Intern(null2); | 85 CFX_WideString reinterned_null1 = pool.Intern(null2); |
| 86 CFX_WideString reinterned_goats2 = pool.Intern(goats2); | 86 CFX_WideString reinterned_goats2 = pool.Intern(goats2); |
| 87 CFX_WideString reinterned_goats1 = pool.Intern(goats2); | 87 CFX_WideString reinterned_goats1 = pool.Intern(goats2); |
| 88 | 88 |
| 89 // After clearing pool, storage was re-interned using second strings. | 89 // After clearing pool, storage was re-interned using second strings. |
| 90 EXPECT_EQ(nullptr, interned_null1.m_pData.Get()); | 90 EXPECT_EQ(nullptr, interned_null1.m_pData.Get()); |
| 91 EXPECT_EQ(nullptr, interned_null2.m_pData.Get()); | 91 EXPECT_EQ(nullptr, interned_null2.m_pData.Get()); |
| 92 EXPECT_EQ(goats2.m_pData, reinterned_goats1.m_pData); | 92 EXPECT_EQ(goats2.m_pData, reinterned_goats1.m_pData); |
| 93 EXPECT_EQ(goats2.m_pData, reinterned_goats2.m_pData); | 93 EXPECT_EQ(goats2.m_pData, reinterned_goats2.m_pData); |
| 94 } | 94 } |
| OLD | NEW |