1 // Copyright 2019 PDFium Authors. All rights reserved.
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/fxge/cfx_fontmapper.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 // Deliberately give this global variable external linkage.
10 char g_maybe_changes = '\xff';
11
TEST(CFX_FontMapper,MakeTag)12 TEST(CFX_FontMapper, MakeTag) {
13 EXPECT_EQ(0x61626364u, CFX_FontMapper::MakeTag('a', 'b', 'c', 'd'));
14 EXPECT_EQ(0x00000000u, CFX_FontMapper::MakeTag('\0', '\0', '\0', '\0'));
15 EXPECT_EQ(0xfffe0a08u, CFX_FontMapper::MakeTag('\xff', '\xfe', '\n', '\b'));
16 EXPECT_EQ(0xffffffffu,
17 CFX_FontMapper::MakeTag('\xff', '\xff', '\xff', '\xff'));
18 EXPECT_EQ(0xffffffffu,
19 CFX_FontMapper::MakeTag(g_maybe_changes, '\xff', '\xff', '\xff'));
20 }
21