| 92 | } |
| 93 | |
| 94 | void XmlRpcRequestParserControllerTest::testPopArrayFrame_compound() |
| 95 | { |
| 96 | XmlRpcRequestParserController controller; |
| 97 | |
| 98 | // We are making following structs. [] = array, {key:value .. } = dict |
| 99 | |
| 100 | // [ { "uris":["http://example.org/aria2","http://aria2.sf.net/"], |
| 101 | // "options":{ "timeout":120 } }, |
| 102 | // [ "jp","us" ] ] |
| 103 | |
| 104 | controller.setCurrentFrameValue(List::g()); |
| 105 | controller.pushFrame(); |
| 106 | |
| 107 | controller.setCurrentFrameValue(Dict::g()); |
| 108 | controller.pushFrame(); |
| 109 | |
| 110 | controller.setCurrentFrameName("uris"); |
| 111 | controller.setCurrentFrameValue(List::g()); |
| 112 | controller.pushFrame(); |
| 113 | |
| 114 | controller.setCurrentFrameValue(String::g("http://example.org/aria2")); |
| 115 | controller.popArrayFrame(); |
| 116 | controller.pushFrame(); |
| 117 | |
| 118 | controller.setCurrentFrameValue(String::g("http://aria2.sf.net/")); |
| 119 | controller.popArrayFrame(); |
| 120 | |
| 121 | controller.popStructFrame(); |
| 122 | controller.pushFrame(); |
| 123 | |
| 124 | controller.setCurrentFrameName("options"); |
| 125 | controller.setCurrentFrameValue(Dict::g()); |
| 126 | controller.pushFrame(); |
| 127 | |
| 128 | controller.setCurrentFrameName("timeout"); |
| 129 | controller.setCurrentFrameValue(Integer::g(120)); |
| 130 | controller.popStructFrame(); |
| 131 | |
| 132 | controller.popStructFrame(); |
| 133 | |
| 134 | controller.popArrayFrame(); |
| 135 | controller.pushFrame(); |
| 136 | |
| 137 | controller.setCurrentFrameValue(List::g()); |
| 138 | controller.pushFrame(); |
| 139 | |
| 140 | controller.setCurrentFrameValue(String::g("jp")); |
| 141 | controller.popArrayFrame(); |
| 142 | controller.pushFrame(); |
| 143 | |
| 144 | controller.setCurrentFrameValue(String::g("us")); |
| 145 | controller.popArrayFrame(); |
| 146 | |
| 147 | controller.popArrayFrame(); |
| 148 | |
| 149 | const List* result = downcast<List>(controller.getCurrentFrameValue()); |
| 150 | const Dict* dict = downcast<Dict>(result->get(0)); |
| 151 | const List* uris = downcast<List>(dict->get("uris")); |
nothing calls this directly
no test coverage detected