memset(&comp, 0, sizeof comp);
comp.dwStructSize = sizeof(comp);
comp.lpszScheme = scheme;
- comp.dwSchemeLength = sizeof(scheme)/sizeof(scheme[0]);
+ comp.dwSchemeLength = ARRAY_SIZE(scheme);
comp.lpszHostName = host;
- comp.dwHostNameLength = sizeof(host)/sizeof(host[0]);
+ comp.dwHostNameLength = ARRAY_SIZE(host);
comp.lpszUserName = user;
- comp.dwUserNameLength = sizeof(user)/sizeof(user[0]);
+ comp.dwUserNameLength = ARRAY_SIZE(user);
comp.lpszPassword = pwd;
- comp.dwPasswordLength = sizeof(pwd)/sizeof(pwd[0]);
+ comp.dwPasswordLength = ARRAY_SIZE(pwd);
comp.lpszUrlPath = urlpart;
- comp.dwUrlPathLength = sizeof(urlpart)/sizeof(urlpart[0]);
+ comp.dwUrlPathLength = ARRAY_SIZE(urlpart);
comp.lpszExtraInfo = extra;
- comp.dwExtraInfoLength = sizeof(extra)/sizeof(extra[0]);
+ comp.dwExtraInfoLength = ARRAY_SIZE(extra);
SetLastError(0xdeadbeef);
r = InternetCrackUrlW(NULL, 0, 0, &comp );
memset(&comp, 0, sizeof comp);
comp.dwStructSize = sizeof comp;
comp.lpszHostName = host;
- comp.dwHostNameLength = sizeof(host)/sizeof(host[0]);
+ comp.dwHostNameLength = ARRAY_SIZE(host);
comp.lpszUrlPath = urlpart;
- comp.dwUrlPathLength = sizeof(urlpart)/sizeof(urlpart[0]);
+ comp.dwUrlPathLength = ARRAY_SIZE(urlpart);
r = InternetCrackUrlW(url, 0, 0, &comp );
ok( r, "failed to crack url\n");
memset(&comp, 0, sizeof comp);
comp.dwStructSize = sizeof comp;
comp.lpszHostName = host;
- comp.dwHostNameLength = sizeof(host)/sizeof(host[0]);
+ comp.dwHostNameLength = ARRAY_SIZE(host);
comp.lpszUrlPath = urlpart;
- comp.dwUrlPathLength = sizeof(urlpart)/sizeof(urlpart[0]);
+ comp.dwUrlPathLength = ARRAY_SIZE(urlpart);
comp.lpszExtraInfo = NULL;
- comp.dwExtraInfoLength = sizeof(extra)/sizeof(extra[0]);
+ comp.dwExtraInfoLength = ARRAY_SIZE(extra);
r = InternetCrackUrlW(url, 0, 0, &comp );
ok( r, "failed to crack url\n");
memset(&comp, 0, sizeof(comp));
comp.dwStructSize = sizeof(comp);
comp.lpszScheme = scheme;
- comp.dwSchemeLength = sizeof(scheme)/sizeof(scheme[0]);
+ comp.dwSchemeLength = ARRAY_SIZE(scheme);
comp.lpszHostName = host;
- comp.dwHostNameLength = sizeof(host)/sizeof(host[0]);
+ comp.dwHostNameLength = ARRAY_SIZE(host);
comp.lpszUserName = user;
- comp.dwUserNameLength = sizeof(user)/sizeof(user[0]);
+ comp.dwUserNameLength = ARRAY_SIZE(user);
comp.lpszPassword = pwd;
- comp.dwPasswordLength = sizeof(pwd)/sizeof(pwd[0]);
+ comp.dwPasswordLength = ARRAY_SIZE(pwd);
comp.lpszUrlPath = urlpart;
- comp.dwUrlPathLength = sizeof(urlpart)/sizeof(urlpart[0]);
+ comp.dwUrlPathLength = ARRAY_SIZE(urlpart);
comp.lpszExtraInfo = extra;
- comp.dwExtraInfoLength = sizeof(extra)/sizeof(extra[0]);
+ comp.dwExtraInfoLength = ARRAY_SIZE(extra);
r = InternetCrackUrlW(url2, 0, 0, &comp);
ok(!r, "InternetCrackUrl should have failed\n");
memset(&comp, 0, sizeof comp);
comp.dwStructSize = sizeof comp;
comp.lpszScheme = scheme;
- comp.dwSchemeLength = sizeof(scheme)/sizeof(scheme[0]);
+ comp.dwSchemeLength = ARRAY_SIZE(scheme);
comp.lpszHostName = host;
- comp.dwHostNameLength = sizeof(host)/sizeof(host[0]);
+ comp.dwHostNameLength = ARRAY_SIZE(host);
comp.lpszUserName = user;
- comp.dwUserNameLength = sizeof(user)/sizeof(user[0]);
+ comp.dwUserNameLength = ARRAY_SIZE(user);
comp.lpszPassword = pwd;
- comp.dwPasswordLength = sizeof(pwd)/sizeof(pwd[0]);
+ comp.dwPasswordLength = ARRAY_SIZE(pwd);
comp.lpszUrlPath = urlpart;
- comp.dwUrlPathLength = sizeof(urlpart)/sizeof(urlpart[0]);
+ comp.dwUrlPathLength = ARRAY_SIZE(urlpart);
comp.lpszExtraInfo = extra;
- comp.dwExtraInfoLength = sizeof(extra)/sizeof(extra[0]);
+ comp.dwExtraInfoLength = ARRAY_SIZE(extra);
r = InternetCrackUrlW(url3, 0, 0, &comp );
ok( r, "InternetCrackUrlW failed unexpectedly\n");
ok( host[0] == 'x', "host should be x.org\n");
memset(&comp, 0, sizeof(comp));
comp.dwStructSize = sizeof(comp);
comp.lpszHostName = host;
- comp.dwHostNameLength = sizeof(host)/sizeof(host[0]);
+ comp.dwHostNameLength = ARRAY_SIZE(host);
comp.lpszUrlPath = urlpart;
- comp.dwUrlPathLength = sizeof(urlpart)/sizeof(urlpart[0]);
+ comp.dwUrlPathLength = ARRAY_SIZE(urlpart);
r = InternetCrackUrlW(url3, 0, ICU_DECODE, &comp);
ok(r, "InternetCrackUrlW failed unexpectedly\n");
ok(!strcmp_wa(host, "x.org"), "host is %s, should be x.org\n", wine_dbgstr_w(host));
return;
}
- for(i=0; i < sizeof(crack_url_tests)/sizeof(*crack_url_tests); i++)
+ for(i = 0; i < ARRAY_SIZE(crack_url_tests); i++)
test_crack_url(crack_url_tests+i);
test_long_url();