Lines Matching refs:item

717     unique_ptr<Item> item = details::makeItem(10);  in TEST()  local
719 EXPECT_EQ(UINT, item->type()); in TEST()
720 EXPECT_NE(nullptr, item->asInt()); in TEST()
721 EXPECT_NE(nullptr, item->asUint()); in TEST()
722 EXPECT_EQ(nullptr, item->asNint()); in TEST()
723 EXPECT_EQ(nullptr, item->asTstr()); in TEST()
724 EXPECT_EQ(nullptr, item->asBstr()); in TEST()
725 EXPECT_EQ(nullptr, item->asSimple()); in TEST()
726 EXPECT_EQ(nullptr, item->asMap()); in TEST()
727 EXPECT_EQ(nullptr, item->asArray()); in TEST()
728 EXPECT_EQ(nullptr, item->asViewTstr()); in TEST()
729 EXPECT_EQ(nullptr, item->asViewBstr()); in TEST()
731 EXPECT_EQ(10, item->asInt()->value()); in TEST()
732 EXPECT_EQ(10, item->asUint()->value()); in TEST()
736 unique_ptr<Item> item = details::makeItem(-10); in TEST() local
738 EXPECT_EQ(NINT, item->type()); in TEST()
739 EXPECT_NE(nullptr, item->asInt()); in TEST()
740 EXPECT_EQ(nullptr, item->asUint()); in TEST()
741 EXPECT_NE(nullptr, item->asNint()); in TEST()
742 EXPECT_EQ(nullptr, item->asTstr()); in TEST()
743 EXPECT_EQ(nullptr, item->asBstr()); in TEST()
744 EXPECT_EQ(nullptr, item->asSimple()); in TEST()
745 EXPECT_EQ(nullptr, item->asMap()); in TEST()
746 EXPECT_EQ(nullptr, item->asArray()); in TEST()
747 EXPECT_EQ(nullptr, item->asViewTstr()); in TEST()
748 EXPECT_EQ(nullptr, item->asViewBstr()); in TEST()
750 EXPECT_EQ(-10, item->asInt()->value()); in TEST()
751 EXPECT_EQ(-10, item->asNint()->value()); in TEST()
755 unique_ptr<Item> item = details::makeItem("hello"); in TEST() local
757 EXPECT_EQ(TSTR, item->type()); in TEST()
758 EXPECT_EQ(nullptr, item->asInt()); in TEST()
759 EXPECT_EQ(nullptr, item->asUint()); in TEST()
760 EXPECT_EQ(nullptr, item->asNint()); in TEST()
761 EXPECT_NE(nullptr, item->asTstr()); in TEST()
762 EXPECT_EQ(nullptr, item->asBstr()); in TEST()
763 EXPECT_EQ(nullptr, item->asSimple()); in TEST()
764 EXPECT_EQ(nullptr, item->asMap()); in TEST()
765 EXPECT_EQ(nullptr, item->asArray()); in TEST()
766 EXPECT_EQ(nullptr, item->asViewTstr()); in TEST()
767 EXPECT_EQ(nullptr, item->asViewBstr()); in TEST()
769 EXPECT_EQ("hello"s, item->asTstr()->value()); in TEST()
774 unique_ptr<Item> item = details::makeItem(vec); in TEST() local
776 EXPECT_EQ(BSTR, item->type()); in TEST()
777 EXPECT_EQ(nullptr, item->asInt()); in TEST()
778 EXPECT_EQ(nullptr, item->asUint()); in TEST()
779 EXPECT_EQ(nullptr, item->asNint()); in TEST()
780 EXPECT_EQ(nullptr, item->asTstr()); in TEST()
781 EXPECT_NE(nullptr, item->asBstr()); in TEST()
782 EXPECT_EQ(nullptr, item->asSimple()); in TEST()
783 EXPECT_EQ(nullptr, item->asMap()); in TEST()
784 EXPECT_EQ(nullptr, item->asArray()); in TEST()
785 EXPECT_EQ(nullptr, item->asViewTstr()); in TEST()
786 EXPECT_EQ(nullptr, item->asViewBstr()); in TEST()
788 EXPECT_EQ(vec, item->asBstr()->value()); in TEST()
792 unique_ptr<Item> item = details::makeItem(false); in TEST() local
794 EXPECT_EQ(SIMPLE, item->type()); in TEST()
795 EXPECT_EQ(nullptr, item->asInt()); in TEST()
796 EXPECT_EQ(nullptr, item->asUint()); in TEST()
797 EXPECT_EQ(nullptr, item->asNint()); in TEST()
798 EXPECT_EQ(nullptr, item->asTstr()); in TEST()
799 EXPECT_EQ(nullptr, item->asBstr()); in TEST()
800 EXPECT_NE(nullptr, item->asSimple()); in TEST()
801 EXPECT_EQ(nullptr, item->asMap()); in TEST()
802 EXPECT_EQ(nullptr, item->asArray()); in TEST()
803 EXPECT_EQ(nullptr, item->asViewTstr()); in TEST()
804 EXPECT_EQ(nullptr, item->asViewBstr()); in TEST()
806 EXPECT_EQ(BOOLEAN, item->asSimple()->simpleType()); in TEST()
807 EXPECT_NE(nullptr, item->asSimple()->asBool()); in TEST()
808 EXPECT_EQ(nullptr, item->asSimple()->asNull()); in TEST()
810 EXPECT_FALSE(item->asSimple()->asBool()->value()); in TEST()
814 unique_ptr<Item> item(new Map); in TEST() local
816 EXPECT_EQ(MAP, item->type()); in TEST()
817 EXPECT_EQ(nullptr, item->asInt()); in TEST()
818 EXPECT_EQ(nullptr, item->asUint()); in TEST()
819 EXPECT_EQ(nullptr, item->asNint()); in TEST()
820 EXPECT_EQ(nullptr, item->asTstr()); in TEST()
821 EXPECT_EQ(nullptr, item->asBstr()); in TEST()
822 EXPECT_EQ(nullptr, item->asSimple()); in TEST()
823 EXPECT_NE(nullptr, item->asMap()); in TEST()
824 EXPECT_EQ(nullptr, item->asArray()); in TEST()
825 EXPECT_EQ(nullptr, item->asViewTstr()); in TEST()
826 EXPECT_EQ(nullptr, item->asViewBstr()); in TEST()
828 EXPECT_EQ(0U, item->asMap()->size()); in TEST()
832 unique_ptr<Item> item(new Array); in TEST() local
834 EXPECT_EQ(ARRAY, item->type()); in TEST()
835 EXPECT_EQ(nullptr, item->asInt()); in TEST()
836 EXPECT_EQ(nullptr, item->asUint()); in TEST()
837 EXPECT_EQ(nullptr, item->asNint()); in TEST()
838 EXPECT_EQ(nullptr, item->asTstr()); in TEST()
839 EXPECT_EQ(nullptr, item->asBstr()); in TEST()
840 EXPECT_EQ(nullptr, item->asSimple()); in TEST()
841 EXPECT_EQ(nullptr, item->asMap()); in TEST()
842 EXPECT_NE(nullptr, item->asArray()); in TEST()
843 EXPECT_EQ(nullptr, item->asViewTstr()); in TEST()
844 EXPECT_EQ(nullptr, item->asViewBstr()); in TEST()
846 EXPECT_EQ(0U, item->asArray()->size()); in TEST()
850 unique_ptr<Item> item(new SemanticTag(10, "DSA")); in TEST() local
852 EXPECT_EQ(TSTR, item->type()); in TEST()
853 EXPECT_EQ(nullptr, item->asInt()); in TEST()
854 EXPECT_EQ(nullptr, item->asUint()); in TEST()
855 EXPECT_EQ(nullptr, item->asNint()); in TEST()
856 EXPECT_EQ(nullptr, item->asBstr()); in TEST()
857 EXPECT_EQ(nullptr, item->asSimple()); in TEST()
858 EXPECT_EQ(nullptr, item->asMap()); in TEST()
859 EXPECT_EQ(nullptr, item->asArray()); in TEST()
860 EXPECT_EQ(nullptr, item->asViewTstr()); in TEST()
861 EXPECT_EQ(nullptr, item->asViewBstr()); in TEST()
864 EXPECT_NE(nullptr, item->asTstr()); in TEST()
865 EXPECT_NE(nullptr, item->asSemanticTag()); in TEST()
868 EXPECT_NE(static_cast<Item*>(item->asTstr()), static_cast<Item*>(item->asSemanticTag())); in TEST()
870 EXPECT_EQ(1U, item->asSemanticTag()->size()); in TEST()
871 EXPECT_EQ("DSA", item->asTstr()->value()); in TEST()
873 EXPECT_EQ(1U, item->semanticTagCount()); in TEST()
874 EXPECT_EQ(10U, item->semanticTag()); in TEST()
878 unique_ptr<Item> item(new SemanticTag(40, new SemanticTag(10, "DSA"))); in TEST() local
880 EXPECT_EQ(TSTR, item->type()); in TEST()
881 EXPECT_EQ(nullptr, item->asInt()); in TEST()
882 EXPECT_EQ(nullptr, item->asUint()); in TEST()
883 EXPECT_EQ(nullptr, item->asNint()); in TEST()
884 EXPECT_EQ(nullptr, item->asBstr()); in TEST()
885 EXPECT_EQ(nullptr, item->asSimple()); in TEST()
886 EXPECT_EQ(nullptr, item->asMap()); in TEST()
887 EXPECT_EQ(nullptr, item->asArray()); in TEST()
888 EXPECT_EQ(nullptr, item->asViewTstr()); in TEST()
889 EXPECT_EQ(nullptr, item->asViewBstr()); in TEST()
892 EXPECT_NE(nullptr, item->asTstr()); in TEST()
893 EXPECT_NE(nullptr, item->asSemanticTag()); in TEST()
897 EXPECT_NE(static_cast<Item*>(item->asTstr()), static_cast<Item*>(item->asSemanticTag())); in TEST()
899 EXPECT_EQ(1U, item->asSemanticTag()->size()); in TEST()
900 EXPECT_EQ("DSA", item->asTstr()->value()); in TEST()
902 EXPECT_EQ(2U, item->semanticTagCount()); in TEST()
903 EXPECT_EQ(10U, item->semanticTag(0)); in TEST()
904 EXPECT_EQ(40U, item->semanticTag(1)); in TEST()
908 unique_ptr<Item> item(new Null); in TEST() local
910 EXPECT_EQ(SIMPLE, item->type()); in TEST()
911 EXPECT_EQ(nullptr, item->asInt()); in TEST()
912 EXPECT_EQ(nullptr, item->asUint()); in TEST()
913 EXPECT_EQ(nullptr, item->asNint()); in TEST()
914 EXPECT_EQ(nullptr, item->asTstr()); in TEST()
915 EXPECT_EQ(nullptr, item->asBstr()); in TEST()
916 EXPECT_NE(nullptr, item->asSimple()); in TEST()
917 EXPECT_EQ(nullptr, item->asMap()); in TEST()
918 EXPECT_EQ(nullptr, item->asArray()); in TEST()
919 EXPECT_EQ(nullptr, item->asViewTstr()); in TEST()
920 EXPECT_EQ(nullptr, item->asViewBstr()); in TEST()
922 EXPECT_EQ(NULL_T, item->asSimple()->simpleType()); in TEST()
923 EXPECT_EQ(nullptr, item->asSimple()->asBool()); in TEST()
924 EXPECT_NE(nullptr, item->asSimple()->asNull()); in TEST()
928 unique_ptr<Item> item = details::makeItem(ViewTstr("hello")); in TEST() local
930 EXPECT_EQ(TSTR, item->type()); in TEST()
931 EXPECT_EQ(nullptr, item->asInt()); in TEST()
932 EXPECT_EQ(nullptr, item->asUint()); in TEST()
933 EXPECT_EQ(nullptr, item->asNint()); in TEST()
934 EXPECT_EQ(nullptr, item->asTstr()); in TEST()
935 EXPECT_EQ(nullptr, item->asBstr()); in TEST()
936 EXPECT_EQ(nullptr, item->asSimple()); in TEST()
937 EXPECT_EQ(nullptr, item->asMap()); in TEST()
938 EXPECT_EQ(nullptr, item->asArray()); in TEST()
939 EXPECT_NE(nullptr, item->asViewTstr()); in TEST()
940 EXPECT_EQ(nullptr, item->asViewBstr()); in TEST()
942 EXPECT_EQ("hello"sv, item->asViewTstr()->view()); in TEST()
948 unique_ptr<Item> item = details::makeItem(ViewBstr(sv)); in TEST() local
950 EXPECT_EQ(BSTR, item->type()); in TEST()
951 EXPECT_EQ(nullptr, item->asInt()); in TEST()
952 EXPECT_EQ(nullptr, item->asUint()); in TEST()
953 EXPECT_EQ(nullptr, item->asNint()); in TEST()
954 EXPECT_EQ(nullptr, item->asTstr()); in TEST()
955 EXPECT_EQ(nullptr, item->asBstr()); in TEST()
956 EXPECT_EQ(nullptr, item->asSimple()); in TEST()
957 EXPECT_EQ(nullptr, item->asMap()); in TEST()
958 EXPECT_EQ(nullptr, item->asArray()); in TEST()
959 EXPECT_EQ(nullptr, item->asViewTstr()); in TEST()
960 EXPECT_NE(nullptr, item->asViewBstr()); in TEST()
962 EXPECT_EQ(sv, item->asViewBstr()->view()); in TEST()
966 Uint item(10); in TEST() local
967 auto clone = item.clone(); in TEST()
970 EXPECT_EQ(item, *clone->asUint()); in TEST()
975 Nint item(-1000000); in TEST() local
976 auto clone = item.clone(); in TEST()
979 EXPECT_EQ(item, *clone->asNint()); in TEST()
984 Tstr item("qwertyasdfgh"); in TEST() local
985 auto clone = item.clone(); in TEST()
988 EXPECT_EQ(item, *clone->asTstr()); in TEST()
993 Bstr item(std::vector<uint8_t>{1, 2, 3, 255, 0}); in TEST() local
994 auto clone = item.clone(); in TEST()
997 EXPECT_EQ(item, *clone->asBstr()); in TEST()
1002 Array item(-1000000, 22222222, "item", Map(1, 2, 4, Array(1, "das", true, nullptr)), in TEST() local
1006 auto clone = item.clone(); in TEST()
1009 EXPECT_EQ(item, *clone->asArray()); in TEST()
1014 Map item("key", Array("value1", "value2", 3), 15, Null(), -5, 45), in TEST() local
1016 auto clone = item.clone(); in TEST()
1019 EXPECT_EQ(item, *clone->asMap()); in TEST()
1024 Bool item(true); in TEST() local
1025 auto clone = item.clone(); in TEST()
1030 EXPECT_EQ(item, *clone->asSimple()->asBool()); in TEST()
1035 Null item; in TEST() local
1036 auto clone = item.clone(); in TEST()
1041 EXPECT_EQ(item, *clone->asSimple()->asNull()); in TEST()
1046 SemanticTag item(96, Array(1, 2, 3, "entry", Map("key", "value"))); in TEST() local
1049 auto clone = item.clone(); in TEST()
1052 EXPECT_EQ(item, *clone->asSemanticTag()); in TEST()
1057 SemanticTag item(20, // in TEST() local
1066 auto clone = item.clone(); in TEST()
1069 EXPECT_EQ(item, *clone->asSemanticTag()); in TEST()
1074 ViewTstr item("qwertyasdfgh"); in TEST() local
1075 auto clone = item.clone(); in TEST()
1078 EXPECT_EQ(item, *clone->asViewTstr()); in TEST()
1085 ViewBstr item(sv); in TEST() local
1086 auto clone = item.clone(); in TEST()
1089 EXPECT_EQ(item, *clone->asViewBstr()); in TEST()
1094 SemanticTag item(20, // in TEST() local
1098 EXPECT_EQ(prettyPrint(&item), in TEST()
1270 MOCK_METHOD4(item, ParseClient*(std::unique_ptr<Item>& item, const uint8_t* hdrBegin,
1272 MOCK_METHOD4(itemEnd, ParseClient*(std::unique_ptr<Item>& item, const uint8_t* hdrBegin,
1305 EXPECT_CALL(mpc, item(MatchesItem(val), encBegin, encEnd, encEnd)).WillOnce(Return(&mpc)); in TEST()
1320 EXPECT_CALL(mpc, item(MatchesItem(val), encBegin, encEnd, encEnd)).WillOnce(Return(&mpc)); in TEST()
1336 EXPECT_CALL(mpc, item(MatchesItem(val), encBegin, encEnd, encEnd)).WillOnce(Return(&mpc)); in TEST()
1351 EXPECT_CALL(mpc, item(MatchesItem(val), encBegin, encEnd, encEnd)).WillOnce(Return(&mpc)); in TEST()
1366 EXPECT_CALL(mpc, item(MatchesItem(val), encBegin, encBegin + 1, encEnd)).WillOnce(Return(&mpc)); in TEST()
1381 EXPECT_CALL(mpc, item(MatchesItem(val), encBegin, encBegin + 1, encEnd)).WillOnce(Return(&mpc)); in TEST()
1401 EXPECT_CALL(mpc, item(IsArrayOfSize(val.size()), pos, pos + 1, pos + 1)) in TEST()
1404 EXPECT_CALL(mpc, item(MatchesItem(ByRef(*val[0])), pos, pos + 1, pos + 6)) in TEST()
1407 EXPECT_CALL(mpc, item(MatchesItem(ByRef(*val[1])), pos, pos + 1, pos + 1)) in TEST()
1411 EXPECT_CALL(mpc, item(IsArrayOfSize(interior.size()), pos, pos + 1, pos + 1)) in TEST()
1414 EXPECT_CALL(mpc, item(MatchesItem(ByRef(*interior[0])), pos, pos + 1, pos + 1)) in TEST()
1417 EXPECT_CALL(mpc, item(MatchesItem(ByRef(*interior[1])), pos, pos + 1, pos + 8)) in TEST()
1423 EXPECT_CALL(mpc, item(MatchesItem(ByRef(*val[3])), pos, pos + 9, pos + 9)) in TEST()
1447 EXPECT_CALL(mpc, item(IsSemanticTagOfValue(val.semanticTag()), pos, pos + 1, pos + 1)) in TEST()
1451 EXPECT_CALL(mpc, item(IsArrayOfSize(array.size()), pos, pos + 1, pos + 1)) in TEST()
1454 EXPECT_CALL(mpc, item(MatchesItem(ByRef(*array[0])), pos, pos + 1, pos + 1)) in TEST()
1457 EXPECT_CALL(mpc, item(MatchesItem(ByRef(*array[1])), pos, pos + 1, pos + 3)) in TEST()
1486 EXPECT_CALL(mpc, item(_, pos, pos + 1, pos + 1)).WillOnce(Return(&mpc)); in TEST()
1488 EXPECT_CALL(mpc, item(MatchesItem(ByRef(*val[0].first)), pos, pos + 1, pos + 6)) in TEST()
1491 EXPECT_CALL(mpc, item(MatchesItem(ByRef(*val[0].second)), pos, pos + 1, pos + 1)) in TEST()
1495 EXPECT_CALL(mpc, item(IsArrayOfSize(interior.size()), pos, pos + 1, pos + 1)) in TEST()
1498 EXPECT_CALL(mpc, item(MatchesItem(ByRef(*interior[0])), pos, pos + 1, pos + 1)) in TEST()
1501 EXPECT_CALL(mpc, item(MatchesItem(ByRef(*interior[1])), pos, pos + 1, pos + 8)) in TEST()
1507 EXPECT_CALL(mpc, item(MatchesItem(ByRef(*val[1].second)), pos, pos + 9, pos + 9)) in TEST()
1527 EXPECT_CALL(mpc, item(MatchesItem(val), encBegin, encBegin + 1, encEnd)).WillOnce(Return(&mpc)); in TEST()
1542 EXPECT_CALL(mpc, item(MatchesItem(val), encBegin, encBegin + 1, encEnd)).WillOnce(Return(&mpc)); in TEST()
1552 auto [item, pos, message] = parse(val.encode()); in TEST()
1553 EXPECT_THAT(item, MatchesItem(val)); in TEST()
1559 auto [item, pos, message] = parse(val.encode()); in TEST()
1560 EXPECT_THAT(item, MatchesItem(val)); in TEST()
1566 auto [item, pos, message] = parse(val.encode()); in TEST()
1567 EXPECT_THAT(item, MatchesItem(val)); in TEST()
1571 std::tie(item, pos, message) = parse(minNint); in TEST()
1572 EXPECT_THAT(item, NotNull()); in TEST()
1573 EXPECT_EQ(item->asNint()->value(), std::numeric_limits<int64_t>::min()); in TEST()
1579 auto [item, pos, message] = parse(outOfRangeNint); in TEST()
1580 EXPECT_THAT(item, IsNull()); in TEST()
1588 auto [item, pos, message] = parse(val.encode()); in TEST()
1589 EXPECT_THAT(item, MatchesItem(val)); in TEST()
1595 auto [item, pos, message] = parse(val.encode()); in TEST()
1596 EXPECT_THAT(item, MatchesItem(val)); in TEST()
1603 auto [item, pos, message] = parse(encoded); in TEST()
1604 EXPECT_THAT(item, MatchesItem(ByRef(val))); in TEST()
1609 ASSERT_NE(nullptr, item->asArray()); in TEST()
1610 const Array& arr = *(item->asArray()); in TEST()
1618 auto [item, pos, message] = parse(val.encode()); in TEST()
1619 EXPECT_THAT(item, MatchesItem(ByRef(val))); in TEST()
1625 auto [item, pos, message] = parse(val.encode()); in TEST()
1626 EXPECT_THAT(item, MatchesItem(ByRef(val))); in TEST()
1632 auto [item, pos, message] = parse(val.encode()); in TEST()
1633 EXPECT_THAT(item, MatchesItem(ByRef(val))); in TEST()
1644 std::unique_ptr<Item> item; in TEST() local
1647 std::tie(item, pos, message) = parse(val.encode()); in TEST()
1648 EXPECT_THAT(item, MatchesItem(ByRef(val))); in TEST()
1655 auto [item, pos, message] = parse(encoding.data(), encoding.size() - 1); in TEST()
1656 EXPECT_EQ(nullptr, item.get()); in TEST()
1665 auto [item, pos, message] = parse(encoding.data(), encoding.size() - 2); in TEST()
1666 EXPECT_EQ(nullptr, item.get()); in TEST()
1675 auto [item, pos, message] = parse(encoding.data(), encoding.size() - 1); in TEST()
1676 EXPECT_EQ(nullptr, item.get()); in TEST()
1685 auto [item, pos, message] = parse(encoding.data(), encoding.size() - 1); in TEST()
1686 EXPECT_EQ(nullptr, item.get()); in TEST()
1695 auto [item, pos, message] = parse(encoding.data(), encoding.size() - 2); in TEST()
1696 EXPECT_EQ(nullptr, item.get()); in TEST()
1705 auto [item, pos, message] = parseWithViews(enc.data(), enc.size()); in TEST()
1706 EXPECT_THAT(item, MatchesItem(val)); in TEST()
1713 auto [item, pos, message] = parseWithViews(enc.data(), enc.size()); in TEST()
1714 EXPECT_THAT(item, MatchesItem(val)); in TEST()
1720 auto [item, pos, message] = parse(reservedVal); in TEST()
1721 EXPECT_THAT(item, IsNull()); in TEST()
1730 auto [item, pos, message] = parse(indefiniteArray); in TEST()
1731 EXPECT_THAT(item, IsNull()); in TEST()
1740 auto [item, pos, message] = parse(unassignedSimpleValue); in TEST()
1741 EXPECT_THAT(item, IsNull()); in TEST()
1749 auto [item, pos, message] = parse(floatingPointValue); in TEST()
1750 EXPECT_THAT(item, IsNull()); in TEST()
1758 Map item(1, 2, "key", "value", "item", std::move(compoundItem)); in TEST() local
1759 auto& value1 = item.get(1); in TEST()
1762 auto& value2 = item.get("key"); in TEST()
1765 auto& value3 = item.get("item"); in TEST()
1768 auto& value4 = item.get("wrong"); in TEST()