summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_utils_unittest.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-18 16:36:11 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-18 23:53:20 +0000
commit5af27b63bf94e7f60212f6759c8342ce02da5ad2 (patch)
treead5c42c2632b521b98cc7058cd00d345fb2a5756 /xfa/fxfa/parser/xfa_utils_unittest.cpp
parent3420ba852babe24c7b03fede1b3b7c474c148c0d (diff)
downloadpdfium-5af27b63bf94e7f60212f6759c8342ce02da5ad2.tar.xz
Remove hand-written bsearch from XFA_GetAttributeEnumByName()
Change-Id: Ic4bf34dfbdd06971d8935d031bdb7996c78d262f Reviewed-on: https://pdfium-review.googlesource.com/4315 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/xfa_utils_unittest.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_utils_unittest.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/xfa/fxfa/parser/xfa_utils_unittest.cpp b/xfa/fxfa/parser/xfa_utils_unittest.cpp
index 1898a797ec..6a1de85624 100644
--- a/xfa/fxfa/parser/xfa_utils_unittest.cpp
+++ b/xfa/fxfa/parser/xfa_utils_unittest.cpp
@@ -276,9 +276,20 @@ TEST_F(XFANodeIteratorTest, ChildAsRootNext) {
TEST(XFAUtilsTest, GetAttributeByName) {
EXPECT_EQ(nullptr, XFA_GetAttributeByName(L""));
- EXPECT_EQ(nullptr, XFA_GetAttributeByName(L"clams"));
+ EXPECT_EQ(nullptr, XFA_GetAttributeByName(L"nonesuch"));
EXPECT_EQ(XFA_ATTRIBUTE_H, XFA_GetAttributeByName(L"h")->eName);
EXPECT_EQ(XFA_ATTRIBUTE_Short, XFA_GetAttributeByName(L"short")->eName);
EXPECT_EQ(XFA_ATTRIBUTE_DecipherOnly,
XFA_GetAttributeByName(L"decipherOnly")->eName);
}
+
+TEST(XFAUtilsTest, GetAttributeEnumByName) {
+ EXPECT_EQ(nullptr, XFA_GetAttributeEnumByName(L""));
+ EXPECT_EQ(nullptr, XFA_GetAttributeEnumByName(L"nonesuch"));
+ EXPECT_EQ(XFA_ATTRIBUTEENUM_Asterisk,
+ XFA_GetAttributeEnumByName(L"*")->eName);
+ EXPECT_EQ(XFA_ATTRIBUTEENUM_Visible,
+ XFA_GetAttributeEnumByName(L"visible")->eName);
+ EXPECT_EQ(XFA_ATTRIBUTEENUM_Lowered,
+ XFA_GetAttributeEnumByName(L"lowered")->eName);
+}