From dea016dbe8c7f03f860e889e95f9b14c6af466e8 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Wed, 17 Oct 2018 13:42:37 +0200 Subject: [PATCH] webservices: Add more tests for default envelope and adressing versions. Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/webservices/tests/msg.c | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/dlls/webservices/tests/msg.c b/dlls/webservices/tests/msg.c index 22d69ece2c2..766c2c5acfc 100644 --- a/dlls/webservices/tests/msg.c +++ b/dlls/webservices/tests/msg.c @@ -104,6 +104,7 @@ static void test_WsCreateMessageForChannel(void) hr = WsCreateMessageForChannel( NULL, NULL, 0, &msg, NULL ); ok( hr == E_INVALIDARG, "got %08x\n", hr ); + /* HTTP */ hr = WsCreateChannel( WS_CHANNEL_TYPE_REQUEST, WS_HTTP_CHANNEL_BINDING, NULL, 0, NULL, &channel, NULL ); ok( hr == S_OK, "got %08x\n", hr ); @@ -154,6 +155,52 @@ static void test_WsCreateMessageForChannel(void) WsFreeChannel( channel ); WsFreeMessage( msg ); + + /* TCP */ + hr = WsCreateChannel( WS_CHANNEL_TYPE_DUPLEX_SESSION, WS_TCP_CHANNEL_BINDING, NULL, 0, NULL, + &channel, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsCreateMessageForChannel( channel, NULL, 0, &msg, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + env_version = 0xdeadbeef; + hr = WsGetMessageProperty( msg, WS_MESSAGE_PROPERTY_ENVELOPE_VERSION, &env_version, + sizeof(env_version), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( env_version == WS_ENVELOPE_VERSION_SOAP_1_2, "got %u\n", env_version ); + + addr_version = 0xdeadbeef; + hr = WsGetMessageProperty( msg, WS_MESSAGE_PROPERTY_ADDRESSING_VERSION, &addr_version, + sizeof(addr_version), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( addr_version == WS_ADDRESSING_VERSION_1_0, "got %u\n", addr_version ); + + WsFreeChannel( channel ); + WsFreeMessage( msg ); + + /* UDP */ + hr = WsCreateChannel( WS_CHANNEL_TYPE_DUPLEX, WS_UDP_CHANNEL_BINDING, NULL, 0, NULL, + &channel, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsCreateMessageForChannel( channel, NULL, 0, &msg, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + env_version = 0xdeadbeef; + hr = WsGetMessageProperty( msg, WS_MESSAGE_PROPERTY_ENVELOPE_VERSION, &env_version, + sizeof(env_version), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( env_version == WS_ENVELOPE_VERSION_SOAP_1_2, "got %u\n", env_version ); + + addr_version = 0xdeadbeef; + hr = WsGetMessageProperty( msg, WS_MESSAGE_PROPERTY_ADDRESSING_VERSION, &addr_version, + sizeof(addr_version), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( addr_version == WS_ADDRESSING_VERSION_1_0, "got %u\n", addr_version ); + + WsFreeChannel( channel ); + WsFreeMessage( msg ); } static void test_WsInitializeMessage(void)