• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2022 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/fxcrt/css/cfx_cssdata.h"
6 
7 #include "core/fxcrt/bytestring.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 
TEST(CSSDataTest,PropertyHashes)10 TEST(CSSDataTest, PropertyHashes) {
11   uint32_t max_hash = 0;
12 #undef CSS_PROP____
13 #define CSS_PROP____(a, b, c, d)                                       \
14   {                                                                    \
15     EXPECT_EQ(FX_HashCode_GetAsIfW(b), static_cast<uint32_t>(c)) << b; \
16     EXPECT_GT(static_cast<uint32_t>(c), max_hash) << b;                \
17     max_hash = c;                                                      \
18   }
19 #include "core/fxcrt/css/properties.inc"
20 #undef CSS_PROP____
21 }
22 
TEST(CSSDataTest,PropertyValueHashes)23 TEST(CSSDataTest, PropertyValueHashes) {
24   uint32_t max_hash = 0;
25 #undef CSS_PROP_VALUE____
26 #define CSS_PROP_VALUE____(a, b, c)                                    \
27   {                                                                    \
28     EXPECT_EQ(FX_HashCode_GetAsIfW(b), static_cast<uint32_t>(c)) << b; \
29     EXPECT_GT(static_cast<uint32_t>(c), max_hash) << b;                \
30     max_hash = c;                                                      \
31   }
32 #include "core/fxcrt/css/property_values.inc"
33 #undef CSS_PROP_VALUE____
34 }
35