diff options
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp b/core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp index be2fcb09e4..ffc0d95107 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp +++ b/core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp @@ -2,33 +2,39 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fpdfapi/page/pageint.h" +#include "core/fpdfapi/page/cpdf_streamcontentparser.h" #include "testing/gtest/include/gtest/gtest.h" TEST(cpdf_streamcontentparser, PDF_FindKeyAbbreviation) { + CPDF_StreamContentParser parser(nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, 0); + EXPECT_EQ(CFX_ByteStringC("BitsPerComponent"), - PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("BPC"))); + parser.FindKeyAbbreviationForTesting(CFX_ByteStringC("BPC"))); EXPECT_EQ(CFX_ByteStringC("Width"), - PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("W"))); + parser.FindKeyAbbreviationForTesting(CFX_ByteStringC("W"))); EXPECT_EQ(CFX_ByteStringC(""), - PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC(""))); + parser.FindKeyAbbreviationForTesting(CFX_ByteStringC(""))); EXPECT_EQ(CFX_ByteStringC(""), - PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("NoInList"))); + parser.FindKeyAbbreviationForTesting(CFX_ByteStringC("NoInList"))); // Prefix should not match. EXPECT_EQ(CFX_ByteStringC(""), - PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("WW"))); + parser.FindKeyAbbreviationForTesting(CFX_ByteStringC("WW"))); } TEST(cpdf_streamcontentparser, PDF_FindValueAbbreviation) { + CPDF_StreamContentParser parser(nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, 0); + EXPECT_EQ(CFX_ByteStringC("DeviceGray"), - PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("G"))); + parser.FindValueAbbreviationForTesting(CFX_ByteStringC("G"))); EXPECT_EQ(CFX_ByteStringC("DCTDecode"), - PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("DCT"))); - EXPECT_EQ(CFX_ByteStringC(""), - PDF_FindValueAbbreviationForTesting(CFX_ByteStringC(""))); + parser.FindValueAbbreviationForTesting(CFX_ByteStringC("DCT"))); EXPECT_EQ(CFX_ByteStringC(""), - PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("NoInList"))); + parser.FindValueAbbreviationForTesting(CFX_ByteStringC(""))); + EXPECT_EQ(CFX_ByteStringC(""), parser.FindValueAbbreviationForTesting( + CFX_ByteStringC("NoInList"))); // Prefix should not match. EXPECT_EQ(CFX_ByteStringC(""), - PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("II"))); + parser.FindValueAbbreviationForTesting(CFX_ByteStringC("II"))); } |