webservices/tests: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
338f1458d8
commit
30e9711375
|
@ -1,4 +1,3 @@
|
|||
EXTRADEFS = -DWINE_NO_LONG_TYPES
|
||||
TESTDLL = webservices.dll
|
||||
IMPORTS = webservices oleaut32 ole32 user32 rpcrt4 ws2_32 advapi32
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -99,22 +99,22 @@ static void test_WsCreateServiceProxy(void)
|
|||
|
||||
hr = WsCreateServiceProxy( WS_CHANNEL_TYPE_REQUEST, WS_HTTP_CHANNEL_BINDING, NULL, NULL,
|
||||
0, NULL, 0, NULL, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
proxy = NULL;
|
||||
hr = WsCreateServiceProxy( WS_CHANNEL_TYPE_REQUEST, WS_HTTP_CHANNEL_BINDING, NULL, NULL,
|
||||
0, NULL, 0, &proxy, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
ok( proxy != NULL, "proxy not set\n" );
|
||||
|
||||
/* write-only property */
|
||||
value = 0xdeadbeef;
|
||||
hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_CALL_TIMEOUT, &value, sizeof(value), NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
state = 0xdeadbeef;
|
||||
hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_STATE, &state, sizeof(state), NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
ok( state == WS_SERVICE_PROXY_STATE_CREATED, "got %u\n", state );
|
||||
|
||||
WsFreeServiceProxy( proxy );
|
||||
|
@ -128,17 +128,17 @@ static void test_WsCreateServiceProxyFromTemplate(void)
|
|||
|
||||
hr = WsCreateServiceProxyFromTemplate( WS_CHANNEL_TYPE_REQUEST, NULL, 0, WS_HTTP_BINDING_TEMPLATE_TYPE,
|
||||
NULL, 0, NULL, 0, NULL, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
hr = WsCreateServiceProxyFromTemplate( WS_CHANNEL_TYPE_REQUEST, NULL, 0, WS_HTTP_BINDING_TEMPLATE_TYPE,
|
||||
NULL, 0, NULL, 0, &proxy, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
memset( &policy, 0, sizeof(policy) );
|
||||
proxy = NULL;
|
||||
hr = WsCreateServiceProxyFromTemplate( WS_CHANNEL_TYPE_REQUEST, NULL, 0, WS_HTTP_BINDING_TEMPLATE_TYPE,
|
||||
NULL, 0, &policy, sizeof(policy), &proxy, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
ok( proxy != NULL, "proxy not set\n" );
|
||||
|
||||
WsFreeServiceProxy( proxy );
|
||||
|
@ -155,30 +155,30 @@ static void test_WsOpenServiceProxy(void)
|
|||
memset( &policy, 0, sizeof(policy) );
|
||||
hr = WsCreateServiceProxyFromTemplate( WS_CHANNEL_TYPE_REQUEST, NULL, 0, WS_HTTP_BINDING_TEMPLATE_TYPE,
|
||||
NULL, 0, &policy, sizeof(policy), &proxy, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
state = 0xdeadbeef;
|
||||
hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_STATE, &state, sizeof(state), NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
ok( state == WS_SERVICE_PROXY_STATE_CREATED, "got %u\n", state );
|
||||
|
||||
memset( &addr, 0, sizeof(addr) );
|
||||
addr.url.length = ARRAY_SIZE( L"http://localhost/" ) - 1;
|
||||
addr.url.chars = (WCHAR *)L"http://localhost/";
|
||||
hr = WsOpenServiceProxy( proxy, &addr, NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
state = 0xdeadbeef;
|
||||
hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_STATE, &state, sizeof(state), NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
ok( state == WS_SERVICE_PROXY_STATE_OPEN, "got %u\n", state );
|
||||
|
||||
hr = WsCloseServiceProxy( proxy , NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
state = 0xdeadbeef;
|
||||
hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_STATE, &state, sizeof(state), NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
ok( state == WS_SERVICE_PROXY_STATE_CLOSED, "got %u\n", state );
|
||||
|
||||
WsFreeServiceProxy( proxy );
|
||||
|
@ -193,34 +193,34 @@ static void test_WsResetServiceProxy(void)
|
|||
|
||||
hr = WsCreateServiceProxy( WS_CHANNEL_TYPE_REQUEST, WS_HTTP_CHANNEL_BINDING, NULL, NULL,
|
||||
0, NULL, 0, &proxy, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = WsResetServiceProxy( proxy, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
state = 0xdeadbeef;
|
||||
hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_STATE, &state, sizeof(state), NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
ok( state == WS_SERVICE_PROXY_STATE_CREATED, "got %u\n", state );
|
||||
|
||||
memset( &addr, 0, sizeof(addr) );
|
||||
addr.url.length = ARRAY_SIZE( L"http://localhost/" ) - 1;
|
||||
addr.url.chars = (WCHAR *)L"http://localhost/";
|
||||
hr = WsOpenServiceProxy( proxy, &addr, NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = WsResetServiceProxy( proxy, NULL );
|
||||
ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr );
|
||||
ok( hr == WS_E_INVALID_OPERATION, "got %#lx\n", hr );
|
||||
|
||||
hr = WsCloseServiceProxy( proxy , NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = WsResetServiceProxy( proxy, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
state = 0xdeadbeef;
|
||||
hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_STATE, &state, sizeof(state), NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
ok( state == WS_SERVICE_PROXY_STATE_CREATED, "got %u\n", state );
|
||||
|
||||
WsFreeServiceProxy( proxy );
|
||||
|
@ -278,27 +278,27 @@ static void test_WsSendMessage( int port, WS_XML_STRING *action )
|
|||
HRESULT hr;
|
||||
|
||||
hr = create_channel( port, &channel );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = WsCreateMessageForChannel( channel, NULL, 0, &msg, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
set_elem_desc( &body, &req, &ns, WS_INT32_TYPE, NULL );
|
||||
set_msg_desc( &desc, action, &body );
|
||||
hr = WsSendMessage( NULL, msg, &desc, WS_WRITE_REQUIRED_VALUE, &val, sizeof(val), NULL, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
hr = WsSendMessage( channel, NULL, &desc, WS_WRITE_REQUIRED_VALUE, &val, sizeof(val), NULL, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
hr = WsSendMessage( channel, msg, NULL, WS_WRITE_REQUIRED_VALUE, &val, sizeof(val), NULL, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
hr = WsSendMessage( channel, msg, &desc, WS_WRITE_REQUIRED_VALUE, &val, sizeof(val), NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = WsCloseChannel( channel, NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
WsFreeChannel( channel );
|
||||
WsFreeMessage( msg );
|
||||
|
@ -316,42 +316,42 @@ static void test_WsReceiveMessage( int port )
|
|||
HRESULT hr;
|
||||
|
||||
hr = create_channel( port, &channel );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = WsCreateMessageForChannel( channel, NULL, 0, &msg, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
set_elem_desc( &body, &req, &ns, WS_INT32_TYPE, NULL );
|
||||
set_msg_desc( &desc_req, &req, &body );
|
||||
hr = WsSendMessage( channel, msg, &desc_req, WS_WRITE_REQUIRED_VALUE, &val, sizeof(val), NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
WsFreeMessage( msg );
|
||||
|
||||
hr = WsCreateMessageForChannel( channel, NULL, 0, &msg, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
set_elem_desc( &body, &resp, &ns, WS_INT32_TYPE, NULL );
|
||||
set_msg_desc( &desc_resp, &resp, &body );
|
||||
desc[0] = &desc_resp;
|
||||
hr = WsReceiveMessage( NULL, msg, desc, 1, WS_RECEIVE_REQUIRED_MESSAGE, WS_READ_REQUIRED_VALUE,
|
||||
NULL, &val, sizeof(val), NULL, NULL, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
hr = WsReceiveMessage( channel, NULL, desc, 1, WS_RECEIVE_REQUIRED_MESSAGE, WS_READ_REQUIRED_VALUE,
|
||||
NULL, &val, sizeof(val), NULL, NULL, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
hr = WsReceiveMessage( channel, msg, NULL, 1, WS_RECEIVE_REQUIRED_MESSAGE, WS_READ_REQUIRED_VALUE,
|
||||
NULL, &val, sizeof(val), NULL, NULL, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
hr = WsReceiveMessage( channel, msg, desc, 1, WS_RECEIVE_REQUIRED_MESSAGE, WS_READ_REQUIRED_VALUE,
|
||||
NULL, &val, sizeof(val), NULL, NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
ok( val == -2, "got %d\n", val );
|
||||
|
||||
hr = WsCloseChannel( channel, NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
WsFreeChannel( channel );
|
||||
WsFreeMessage( msg );
|
||||
|
@ -438,20 +438,20 @@ static void check_output_headers( WS_MESSAGE *msg )
|
|||
HRESULT hr;
|
||||
|
||||
hr = WsCreateWriter( NULL, 0, &writer, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = set_output( writer );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = WsGetMessageProperty( msg, WS_MESSAGE_PROPERTY_HEADER_BUFFER, &buf, sizeof(buf), NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = WsWriteXmlBuffer( writer, buf, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
memset( &bytes, 0, sizeof(bytes) );
|
||||
hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_BYTES, &bytes, sizeof(bytes), NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
WsFreeWriter( writer );
|
||||
}
|
||||
|
||||
|
@ -471,7 +471,7 @@ static HRESULT CALLBACK send_callback( WS_MESSAGE *msg, WS_HEAP *heap, void *sta
|
|||
HRESULT hr;
|
||||
|
||||
hr = WsAddMappedHeader( msg, &header, WS_XML_STRING_TYPE, WS_WRITE_REQUIRED_VALUE, &value, sizeof(value), NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
check_output_headers( msg );
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -485,7 +485,7 @@ static HRESULT CALLBACK recv_callback( WS_MESSAGE *msg, WS_HEAP *heap, void *sta
|
|||
check_output_headers( msg );
|
||||
hr = WsGetMappedHeader( msg, &header, WS_SINGLETON_HEADER, 0, WS_WSZ_TYPE, WS_READ_OPTIONAL_POINTER, heap,
|
||||
&str, sizeof(str), NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
ok( !wcscmp(str, L"value"), "wrong value %s\n", wine_dbgstr_w(str) );
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -532,16 +532,16 @@ static void test_WsCall( int port )
|
|||
} out;
|
||||
|
||||
hr = WsCreateHeap( 1 << 16, 0, NULL, 0, &heap, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = WsCall( NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
hr = create_proxy( port, &proxy );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = WsCall( proxy, NULL, NULL, NULL, NULL, 0, NULL, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
set_field_desc( &f, WS_ELEMENT_FIELD_MAPPING, &val, &ns, WS_INT32_TYPE, NULL, 0, 0, 0, NULL, NULL );
|
||||
set_field_desc( &f4, WS_REPEATING_ELEMENT_FIELD_MAPPING, NULL, NULL, WS_WSZ_TYPE, NULL,
|
||||
|
@ -573,7 +573,7 @@ static void test_WsCall( int port )
|
|||
|
||||
set_op_desc( &op, &input_msg, &output_msg, 6, param );
|
||||
hr = WsCall( proxy, &op, NULL, NULL, NULL, 0, NULL, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
in.val = 1;
|
||||
str_array[0] = L"test";
|
||||
|
@ -611,14 +611,14 @@ static void test_WsCall( int port )
|
|||
prop[1].valueSize = sizeof(ctx_recv);
|
||||
|
||||
hr = WsCall( proxy, &op, args, heap, prop, ARRAY_SIZE(prop), NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
ok( !wcscmp( out.str, L"test" ), "wrong data\n" );
|
||||
ok( out.count == 2, "got %u\n", out.count );
|
||||
ok( out.count == 2, "got %lu\n", out.count );
|
||||
ok( out.val[0] == 1, "got %u\n", out.val[0] );
|
||||
ok( out.val[1] == 2, "got %u\n", out.val[1] );
|
||||
|
||||
hr = WsCloseServiceProxy( proxy, NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
WsFreeServiceProxy( proxy );
|
||||
WsFreeHeap( heap );
|
||||
|
@ -659,10 +659,10 @@ static void test_empty_response( int port )
|
|||
} in;
|
||||
|
||||
hr = WsCreateHeap( 1 << 16, 0, NULL, 0, &heap, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = create_proxy( port, &proxy );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
set_field_desc( &f, WS_ELEMENT_FIELD_MAPPING, &val, &ns, WS_INT32_TYPE, NULL, 0, 0, 0, NULL, NULL );
|
||||
fields[0] = &f;
|
||||
|
@ -681,14 +681,14 @@ static void test_empty_response( int port )
|
|||
in.val = 1;
|
||||
args[0] = &in.val;
|
||||
hr = WsCall( proxy, &op, args, heap, NULL, 0, NULL, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
set_elem_desc( &output_elem, &resp_elem, &ns, WS_STRUCT_TYPE, &output_struct );
|
||||
hr = WsCall( proxy, &op, args, heap, NULL, 0, NULL, NULL );
|
||||
ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr );
|
||||
ok( hr == WS_E_INVALID_FORMAT, "got %#lx\n", hr );
|
||||
|
||||
hr = WsCloseServiceProxy( proxy, NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
WsFreeServiceProxy( proxy );
|
||||
WsFreeHeap( heap );
|
||||
|
@ -829,10 +829,10 @@ START_TEST(proxy)
|
|||
info.port = 7533;
|
||||
info.event = CreateEventW( NULL, 0, 0, NULL );
|
||||
thread = CreateThread( NULL, 0, server_proc, &info, 0, NULL );
|
||||
ok( thread != NULL, "failed to create server thread %u\n", GetLastError() );
|
||||
ok( thread != NULL, "failed to create server thread %lu\n", GetLastError() );
|
||||
|
||||
ret = WaitForSingleObject( info.event, 3000 );
|
||||
ok(ret == WAIT_OBJECT_0, "failed to start test server %u\n", GetLastError());
|
||||
ok(ret == WAIT_OBJECT_0, "failed to start test server %lu\n", GetLastError());
|
||||
if (ret != WAIT_OBJECT_0)
|
||||
{
|
||||
CloseHandle(thread);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -109,20 +109,20 @@ static void test_WsDecodeUrl(void)
|
|||
UINT i;
|
||||
|
||||
hr = WsCreateHeap( 1 << 16, 0, NULL, 0, &heap, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = WsDecodeUrl( NULL, 0, heap, (WS_URL **)&url, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
str.chars = NULL;
|
||||
str.length = 0;
|
||||
hr = WsDecodeUrl( &str, 0, heap, (WS_URL **)&url, NULL );
|
||||
ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr );
|
||||
ok( hr == WS_E_INVALID_FORMAT, "got %#lx\n", hr );
|
||||
|
||||
str.chars = (WCHAR *)url1;
|
||||
str.length = lstrlenW( url1 );
|
||||
hr = WsDecodeUrl( &str, 0, NULL, (WS_URL **)&url, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE( tests ); i++)
|
||||
{
|
||||
|
@ -132,7 +132,7 @@ static void test_WsDecodeUrl(void)
|
|||
hr = WsDecodeUrl( &str, 0, heap, (WS_URL **)&url, NULL );
|
||||
ok( hr == tests[i].hr ||
|
||||
broken(hr == WS_E_INVALID_FORMAT && str.length >= 8 && !memcmp(L"net.pipe", str.chars, 8)),
|
||||
"%u: got %08x\n", i, hr );
|
||||
"%u: got %#lx\n", i, hr );
|
||||
if (hr != S_OK) continue;
|
||||
|
||||
ok( url->url.scheme == tests[i].scheme, "%u: got %u\n", i, url->url.scheme );
|
||||
|
@ -140,43 +140,43 @@ static void test_WsDecodeUrl(void)
|
|||
|
||||
if (tests[i].host)
|
||||
{
|
||||
ok( url->host.length == tests[i].host_len, "%u: got %u\n", i, url->host.length );
|
||||
ok( url->host.length == tests[i].host_len, "%u: got %lu\n", i, url->host.length );
|
||||
ok( !memcmp( url->host.chars, tests[i].host, url->host.length * sizeof(WCHAR) ),
|
||||
"%u: got %s\n", i, wine_dbgstr_wn(url->host.chars, url->host.length) );
|
||||
}
|
||||
else ok( !url->host.length, "%u: got %u\n", i, url->host.length );
|
||||
else ok( !url->host.length, "%u: got %lu\n", i, url->host.length );
|
||||
|
||||
if (tests[i].port_str)
|
||||
{
|
||||
ok( url->portAsString.length == tests[i].port_len, "%u: got %u\n", i, url->portAsString.length );
|
||||
ok( url->portAsString.length == tests[i].port_len, "%u: got %lu\n", i, url->portAsString.length );
|
||||
ok( !memcmp( url->portAsString.chars, tests[i].port_str, url->portAsString.length * sizeof(WCHAR) ),
|
||||
"%u: got %s\n", i, wine_dbgstr_wn(url->portAsString.chars, url->portAsString.length) );
|
||||
}
|
||||
else ok( !url->portAsString.length, "%u: got %u\n", i, url->portAsString.length );
|
||||
else ok( !url->portAsString.length, "%u: got %lu\n", i, url->portAsString.length );
|
||||
|
||||
if (tests[i].path)
|
||||
{
|
||||
ok( url->path.length == tests[i].path_len, "%u: got %u\n", i, url->path.length );
|
||||
ok( url->path.length == tests[i].path_len, "%u: got %lu\n", i, url->path.length );
|
||||
ok( !memcmp( url->path.chars, tests[i].path, url->path.length * sizeof(WCHAR) ),
|
||||
"%u: got %s\n", i, wine_dbgstr_wn(url->path.chars, url->path.length) );
|
||||
}
|
||||
else ok( !url->path.length, "%u: got %u\n", i, url->path.length );
|
||||
else ok( !url->path.length, "%u: got %lu\n", i, url->path.length );
|
||||
|
||||
if (tests[i].query)
|
||||
{
|
||||
ok( url->query.length == tests[i].query_len, "%u: got %u\n", i, url->query.length );
|
||||
ok( url->query.length == tests[i].query_len, "%u: got %lu\n", i, url->query.length );
|
||||
ok( !memcmp( url->query.chars, tests[i].query, url->query.length * sizeof(WCHAR) ),
|
||||
"%u: got %s\n", i, wine_dbgstr_wn(url->query.chars, url->query.length) );
|
||||
}
|
||||
else ok( !url->query.length, "%u: got %u\n", i, url->query.length );
|
||||
else ok( !url->query.length, "%u: got %lu\n", i, url->query.length );
|
||||
|
||||
if (tests[i].fragment)
|
||||
{
|
||||
ok( url->fragment.length == tests[i].fragment_len, "%u: got %u\n", i, url->fragment.length );
|
||||
ok( url->fragment.length == tests[i].fragment_len, "%u: got %lu\n", i, url->fragment.length );
|
||||
ok( !memcmp( url->fragment.chars, tests[i].fragment, url->fragment.length * sizeof(WCHAR) ),
|
||||
"%u: got %s\n", i, wine_dbgstr_wn(url->fragment.chars, url->fragment.length) );
|
||||
}
|
||||
else ok( !url->fragment.length, "%u: got %u\n", i, url->fragment.length );
|
||||
else ok( !url->fragment.length, "%u: got %lu\n", i, url->fragment.length );
|
||||
}
|
||||
|
||||
WsFreeHeap( heap );
|
||||
|
@ -240,16 +240,16 @@ static void test_WsEncodeUrl(void)
|
|||
UINT i;
|
||||
|
||||
hr = WsCreateHeap( 1 << 16, 0, NULL, 0, &heap, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %#lx\n", hr );
|
||||
|
||||
hr = WsEncodeUrl( NULL, 0, heap, &str, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
hr = WsEncodeUrl( (const WS_URL *)&url, 0, NULL, &str, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
hr = WsEncodeUrl( (const WS_URL *)&url, 0, heap, NULL, NULL );
|
||||
ok( hr == E_INVALIDARG, "got %08x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "got %#lx\n", hr );
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE( tests ); i++)
|
||||
{
|
||||
|
@ -269,10 +269,10 @@ static void test_WsEncodeUrl(void)
|
|||
|
||||
memset( &str, 0, sizeof(str) );
|
||||
hr = WsEncodeUrl( (const WS_URL *)&url, 0, heap, &str, NULL );
|
||||
ok( hr == tests[i].hr, "%u: got %08x\n", i, hr );
|
||||
ok( hr == tests[i].hr, "%u: got %#lx\n", i, hr );
|
||||
if (hr != S_OK) continue;
|
||||
|
||||
ok( str.length == tests[i].len, "%u: got %u\n", i, str.length );
|
||||
ok( str.length == tests[i].len, "%u: got %lu\n", i, str.length );
|
||||
ok( !memcmp( str.chars, tests[i].chars, tests[i].len * sizeof(WCHAR) ),
|
||||
"%u: wrong url %s\n", i, wine_dbgstr_wn(str.chars, str.length) );
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue