| 778 | } |
| 779 | |
| 780 | void container() { |
| 781 | constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n" |
| 782 | "<def>\n" |
| 783 | " <container id=\"A\" startPattern=\"std :: A <\" endPattern=\"> !!::\" itEndPattern=\"> :: iterator\">\n" |
| 784 | " <type templateParameter=\"1\"/>\n" |
| 785 | " <size templateParameter=\"4\">\n" |
| 786 | " <function name=\"resize\" action=\"resize\"/>\n" |
| 787 | " <function name=\"clear\" action=\"clear\"/>\n" |
| 788 | " <function name=\"size\" yields=\"size\"/>\n" |
| 789 | " <function name=\"empty\" yields=\"empty\"/>\n" |
| 790 | " <function name=\"push_back\" action=\"push\"/>\n" |
| 791 | " <function name=\"pop_back\" action=\"pop\"/>\n" |
| 792 | " </size>\n" |
| 793 | " <access>\n" |
| 794 | " <function name=\"at\" yields=\"at_index\"/>\n" |
| 795 | " <function name=\"begin\" yields=\"start-iterator\"/>\n" |
| 796 | " <function name=\"end\" yields=\"end-iterator\"/>\n" |
| 797 | " <function name=\"data\" yields=\"buffer\"/>\n" |
| 798 | " <function name=\"c_str\" yields=\"buffer-nt\"/>\n" |
| 799 | " <function name=\"front\" yields=\"item\"/>\n" |
| 800 | " <function name=\"find\" action=\"find\"/>\n" |
| 801 | " <function name=\"cfind\" action=\"find-const\"/>\n" |
| 802 | " </access>\n" |
| 803 | " </container>\n" |
| 804 | " <container id=\"B\" startPattern=\"std :: B <\" inherits=\"A\" opLessAllowed=\"false\">\n" |
| 805 | " <size templateParameter=\"3\"/>\n" // Inherits all but templateParameter |
| 806 | " </container>\n" |
| 807 | " <container id=\"C\">\n" |
| 808 | " <type string=\"std-like\"/>\n" |
| 809 | " <access indexOperator=\"array-like\"/>\n" |
| 810 | " </container>\n" |
| 811 | " <container id=\"E\" startPattern=\"std :: E\"/>\n" |
| 812 | " <container id=\"F\" startPattern=\"std :: F\" itEndPattern=\":: iterator\"/>\n" |
| 813 | "</def>"; |
| 814 | |
| 815 | Library library; |
| 816 | ASSERT(LibraryHelper::loadxmldata(library, xmldata, sizeof(xmldata))); |
| 817 | |
| 818 | const Library::Container& A = library.containers().at("A"); |
| 819 | const Library::Container& B = library.containers().at("B"); |
| 820 | const Library::Container& C = library.containers().at("C"); |
| 821 | const Library::Container& E = library.containers().at("E"); |
| 822 | const Library::Container& F = library.containers().at("F"); |
| 823 | |
| 824 | ASSERT_EQUALS(A.type_templateArgNo, 1); |
| 825 | ASSERT_EQUALS(A.size_templateArgNo, 4); |
| 826 | ASSERT_EQUALS(A.startPattern, "std :: A <"); |
| 827 | ASSERT_EQUALS(A.endPattern, "> !!::"); |
| 828 | ASSERT_EQUALS(A.itEndPattern, "> :: iterator"); |
| 829 | ASSERT_EQUALS(A.stdStringLike, false); |
| 830 | ASSERT_EQUALS(A.arrayLike_indexOp, false); |
| 831 | ASSERT_EQUALS(A.opLessAllowed, true); |
| 832 | ASSERT_EQ(Library::Container::Yield::SIZE, A.getYield("size")); |
| 833 | ASSERT_EQ(Library::Container::Yield::EMPTY, A.getYield("empty")); |
| 834 | ASSERT_EQ(Library::Container::Yield::AT_INDEX, A.getYield("at")); |
| 835 | ASSERT_EQ(Library::Container::Yield::START_ITERATOR, A.getYield("begin")); |
| 836 | ASSERT_EQ(Library::Container::Yield::END_ITERATOR, A.getYield("end")); |
| 837 | ASSERT_EQ(Library::Container::Yield::BUFFER, A.getYield("data")); |
nothing calls this directly
no test coverage detected