Hans Leidekker : webervices/tests: Add tests for out of range string IDs.

Alexandre Julliard julliard at winehq.org
Wed Jan 24 16:02:32 CST 2018


Module: wine
Branch: master
Commit: e3851a87404841b3550e78f1b1bf2f153a1a280b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e3851a87404841b3550e78f1b1bf2f153a1a280b

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Jan 24 14:30:02 2018 +0100

webervices/tests: Add tests for out of range string IDs.

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/webservices/tests/reader.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/dlls/webservices/tests/reader.c b/dlls/webservices/tests/reader.c
index 9879fac..7064cf0 100644
--- a/dlls/webservices/tests/reader.c
+++ b/dlls/webservices/tests/reader.c
@@ -5612,6 +5612,10 @@ static void test_dictionary(void)
         {0x40,0x01,'t',0x0a,0x0a,0x01};
     static const char test8[] =
         {0x40,0x01,'t',0x0b,0x01,'p',0x0a,0x01};
+    static const char test9[] =
+        {0x42,0x0c,0x01};
+    static const char test10[] =
+        {0x42,0x04,0xab,0x0c,0x01};
     const WS_XML_NODE *node;
     const WS_XML_ELEMENT_NODE *elem;
     const WS_XML_ATTRIBUTE *attr;
@@ -5940,6 +5944,23 @@ static void test_dictionary(void)
     ok( hr == S_OK, "got %08x\n", hr );
     ok( node->nodeType == WS_XML_NODE_TYPE_END_ELEMENT, "got %u\n", node->nodeType );
 
+    /* element name string id out of range */
+    hr = set_input_bin( reader, test9, sizeof(test9), &dict );
+    ok( hr == S_OK, "got %08x\n", hr );
+    hr = WsReadNode( reader, NULL );
+    ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr );
+
+    /* text string id out of range */
+    hr = set_input_bin( reader, test10, sizeof(test10), &dict );
+    ok( hr == S_OK, "got %08x\n", hr );
+    hr = WsReadNode( reader, NULL );
+    ok( hr == S_OK, "got %08x\n", hr );
+    hr = WsGetReaderNode( reader, &node, NULL );
+    ok( hr == S_OK, "got %08x\n", hr );
+    ok( node->nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", node->nodeType );
+    hr = WsReadNode( reader, NULL );
+    ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr );
+
     hr = WsGetDictionary( 0, NULL, NULL );
     ok( hr == E_INVALIDARG, "got %08x\n", hr );
 




More information about the wine-cvs mailing list