This makes the tests more clear and harder to mess up.
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/webservices/listener.c | 3 ++- include/webservices.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/webservices/listener.c b/dlls/webservices/listener.c index 6b9dca05486..3112d5d84fd 100644 --- a/dlls/webservices/listener.c +++ b/dlls/webservices/listener.c @@ -448,7 +448,8 @@ static HRESULT open_listener( struct listener *listener, const WS_STRING *url ) /************************************************************************** * WsOpenListener [webservices.@] */ -HRESULT WINAPI WsOpenListener( WS_LISTENER *handle, WS_STRING *url, const WS_ASYNC_CONTEXT *ctx, WS_ERROR *error ) +HRESULT WINAPI WsOpenListener( WS_LISTENER *handle, const WS_STRING *url, const WS_ASYNC_CONTEXT *ctx, + WS_ERROR *error ) { struct listener *listener = (struct listener *)handle; HRESULT hr; diff --git a/include/webservices.h b/include/webservices.h index bda09e06bc8..542670967c0 100644 --- a/include/webservices.h +++ b/include/webservices.h @@ -1726,7 +1726,7 @@ HRESULT WINAPI WsInitializeMessage(WS_MESSAGE*, WS_MESSAGE_INITIALIZATION, WS_ME HRESULT WINAPI WsMoveReader(WS_XML_READER*, WS_MOVE_TO, BOOL*, WS_ERROR*); HRESULT WINAPI WsMoveWriter(WS_XML_WRITER*, WS_MOVE_TO, BOOL*, WS_ERROR*); HRESULT WINAPI WsOpenChannel(WS_CHANNEL*, const WS_ENDPOINT_ADDRESS*, const WS_ASYNC_CONTEXT*, WS_ERROR*); -HRESULT WINAPI WsOpenListener(WS_LISTENER*, WS_STRING*, const WS_ASYNC_CONTEXT*, WS_ERROR*); +HRESULT WINAPI WsOpenListener(WS_LISTENER*, const WS_STRING*, const WS_ASYNC_CONTEXT*, WS_ERROR*); HRESULT WINAPI WsOpenServiceProxy(WS_SERVICE_PROXY*, const WS_ENDPOINT_ADDRESS*, const WS_ASYNC_CONTEXT*, WS_ERROR*); HRESULT WINAPI WsReadAttribute(WS_XML_READER*, const WS_ATTRIBUTE_DESCRIPTION*, WS_READ_OPTION,
From: Alex Henrie alexhenrie24@gmail.com
--- include/webservices.h | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/include/webservices.h b/include/webservices.h index 542670967c0..beff41850c0 100644 --- a/include/webservices.h +++ b/include/webservices.h @@ -1879,6 +1879,9 @@ HRESULT WINAPI WsXmlStringEquals(const WS_XML_STRING*, const WS_XML_STRING*, WS_ #define WS_E_SECURITY_TOKEN_EXPIRED 0x803d0022 #define WS_E_SECURITY_SYSTEM_FAILURE 0x803d0023
+#define WS_STRING_VALUE(s) { sizeof(s) / sizeof(*s) - 1, (WCHAR*)s } +#define WS_XML_STRING_VALUE(s) { sizeof(s) - 1, (BYTE*)s } + #ifdef __cplusplus } #endif /* __cplusplus */
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/webservices/tests/channel.c | 2 +- dlls/webservices/tests/msg.c | 4 ++-- dlls/webservices/tests/proxy.c | 22 +++++++++++----------- dlls/webservices/tests/reader.c | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/dlls/webservices/tests/channel.c b/dlls/webservices/tests/channel.c index 7e0a9becbc5..4cf39c10732 100644 --- a/dlls/webservices/tests/channel.c +++ b/dlls/webservices/tests/channel.c @@ -403,7 +403,7 @@ static void test_WsCreateChannelForListener(void)
static void test_WsResetListener(void) { - WS_STRING url = { ARRAY_SIZE( L"net.tcp://+:2017/path" ) - 1, (WCHAR *)L"net.tcp://+:2017/path" }; + static const WS_STRING url = WS_STRING_VALUE( L"net.tcp://+:2017/path" ); WS_LISTENER *listener; WS_LISTENER_STATE state; WS_LISTENER_PROPERTY prop; diff --git a/dlls/webservices/tests/msg.c b/dlls/webservices/tests/msg.c index b1c0237dc3f..bf9c700a931 100644 --- a/dlls/webservices/tests/msg.c +++ b/dlls/webservices/tests/msg.c @@ -1206,8 +1206,8 @@ static void test_WsReadBody(void) "<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/%5C%22%3E<s:Body>" "<s:Fault><faultcode>s:Client</faultcode><faultstring>OLS Exception</faultstring></s:Fault>" "</s:Body></s:Envelope>"; - static const WS_XML_STRING faultcode = { 6, (BYTE *)"Client" }; - static const WS_STRING faultstring = { 13, (WCHAR *)L"OLS Exception" }; + static const WS_XML_STRING faultcode = WS_XML_STRING_VALUE( "Client" ); + static const WS_STRING faultstring = WS_STRING_VALUE( L"OLS Exception" ); WS_HEAP *heap; WS_MESSAGE *msg, *msg2, *msg3; WS_XML_READER *reader; diff --git a/dlls/webservices/tests/proxy.c b/dlls/webservices/tests/proxy.c index 59d571fb5c3..89046acd859 100644 --- a/dlls/webservices/tests/proxy.c +++ b/dlls/webservices/tests/proxy.c @@ -812,17 +812,17 @@ static const char resp_test5[] =
static void test_fault_response( int port ) { - WS_XML_STRING faultcode = {6, (BYTE *)"Client"}; - WS_STRING faultstring = {13, (WCHAR *)L"OLS Exception"}; - WS_XML_STRING req = {3, (BYTE *)"req"}; - WS_XML_STRING resp = {4, (BYTE *)"resp"}; - WS_XML_STRING req_action = {9, (BYTE *)"req_test5"}; - WS_XML_STRING resp_action = {10, (BYTE *)"resp_test5"}; - WS_XML_STRING req_elem = {9, (BYTE *)"req_test5"}; - WS_XML_STRING resp_elem = {10, (BYTE *)"resp_test5"}; - WS_XML_STRING ns = {2, (BYTE *)"ns"}; - WS_XML_STRING ns2 = {0, (BYTE *)""}; - WS_XML_STRING val = {3, (BYTE *)"val"}; + static const WS_XML_STRING faultcode = WS_XML_STRING_VALUE( "Client" ); + static const WS_STRING faultstring = WS_STRING_VALUE( L"OLS Exception" ); + WS_XML_STRING req = WS_XML_STRING_VALUE( "req" ); + WS_XML_STRING resp = WS_XML_STRING_VALUE( "resp" ); + WS_XML_STRING req_action = WS_XML_STRING_VALUE( "req_test5" ); + WS_XML_STRING resp_action = WS_XML_STRING_VALUE( "resp_test5" ); + WS_XML_STRING req_elem = WS_XML_STRING_VALUE( "req_test5" ); + WS_XML_STRING resp_elem = WS_XML_STRING_VALUE( "resp_test5" ); + WS_XML_STRING ns = WS_XML_STRING_VALUE( "ns" ); + WS_XML_STRING ns2 = WS_XML_STRING_VALUE( "" ); + WS_XML_STRING val = WS_XML_STRING_VALUE( "val" ); HRESULT hr; WS_SERVICE_PROXY *proxy; WS_FIELD_DESCRIPTION f, *fields[1]; diff --git a/dlls/webservices/tests/reader.c b/dlls/webservices/tests/reader.c index 64acc4fcfc0..3f83c66d962 100644 --- a/dlls/webservices/tests/reader.c +++ b/dlls/webservices/tests/reader.c @@ -7144,11 +7144,11 @@ static void test_description_type(void)
static void test_WsAddErrorString(void) { + static const WS_STRING emptystr = { 0 }; + static const WS_STRING str1 = WS_STRING_VALUE( L"str1" ); + static const WS_STRING str2 = WS_STRING_VALUE( L"str2" ); ULONG count; WS_ERROR *error; - WS_STRING emptystr = { 0 }; - WS_STRING str1 = { 4, (WCHAR *) L"str1" }; - WS_STRING str2 = { 4, (WCHAR *) L"str2" }; WS_STRING out; HRESULT hr;
This merge request was approved by Hans Leidekker.