summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_array_unittest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser/cpdf_array_unittest.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_array_unittest.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/core/fpdfapi/parser/cpdf_array_unittest.cpp b/core/fpdfapi/parser/cpdf_array_unittest.cpp
index 006e5fad33..4ce66dcadb 100644
--- a/core/fpdfapi/parser/cpdf_array_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_array_unittest.cpp
@@ -53,32 +53,6 @@ TEST(cpdf_array, Clear) {
EXPECT_EQ(0U, arr->GetCount());
}
-TEST(cpdf_array, Truncate) {
- {
- const int elems[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
- auto arr = pdfium::MakeUnique<CPDF_Array>();
- for (size_t i = 0; i < FX_ArraySize(elems); ++i)
- arr->AddNew<CPDF_Number>(elems[i]);
- arr->Truncate(4);
- const int expected[] = {1, 2, 3, 4};
- ASSERT_EQ(FX_ArraySize(expected), arr->GetCount());
- for (size_t i = 0; i < FX_ArraySize(expected); ++i)
- EXPECT_EQ(expected[i], arr->GetIntegerAt(i));
- arr->Truncate(0);
- EXPECT_EQ(0U, arr->GetCount());
- }
- {
- // When the range is out of bound, Truncate() has no effect.
- // It does not try to grow the array.
- const int elems[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
- auto arr = pdfium::MakeUnique<CPDF_Array>();
- for (size_t i = 0; i < FX_ArraySize(elems); ++i)
- arr->AddNew<CPDF_Number>(elems[i]);
- arr->Truncate(11);
- EXPECT_EQ(FX_ArraySize(elems), arr->GetCount());
- }
-}
-
TEST(cpdf_array, InsertAt) {
{
const int elems[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};