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
fpdf_edit_unittest.cpp
Go to the documentation of this file.
1// Copyright 2018 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 "public/fpdf_edit.h"
6
7#include "core/fpdfapi/page/test_with_page_module.h"
8#include "testing/gtest/include/gtest/gtest.h"
9
10using PDFEditTest = TestWithPageModule;
11
12TEST_F(PDFEditTest, LineJoin) {
13 EXPECT_FALSE(FPDFPageObj_SetLineJoin(nullptr, -1));
17 EXPECT_FALSE(FPDFPageObj_SetLineJoin(nullptr, 3));
18 EXPECT_FALSE(FPDFPageObj_SetLineJoin(nullptr, 1000));
19
20 FPDF_PAGEOBJECT path = FPDFPageObj_CreateNewPath(0, 0);
22
23 EXPECT_FALSE(FPDFPageObj_SetLineJoin(path, -1));
24 EXPECT_FALSE(FPDFPageObj_SetLineJoin(path, 3));
25 EXPECT_FALSE(FPDFPageObj_SetLineJoin(path, 1000));
26
29
32
35
37}
38
39TEST_F(PDFEditTest, LineCap) {
40 EXPECT_FALSE(FPDFPageObj_SetLineCap(nullptr, -1));
44 EXPECT_FALSE(FPDFPageObj_SetLineCap(nullptr, 3));
45 EXPECT_FALSE(FPDFPageObj_SetLineCap(nullptr, 1000));
46
47 FPDF_PAGEOBJECT path = FPDFPageObj_CreateNewPath(0, 0);
49
50 EXPECT_FALSE(FPDFPageObj_SetLineCap(path, -1));
51 EXPECT_FALSE(FPDFPageObj_SetLineCap(path, 3));
52 EXPECT_FALSE(FPDFPageObj_SetLineCap(path, 1000));
53
56
59
62
64}
TEST_F(CPDF_CIDFontTest, BUG_920636)
#define FPDF_LINECAP_BUTT
Definition fpdf_edit.h:58
FPDF_EXPORT int FPDF_CALLCONV FPDFPageObj_GetLineCap(FPDF_PAGEOBJECT page_object)
FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateNewPath(float x, float y)
#define FPDF_LINEJOIN_MITER
Definition fpdf_edit.h:62
#define FPDF_LINEJOIN_ROUND
Definition fpdf_edit.h:63
#define FPDF_LINECAP_PROJECTING_SQUARE
Definition fpdf_edit.h:60
#define FPDF_LINECAP_ROUND
Definition fpdf_edit.h:59
FPDF_EXPORT int FPDF_CALLCONV FPDFPageObj_GetLineJoin(FPDF_PAGEOBJECT page_object)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPageObj_SetLineJoin(FPDF_PAGEOBJECT page_object, int line_join)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPageObj_SetLineCap(FPDF_PAGEOBJECT page_object, int line_cap)
#define FPDF_LINEJOIN_BEVEL
Definition fpdf_edit.h:64
FPDF_EXPORT void FPDF_CALLCONV FPDFPageObj_Destroy(FPDF_PAGEOBJECT page_object)