Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
test_support.h
Go to the documentation of this file.
1
// Copyright 2015 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
#
ifndef
TESTING_TEST_SUPPORT_H_
6
#
define
TESTING_TEST_SUPPORT_H_
7
8
#
include
<
stdint
.
h
>
9
10
#
include
"core/fxcrt/compiler_specific.h"
11
#
include
"core/fxcrt/span.h"
12
13
namespace
pdfium
{
14
15
#
define
STR_IN_TEST_CASE
(
input_literal
,
...
)
16
{
17
reinterpret_cast
<
const
uint8_t
*
>
(
input_literal
)
,
18
sizeof
(
input_literal
)
-
1
,
__VA_ARGS__
19
}
20
21
#
define
STR_IN_OUT_CASE
(
input_literal
,
expected_literal
,
...
)
22
{
23
reinterpret_cast
<
const
uint8_t
*
>
(
input_literal
)
,
24
sizeof
(
input_literal
)
-
1
,
25
reinterpret_cast
<
const
uint8_t
*
>
(
expected_literal
)
,
26
sizeof
(
expected_literal
)
-
1
,
__VA_ARGS__
27
}
28
29
struct
StrFuncTestData
{
30
pdfium
::
span
<
const
uint8_t
>
input_span
()
const
{
31
// SAFETY: size determined from literal via macro above.
32
return
UNSAFE_BUFFERS
(
pdfium
::make_span(
input
,
input_size
));
33
}
34
pdfium
::
span
<
const
uint8_t
>
expected_span
()
const
{
35
// SAFETY: size determined from literal via macro above.
36
return
UNSAFE_BUFFERS
(
pdfium
::make_span(
expected
,
expected_size
));
37
}
38
39
const
uint8_t*
input
;
40
uint32_t
input_size
;
41
const
uint8_t*
expected
;
42
uint32_t
expected_size
;
43
};
44
45
struct
DecodeTestData
{
46
pdfium
::
span
<
const
uint8_t
>
input_span
()
const
{
47
// SAFETY: size determined from literal via macro above.
48
return
UNSAFE_BUFFERS
(
pdfium
::make_span(
input
,
input_size
));
49
}
50
pdfium
::
span
<
const
uint8_t
>
expected_span
()
const
{
51
// SAFETY: size determined from literal via macro above.
52
return
UNSAFE_BUFFERS
(
pdfium
::make_span(
expected
,
expected_size
));
53
}
54
55
const
uint8_t*
input
;
56
uint32_t
input_size
;
57
const
uint8_t*
expected
;
58
uint32_t
expected_size
;
59
// The size of input string being processed.
60
uint32_t
processed_size
;
61
};
62
63
struct
NullTermWstrFuncTestData
{
64
const
wchar_t
*
input
;
65
const
wchar_t
*
expected
;
66
};
67
68
}
// namespace pdfium
69
70
#
endif
// TESTING_TEST_SUPPORT_H_
CPDF_SimpleParser
Definition
cpdf_simple_parser.h:17
CPDF_SimpleParser::GetWord
ByteStringView GetWord()
Definition
cpdf_simple_parser.cpp:21
pdfium::CFDETextOutLargeBitmapTest
Definition
cfde_textout_unittest.cpp:117
UNSAFE_BUFFERS
#define UNSAFE_BUFFERS(...)
Definition
compiler_specific.h:95
TEST
TEST(FXCRYPT, MD5GenerateEmtpyData)
Definition
fx_crypt_unittest.cpp:50
ByteStringView
fxcrt::ByteStringView ByteStringView
Definition
string_view_template.h:325
pdfium::DecodeTestData
Definition
test_support.h:45
pdfium::DecodeTestData::input_size
uint32_t input_size
Definition
test_support.h:56
pdfium::DecodeTestData::expected_span
pdfium::span< const uint8_t > expected_span() const
Definition
test_support.h:50
pdfium::DecodeTestData::input
const uint8_t * input
Definition
test_support.h:55
pdfium::DecodeTestData::processed_size
uint32_t processed_size
Definition
test_support.h:60
pdfium::DecodeTestData::input_span
pdfium::span< const uint8_t > input_span() const
Definition
test_support.h:46
pdfium::DecodeTestData::expected_size
uint32_t expected_size
Definition
test_support.h:58
pdfium::DecodeTestData::expected
const uint8_t * expected
Definition
test_support.h:57
pdfium::NullTermWstrFuncTestData
Definition
test_support.h:63
pdfium::NullTermWstrFuncTestData::input
const wchar_t * input
Definition
test_support.h:64
pdfium::NullTermWstrFuncTestData::expected
const wchar_t * expected
Definition
test_support.h:65
pdfium::StrFuncTestData
Definition
test_support.h:29
pdfium::StrFuncTestData::input_size
uint32_t input_size
Definition
test_support.h:40
pdfium::StrFuncTestData::input_span
pdfium::span< const uint8_t > input_span() const
Definition
test_support.h:30
pdfium::StrFuncTestData::expected_span
pdfium::span< const uint8_t > expected_span() const
Definition
test_support.h:34
pdfium::StrFuncTestData::expected_size
uint32_t expected_size
Definition
test_support.h:42
pdfium::StrFuncTestData::expected
const uint8_t * expected
Definition
test_support.h:41
pdfium::StrFuncTestData::input
const uint8_t * input
Definition
test_support.h:39
STR_IN_OUT_CASE
#define STR_IN_OUT_CASE(input_literal, expected_literal,...)
Definition
test_support.h:21
qtwebengine
src
3rdparty
chromium
third_party
pdfium
testing
test_support.h
Generated on
for Qt by
1.18.0