10 absl::optional<XFA_PACKETINFO> result = XFA_GetPacketByName(L"");
11 EXPECT_FALSE(result.has_value());
13 result = XFA_GetPacketByName(L"nonesuch");
14 EXPECT_FALSE(result.has_value());
16 result = XFA_GetPacketByName(L"datasets");
17 ASSERT_TRUE(result.has_value());
18 EXPECT_EQ(XFA_PacketType::Datasets, result.value().packet_type);
20 result = XFA_GetPacketByName(L"sourceSet");
21 ASSERT_TRUE(result.has_value());
22 EXPECT_EQ(XFA_PacketType::SourceSet, result.value().packet_type);
52 absl::optional<XFA_ATTRIBUTEINFO> result = XFA_GetAttributeByName(L"");
53 EXPECT_FALSE(result.has_value());
55 result = XFA_GetAttributeByName(L"nonesuch");
56 EXPECT_FALSE(result.has_value());
58 result = XFA_GetAttributeByName(L"h");
59 ASSERT_TRUE(result.has_value());
60 EXPECT_EQ(XFA_Attribute::H, result.value().attribute);
62 result = XFA_GetAttributeByName(L"short");
63 ASSERT_TRUE(result.has_value());
64 EXPECT_EQ(XFA_Attribute::Short, result.value().attribute);
66 result = XFA_GetAttributeByName(L"decipherOnly");
67 ASSERT_TRUE(result.has_value());
68 EXPECT_EQ(XFA_Attribute::DecipherOnly, result.value().attribute);
77 absl::optional<XFA_AttributeValue> result = XFA_GetAttributeValueByName(L"");
78 EXPECT_FALSE(result.has_value());
80 result = XFA_GetAttributeValueByName(L"nonesuch");
81 EXPECT_FALSE(result.has_value());
83 result = XFA_GetAttributeValueByName(L"*");
84 ASSERT_TRUE(result.has_value());
85 EXPECT_EQ(XFA_AttributeValue::Asterisk, result.value());
87 result = XFA_GetAttributeValueByName(L"visible");
88 ASSERT_TRUE(result.has_value());
89 EXPECT_EQ(XFA_AttributeValue::Visible, result.value());
91 result = XFA_GetAttributeValueByName(L"lowered");
92 ASSERT_TRUE(result.has_value());
93 EXPECT_EQ(XFA_AttributeValue::Lowered, result.value());