Add unit tests for PDF_AdobeNameFromUnicode().

Change-Id: Iab899de5559e0227a62188a353c5ebb8e00e9035
Reviewed-on: https://pdfium-review.googlesource.com/c/46810
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/font/BUILD.gn b/core/fpdfapi/font/BUILD.gn
index a6f9705..5a025c1 100644
--- a/core/fpdfapi/font/BUILD.gn
+++ b/core/fpdfapi/font/BUILD.gn
@@ -59,6 +59,7 @@
 pdfium_unittest_source_set("unittests") {
   sources = [
     "cpdf_cmapparser_unittest.cpp",
+    "cpdf_fontencoding_unittest.cpp",
     "cpdf_tounicodemap_unittest.cpp",
   ]
   deps = [
diff --git a/core/fpdfapi/font/cpdf_fontencoding_unittest.cpp b/core/fpdfapi/font/cpdf_fontencoding_unittest.cpp
new file mode 100644
index 0000000..62bb8d4
--- /dev/null
+++ b/core/fpdfapi/font/cpdf_fontencoding_unittest.cpp
@@ -0,0 +1,17 @@
+// Copyright 2018 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/fpdfapi/font/cpdf_fontencoding.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(CPDFFontEncodingTest, PDF_AdobeNameFromUnicode) {
+  EXPECT_STREQ("", PDF_AdobeNameFromUnicode(0x0000).c_str());
+  EXPECT_STREQ("divide", PDF_AdobeNameFromUnicode(0x00f7).c_str());
+  EXPECT_STREQ("Lslash", PDF_AdobeNameFromUnicode(0x0141).c_str());
+  EXPECT_STREQ("tonos", PDF_AdobeNameFromUnicode(0x0384).c_str());
+  EXPECT_STREQ("afii57513", PDF_AdobeNameFromUnicode(0x0691).c_str());
+  EXPECT_STREQ("angkhankhuthai", PDF_AdobeNameFromUnicode(0x0e5a).c_str());
+  EXPECT_STREQ("Euro", PDF_AdobeNameFromUnicode(0x20ac).c_str());
+}