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
fxfa_basic_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 "xfa/fxfa/fxfa_basic.h"
6
7#include "core/fxcrt/bytestring.h"
8#include "testing/gtest/include/gtest/gtest.h"
9
10namespace {
11
12void HashTestCase(uint32_t hash, const char* str, uint32_t* so_far) {
13 if (hash != 0xffffffffu) {
14 EXPECT_EQ(hash, FX_HashCode_GetAsIfW(str)) << str;
15 EXPECT_LT(*so_far, hash) << hash;
16 } else {
17 EXPECT_NE(hash, FX_HashCode_GetAsIfW(str)) << str;
18 }
19 *so_far = hash;
20}
21
22} // namespace
23
25 uint32_t so_far = 0;
26#undef PCKT____
27#define PCKT____(a, b, c, d, e, f) HashTestCase(a, b, &so_far);
28#include "xfa/fxfa/parser/packets.inc"
29#undef PCKT____
30}
31
33 uint32_t so_far = 0;
34#undef ATTR____
35#define ATTR____(a, b, c, d) HashTestCase(a, b, &so_far);
36#include "xfa/fxfa/parser/attributes.inc"
37#undef ATTR____
38}
39
41 uint32_t so_far = 0;
42#undef VALUE____
43#define VALUE____(a, b, c) HashTestCase(a, b, &so_far);
44#include "xfa/fxfa/parser/attribute_values.inc"
45#undef VALUE____
46}
47
49 uint32_t so_far = 0;
50#undef ELEM____
51#define ELEM____(a, b, c, d) HashTestCase(a, b, &so_far);
52#include "xfa/fxfa/parser/elements.inc"
53#undef ELEM____
54}
TEST(FXCRYPT, MD5GenerateEmtpyData)