Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdf_function_unittest.cpp
Go to the documentation of this file.
1
// Copyright 2020 The PDFium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#
include
"core/fpdfapi/page/cpdf_function.h"
6
7
#
include
"core/fpdfapi/parser/cpdf_array.h"
8
#
include
"core/fpdfapi/parser/cpdf_dictionary.h"
9
#
include
"core/fpdfapi/parser/cpdf_number.h"
10
#
include
"core/fxcrt/retain_ptr.h"
11
#
include
"testing/gtest/include/gtest/gtest.h"
12
13
TEST
(
CPDFFunction
,
BadFunctionType
) {
14
auto
pDict =
pdfium
::MakeRetain<
CPDF_Dictionary
>();
15
pDict->SetNewFor<CPDF_Number>(
"FunctionType"
, -2);
16
EXPECT_FALSE(CPDF_Function::Load(pDict));
17
18
pDict->SetNewFor<CPDF_Number>(
"FunctionType"
, 5);
19
EXPECT_FALSE(CPDF_Function::Load(pDict));
20
}
21
22
TEST
(
CPDFFunction
,
NoDomain
) {
23
auto
pDict =
pdfium
::MakeRetain<
CPDF_Dictionary
>();
24
pDict->SetNewFor<CPDF_Number>(
"FunctionType"
, 0);
25
EXPECT_FALSE(CPDF_Function::Load(pDict));
26
}
27
28
TEST
(
CPDFFunction
,
EmptyDomain
) {
29
auto
pDict =
pdfium
::MakeRetain<
CPDF_Dictionary
>();
30
pDict->SetNewFor<CPDF_Number>(
"FunctionType"
, 0);
31
pDict->SetNewFor<
CPDF_Array
>(
"Domain"
);
32
EXPECT_FALSE(CPDF_Function::Load(pDict));
33
}
34
35
TEST
(
CPDFFunction
,
NoRange
) {
36
auto
pDict =
pdfium
::MakeRetain<
CPDF_Dictionary
>();
37
pDict->SetNewFor<CPDF_Number>(
"FunctionType"
, 0);
38
39
auto
pArray = pDict->SetNewFor<
CPDF_Array
>(
"Domain"
);
40
pArray->AppendNew<CPDF_Number>(0);
41
pArray->AppendNew<CPDF_Number>(10);
42
EXPECT_FALSE(CPDF_Function::Load(pDict));
43
}
CPDF_Array::const_iterator
std::vector< RetainPtr< CPDF_Object > >::const_iterator const_iterator
Definition
cpdf_array.h:29
CPDF_Dictionary::DictMap
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
Definition
cpdf_dictionary.h:31
pdfium::CFDETextOutLargeBitmapTest
Definition
cfde_textout_unittest.cpp:117
TEST
TEST(FXCRYPT, MD5GenerateEmtpyData)
Definition
fx_crypt_unittest.cpp:50
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fpdfapi
page
cpdf_function_unittest.cpp
Generated on
for Qt by
1.14.0