Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: core/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp

Issue 1832173003: Remove FX_DWORD from core/ and delete definition (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 PDFium Authors. All rights reserved. 1 // Copyright 2015 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/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h" 5 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "testing/test_support.h" 8 #include "testing/test_support.h"
9 9
10 TEST(fpdf_parser_decode, A85Decode) { 10 TEST(fpdf_parser_decode, A85Decode) {
(...skipping 11 matching lines...) Expand all
22 // No ending mark. 22 // No ending mark.
23 STR_IN_OUT_CASE("@3B0)DJj_BF*)>@Gp#-s", "a funny story :)", 20), 23 STR_IN_OUT_CASE("@3B0)DJj_BF*)>@Gp#-s", "a funny story :)", 20),
24 // Non-multiple length. 24 // Non-multiple length.
25 STR_IN_OUT_CASE("12A", "2k", 3), 25 STR_IN_OUT_CASE("12A", "2k", 3),
26 // Stop at unknown characters. 26 // Stop at unknown characters.
27 STR_IN_OUT_CASE("FCfN8FCfN8vw", "testtest", 11), 27 STR_IN_OUT_CASE("FCfN8FCfN8vw", "testtest", 11),
28 }; 28 };
29 for (size_t i = 0; i < FX_ArraySize(test_data); ++i) { 29 for (size_t i = 0; i < FX_ArraySize(test_data); ++i) {
30 pdfium::DecodeTestData* ptr = &test_data[i]; 30 pdfium::DecodeTestData* ptr = &test_data[i];
31 uint8_t* result = nullptr; 31 uint8_t* result = nullptr;
32 FX_DWORD result_size; 32 uint32_t result_size;
33 EXPECT_EQ(ptr->processed_size, 33 EXPECT_EQ(ptr->processed_size,
34 A85Decode(ptr->input, ptr->input_size, result, result_size)) 34 A85Decode(ptr->input, ptr->input_size, result, result_size))
35 << "for case " << i; 35 << "for case " << i;
36 ASSERT_EQ(ptr->expected_size, result_size); 36 ASSERT_EQ(ptr->expected_size, result_size);
37 for (size_t j = 0; j < result_size; ++j) { 37 for (size_t j = 0; j < result_size; ++j) {
38 EXPECT_EQ(ptr->expected[j], result[j]) << "for case " << i << " char " 38 EXPECT_EQ(ptr->expected[j], result[j]) << "for case " << i << " char "
39 << j; 39 << j;
40 } 40 }
41 FX_Free(result); 41 FX_Free(result);
42 } 42 }
(...skipping 14 matching lines...) Expand all
57 // Non-multiple length. 57 // Non-multiple length.
58 STR_IN_OUT_CASE("12A>zzz", "\x12\xa0", 4), 58 STR_IN_OUT_CASE("12A>zzz", "\x12\xa0", 4),
59 // Skips unknown characters. 59 // Skips unknown characters.
60 STR_IN_OUT_CASE("12tk \tAc>zzz", "\x12\xac", 10), 60 STR_IN_OUT_CASE("12tk \tAc>zzz", "\x12\xac", 10),
61 // No ending mark. 61 // No ending mark.
62 STR_IN_OUT_CASE("12AcED3c3456", "\x12\xac\xed\x3c\x34\x56", 12), 62 STR_IN_OUT_CASE("12AcED3c3456", "\x12\xac\xed\x3c\x34\x56", 12),
63 }; 63 };
64 for (size_t i = 0; i < FX_ArraySize(test_data); ++i) { 64 for (size_t i = 0; i < FX_ArraySize(test_data); ++i) {
65 pdfium::DecodeTestData* ptr = &test_data[i]; 65 pdfium::DecodeTestData* ptr = &test_data[i];
66 uint8_t* result = nullptr; 66 uint8_t* result = nullptr;
67 FX_DWORD result_size; 67 uint32_t result_size;
68 EXPECT_EQ(ptr->processed_size, 68 EXPECT_EQ(ptr->processed_size,
69 HexDecode(ptr->input, ptr->input_size, result, result_size)) 69 HexDecode(ptr->input, ptr->input_size, result, result_size))
70 << "for case " << i; 70 << "for case " << i;
71 ASSERT_EQ(ptr->expected_size, result_size); 71 ASSERT_EQ(ptr->expected_size, result_size);
72 for (size_t j = 0; j < result_size; ++j) { 72 for (size_t j = 0; j < result_size; ++j) {
73 EXPECT_EQ(ptr->expected[j], result[j]) << "for case " << i << " char " 73 EXPECT_EQ(ptr->expected[j], result[j]) << "for case " << i << " char "
74 << j; 74 << j;
75 } 75 }
76 FX_Free(result); 76 FX_Free(result);
77 } 77 }
78 } 78 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp ('k') | core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698