Owen Rudge : wsdapi/tests: Add tests for Get/SetMessageType.
Alexandre Julliard
julliard at winehq.org
Mon Jun 5 16:56:30 CDT 2017
Module: wine
Branch: master
Commit: 529688312128647dd372f1cefe4645e6c9e819d9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=529688312128647dd372f1cefe4645e6c9e819d9
Author: Owen Rudge <orudge at codeweavers.com>
Date: Sat Jun 3 10:34:49 2017 +0100
wsdapi/tests: Add tests for Get/SetMessageType.
Signed-off-by: Owen Rudge <orudge at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wsdapi/tests/address.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/dlls/wsdapi/tests/address.c b/dlls/wsdapi/tests/address.c
index 74a1c12..c3112f4 100644
--- a/dlls/wsdapi/tests/address.c
+++ b/dlls/wsdapi/tests/address.c
@@ -180,6 +180,47 @@ static void GetSetPort_udp_tests(void)
ok(ret == 0, "IWSDUdpAddress_Release() has %d references, should have 0\n", ret);
}
+static void GetSetMessageType_udp_tests(void)
+{
+ WSDUdpMessageType expectedMessageType1 = TWO_WAY;
+ WSDUdpMessageType expectedMessageType2 = ONE_WAY;
+ WSDUdpMessageType actualMessageType = 0;
+ IWSDUdpAddress *udpAddress = NULL;
+ HRESULT rc;
+ int ret;
+
+ rc = WSDCreateUdpAddress(&udpAddress);
+ ok(rc == S_OK, "WSDCreateUdpAddress(NULL, &udpAddress) failed: %08x\n", rc);
+ ok(udpAddress != NULL, "WSDCreateUdpAddress(NULL, &udpAddress) failed: udpAddress == NULL\n");
+
+ rc = IWSDUdpAddress_GetMessageType(udpAddress, NULL);
+ todo_wine ok(rc == E_POINTER, "GetMessageType returned unexpected result: %08x\n", rc);
+
+ rc = IWSDUdpAddress_GetMessageType(udpAddress, &actualMessageType);
+ todo_wine ok(rc == S_OK, "GetMessageType returned unexpected result: %08x\n", rc);
+ ok(actualMessageType == 0, "GetMessageType returned unexpected message type: %d\n", actualMessageType);
+
+ /* Try setting a message type */
+ rc = IWSDUdpAddress_SetMessageType(udpAddress, expectedMessageType1);
+ todo_wine ok(rc == S_OK, "SetMessageType returned unexpected result: %08x\n", rc);
+
+ rc = IWSDUdpAddress_GetMessageType(udpAddress, &actualMessageType);
+ todo_wine ok(rc == S_OK, "GetMessageType returned unexpected result: %08x\n", rc);
+ todo_wine ok(actualMessageType == expectedMessageType1, "GetMessageType returned unexpected message type: %d\n", actualMessageType);
+
+ /* Set another one */
+ rc = IWSDUdpAddress_SetMessageType(udpAddress, expectedMessageType2);
+ todo_wine ok(rc == S_OK, "SetMessageType returned unexpected result: %08x\n", rc);
+
+ rc = IWSDUdpAddress_GetMessageType(udpAddress, &actualMessageType);
+ todo_wine ok(rc == S_OK, "GetMessageType returned unexpected result: %08x\n", rc);
+ ok(actualMessageType == expectedMessageType2, "GetMessageType returned unexpected message type: %d\n", actualMessageType);
+
+ /* Release the object */
+ ret = IWSDUdpAddress_Release(udpAddress);
+ ok(ret == 0, "IWSDUdpAddress_Release() has %d references, should have 0\n", ret);
+}
+
START_TEST(address)
{
CoInitialize(NULL);
@@ -187,6 +228,7 @@ START_TEST(address)
CreateUdpAddress_tests();
GetSetTransportAddress_udp_tests();
GetSetPort_udp_tests();
+ GetSetMessageType_udp_tests();
CoUninitialize();
}
More information about the wine-cvs
mailing list