Commit a808f23c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Compile tests with -D__WINESRC__.

parent b7389a87
TESTDLL = urlmon.dll
IMPORTS = urlmon wininet ole32 oleaut32 user32 advapi32
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
C_SRCS = \
generated.c \
......
......@@ -8129,11 +8129,10 @@ static void test_IUri_GetPropertyLength(void) {
DWORD j;
for(j = Uri_PROPERTY_STRING_START; j <= Uri_PROPERTY_STRING_LAST; ++j) {
DWORD expectedLen, brokenLen, receivedLen;
DWORD expectedLen, receivedLen;
uri_str_property prop = test.str_props[j];
expectedLen = lstrlen(prop.value);
brokenLen = lstrlen(prop.broken_value);
expectedLen = lstrlenA(prop.value);
/* This won't be necessary once GetPropertyLength is implemented. */
receivedLen = -1;
......@@ -8145,14 +8144,14 @@ static void test_IUri_GetPropertyLength(void) {
hr, prop.expected, i, j);
}
todo_wine {
ok(receivedLen == expectedLen || broken(receivedLen == brokenLen),
ok(receivedLen == expectedLen || broken(prop.broken_value && receivedLen == lstrlenA(prop.broken_value)),
"Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
expectedLen, receivedLen, i, j);
}
} else {
ok(hr == prop.expected, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
hr, prop.expected, i, j);
ok(receivedLen == expectedLen || broken(receivedLen == brokenLen),
ok(receivedLen == expectedLen || broken(prop.broken_value && receivedLen == lstrlenA(prop.broken_value)),
"Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
expectedLen, receivedLen, i, j);
}
......@@ -8959,6 +8958,7 @@ static void test_IUriBuilder_GetFragment(IUriBuilder *builder, const uri_builder
if(prop) {
/* Use expected_value unless it's NULL, then use value. */
LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
DWORD expected_len = expected ? strlen(expected) : 0;
hr = IUriBuilder_GetFragment(builder, &len, &received);
if(prop->todo) {
todo_wine {
......@@ -8972,9 +8972,9 @@ static void test_IUriBuilder_GetFragment(IUriBuilder *builder, const uri_builder
expected, wine_dbgstr_w(received), test_index);
}
todo_wine {
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
}
} else {
......@@ -8983,9 +8983,9 @@ static void test_IUriBuilder_GetFragment(IUriBuilder *builder, const uri_builder
hr, (expected ? S_OK : S_FALSE), test_index);
ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
expected, wine_dbgstr_w(received), test_index);
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
} else {
/* The property wasn't set earlier, so it should return whatever
......@@ -9068,6 +9068,7 @@ static void test_IUriBuilder_GetHost(IUriBuilder *builder, const uri_builder_tes
if(prop) {
/* Use expected_value unless it's NULL, then use value. */
LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
DWORD expected_len = expected ? strlen(expected) : 0;
hr = IUriBuilder_GetHost(builder, &len, &received);
if(prop->todo) {
todo_wine {
......@@ -9081,9 +9082,9 @@ static void test_IUriBuilder_GetHost(IUriBuilder *builder, const uri_builder_tes
expected, wine_dbgstr_w(received), test_index);
}
todo_wine {
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
}
} else {
......@@ -9092,9 +9093,9 @@ static void test_IUriBuilder_GetHost(IUriBuilder *builder, const uri_builder_tes
hr, (expected ? S_OK : S_FALSE), test_index);
ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
expected, wine_dbgstr_w(received), test_index);
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
} else {
/* The property wasn't set earlier, so it should return whatever
......@@ -9177,6 +9178,7 @@ static void test_IUriBuilder_GetPassword(IUriBuilder *builder, const uri_builder
if(prop) {
/* Use expected_value unless it's NULL, then use value. */
LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
DWORD expected_len = expected ? strlen(expected) : 0;
hr = IUriBuilder_GetPassword(builder, &len, &received);
if(prop->todo) {
todo_wine {
......@@ -9190,9 +9192,9 @@ static void test_IUriBuilder_GetPassword(IUriBuilder *builder, const uri_builder
expected, wine_dbgstr_w(received), test_index);
}
todo_wine {
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
}
} else {
......@@ -9201,9 +9203,9 @@ static void test_IUriBuilder_GetPassword(IUriBuilder *builder, const uri_builder
hr, (expected ? S_OK : S_FALSE), test_index);
ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
expected, wine_dbgstr_w(received), test_index);
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
} else {
/* The property wasn't set earlier, so it should return whatever
......@@ -9286,6 +9288,7 @@ static void test_IUriBuilder_GetPath(IUriBuilder *builder, const uri_builder_tes
if(prop) {
/* Use expected_value unless it's NULL, then use value. */
LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
DWORD expected_len = expected ? strlen(expected) : 0;
hr = IUriBuilder_GetPath(builder, &len, &received);
if(prop->todo) {
todo_wine {
......@@ -9299,9 +9302,9 @@ static void test_IUriBuilder_GetPath(IUriBuilder *builder, const uri_builder_tes
expected, wine_dbgstr_w(received), test_index);
}
todo_wine {
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
}
} else {
......@@ -9310,9 +9313,9 @@ static void test_IUriBuilder_GetPath(IUriBuilder *builder, const uri_builder_tes
hr, (expected ? S_OK : S_FALSE), test_index);
ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
expected, wine_dbgstr_w(received), test_index);
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
} else {
/* The property wasn't set earlier, so it should return whatever
......@@ -9480,6 +9483,7 @@ static void test_IUriBuilder_GetQuery(IUriBuilder *builder, const uri_builder_te
if(prop) {
/* Use expected_value unless it's NULL, then use value. */
LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
DWORD expected_len = expected ? strlen(expected) : 0;
hr = IUriBuilder_GetQuery(builder, &len, &received);
if(prop->todo) {
todo_wine {
......@@ -9493,9 +9497,9 @@ static void test_IUriBuilder_GetQuery(IUriBuilder *builder, const uri_builder_te
expected, wine_dbgstr_w(received), test_index);
}
todo_wine {
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
}
} else {
......@@ -9504,9 +9508,9 @@ static void test_IUriBuilder_GetQuery(IUriBuilder *builder, const uri_builder_te
hr, (expected ? S_OK : S_FALSE), test_index);
ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
expected, wine_dbgstr_w(received), test_index);
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
} else {
/* The property wasn't set earlier, so it should return whatever
......@@ -9589,6 +9593,7 @@ static void test_IUriBuilder_GetSchemeName(IUriBuilder *builder, const uri_build
if(prop) {
/* Use expected_value unless it's NULL, then use value. */
LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
DWORD expected_len = expected ? strlen(expected) : 0;
hr = IUriBuilder_GetSchemeName(builder, &len, &received);
if(prop->todo) {
todo_wine {
......@@ -9602,9 +9607,9 @@ static void test_IUriBuilder_GetSchemeName(IUriBuilder *builder, const uri_build
expected, wine_dbgstr_w(received), test_index);
}
todo_wine {
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
}
} else {
......@@ -9613,9 +9618,9 @@ static void test_IUriBuilder_GetSchemeName(IUriBuilder *builder, const uri_build
hr, (expected ? S_OK : S_FALSE), test_index);
ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
expected, wine_dbgstr_w(received), test_index);
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
} else {
/* The property wasn't set earlier, so it should return whatever
......@@ -9698,6 +9703,7 @@ static void test_IUriBuilder_GetUserName(IUriBuilder *builder, const uri_builder
if(prop && prop->value && *prop->value) {
/* Use expected_value unless it's NULL, then use value. */
LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
DWORD expected_len = expected ? strlen(expected) : 0;
hr = IUriBuilder_GetUserName(builder, &len, &received);
if(prop->todo) {
todo_wine {
......@@ -9711,9 +9717,9 @@ static void test_IUriBuilder_GetUserName(IUriBuilder *builder, const uri_builder
expected, wine_dbgstr_w(received), test_index);
}
todo_wine {
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
}
} else {
......@@ -9722,9 +9728,9 @@ static void test_IUriBuilder_GetUserName(IUriBuilder *builder, const uri_builder
hr, (expected ? S_OK : S_FALSE), test_index);
ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
expected, wine_dbgstr_w(received), test_index);
ok(lstrlen(expected) == len,
ok(expected_len == len,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
lstrlen(expected), len, test_index);
expected_len, len, test_index);
}
} else {
/* The property wasn't set earlier, so it should return whatever
......@@ -11488,7 +11494,7 @@ static void test_UninitializedUri(void)
START_TEST(uri) {
HMODULE hurlmon;
hurlmon = GetModuleHandle("urlmon.dll");
hurlmon = GetModuleHandleA("urlmon.dll");
pCoInternetGetSession = (void*) GetProcAddress(hurlmon, "CoInternetGetSession");
pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
pCreateUriWithFragment = (void*) GetProcAddress(hurlmon, "CreateUriWithFragment");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment