Commit cba2c847 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll/tests: Don't use sizeof in ok() to avoid printf format warnings.

parent 65459cb3
......@@ -105,8 +105,8 @@ static void testQuery(void)
{
case STATUS_SUCCESS:
pRtlMultiByteToUnicodeN( bn, sizeof(bn), NULL, test->val, strlen(test->val)+1 );
ok( value.Length == strlen(test->val) * sizeof(WCHAR), "Wrong length %d/%d for %s\n",
value.Length, strlen(test->val) * sizeof(WCHAR), test->var );
ok( value.Length == strlen(test->val) * sizeof(WCHAR), "Wrong length %d for %s\n",
value.Length, test->var );
ok((value.Length == strlen(test->val) * sizeof(WCHAR) && memcmp(bv, bn, test->len*sizeof(WCHAR)) == 0) ||
lstrcmpW(bv, bn) == 0,
"Wrong result for %s/%d\n", test->var, test->len);
......@@ -114,8 +114,7 @@ static void testQuery(void)
break;
case STATUS_BUFFER_TOO_SMALL:
ok( value.Length == strlen(test->val) * sizeof(WCHAR),
"Wrong returned length %d/%d (too small buffer) for %s\n",
value.Length, strlen(test->val) * sizeof(WCHAR), test->var );
"Wrong returned length %d (too small buffer) for %s\n", value.Length, test->var );
break;
}
}
......@@ -241,8 +240,7 @@ static void testExpand(void)
nts = pRtlExpandEnvironmentStrings_U(small_env, &us_src, &us_dst, &ul);
ok(ul == strlen(test->dst) * sizeof(WCHAR) + sizeof(WCHAR),
"Wrong returned length for %s: %lu <> %u\n",
test->src, ul, strlen(test->dst) * sizeof(WCHAR) + sizeof(WCHAR));
"Wrong returned length for %s: %lu\n", test->src, ul );
us_dst.Length = 0;
us_dst.MaximumLength = sizeof(dst);
......@@ -251,11 +249,9 @@ static void testExpand(void)
nts = pRtlExpandEnvironmentStrings_U(small_env, &us_src, &us_dst, &ul);
ok(nts == STATUS_SUCCESS, "Call failed (%lu)\n", nts);
ok(ul == us_dst.Length + sizeof(WCHAR),
"Wrong returned length for %s: %lu <> %u\n",
test->src, ul, us_dst.Length + sizeof(WCHAR));
"Wrong returned length for %s: %lu\n", test->src, ul);
ok(ul == strlen(test->dst) * sizeof(WCHAR) + sizeof(WCHAR),
"Wrong returned length for %s: %lu <> %u\n",
test->src, ul, strlen(test->dst) * sizeof(WCHAR) + sizeof(WCHAR));
"Wrong returned length for %s: %lu\n", test->src, ul);
ok(lstrcmpW(dst, rst) == 0, "Wrong result for %s: expecting %s\n",
test->src, test->dst);
......@@ -266,8 +262,7 @@ static void testExpand(void)
nts = pRtlExpandEnvironmentStrings_U(small_env, &us_src, &us_dst, &ul);
ok(nts == STATUS_BUFFER_TOO_SMALL, "Call failed (%lu)\n", nts);
ok(ul == strlen(test->dst) * sizeof(WCHAR) + sizeof(WCHAR),
"Wrong returned length for %s (with buffer too small): %lu <> %u\n",
test->src, ul, strlen(test->dst) * sizeof(WCHAR) + sizeof(WCHAR));
"Wrong returned length for %s (with buffer too small): %lu\n", test->src, ul);
ok(memcmp(dst, rst, 8*sizeof(WCHAR)) == 0,
"Wrong result for %s (with buffer too small): expecting %s\n",
test->src, test->dst);
......
......@@ -786,7 +786,7 @@ static const all_accesses_t all_accesses[] = {
static void test_RtlAreAllAccessesGranted(void)
{
size_t test_num;
unsigned int test_num;
BOOLEAN result;
for (test_num = 0; test_num < NB_ALL_ACCESSES; test_num++) {
......@@ -823,7 +823,7 @@ static const any_accesses_t any_accesses[] = {
static void test_RtlAreAnyAccessesGranted(void)
{
size_t test_num;
unsigned int test_num;
BOOLEAN result;
for (test_num = 0; test_num < NB_ANY_ACCESSES; test_num++) {
......
......@@ -397,7 +397,7 @@ static void test_RtlDuplicateUnicodeString(void)
CHAR dest_ansi_buf[257];
STRING dest_ansi_str;
NTSTATUS result;
size_t test_num;
unsigned int test_num;
for (test_num = 0; test_num < NB_DUPL_USTR; test_num++) {
source_str.Length = dupl_ustr[test_num].source_Length;
......@@ -754,7 +754,7 @@ static void test_RtlUnicodeStringToAnsiString(void)
STRING ansi_str;
UNICODE_STRING uni_str;
NTSTATUS result;
size_t test_num;
unsigned int test_num;
for (test_num = 0; test_num < NB_USTR2ASTR; test_num++) {
ansi_str.Length = ustr2astr[test_num].ansi_Length;
......@@ -825,7 +825,7 @@ static void test_RtlAppendAsciizToString(void)
CHAR dest_buf[257];
STRING dest_str;
NTSTATUS result;
size_t test_num;
unsigned int test_num;
for (test_num = 0; test_num < NB_APP_ASC2STR; test_num++) {
dest_str.Length = app_asc2str[test_num].dest_Length;
......@@ -897,7 +897,7 @@ static void test_RtlAppendStringToString(void)
STRING dest_str;
STRING src_str;
NTSTATUS result;
size_t test_num;
unsigned int test_num;
for (test_num = 0; test_num < NB_APP_STR2STR; test_num++) {
dest_str.Length = app_str2str[test_num].dest_Length;
......@@ -978,7 +978,7 @@ static void test_RtlAppendUnicodeToString(void)
WCHAR dest_buf[257];
UNICODE_STRING dest_str;
NTSTATUS result;
size_t test_num;
unsigned int test_num;
for (test_num = 0; test_num < NB_APP_UNI2STR; test_num++) {
dest_str.Length = app_uni2str[test_num].dest_Length;
......@@ -1054,7 +1054,7 @@ static void test_RtlAppendUnicodeStringToString(void)
UNICODE_STRING dest_str;
UNICODE_STRING src_str;
NTSTATUS result;
size_t test_num;
unsigned int test_num;
for (test_num = 0; test_num < NB_APP_USTR2STR; test_num++) {
dest_str.Length = app_ustr2str[test_num].dest_Length;
......@@ -1165,8 +1165,8 @@ static void test_RtlFindCharInUnicodeString(void)
UNICODE_STRING search_chars;
USHORT pos;
NTSTATUS result;
size_t idx;
size_t test_num;
unsigned int idx;
unsigned int test_num;
for (test_num = 0; test_num < NB_FIND_CH_IN_USTR; test_num++) {
if (find_ch_in_ustr[test_num].main_str != NULL) {
......@@ -1335,7 +1335,7 @@ static const str2int_t str2int[] = {
static void test_RtlUnicodeStringToInteger(void)
{
size_t test_num;
unsigned int test_num;
int value;
NTSTATUS result;
WCHAR *wstr;
......@@ -1399,7 +1399,7 @@ static void test_RtlUnicodeStringToInteger(void)
static void test_RtlCharToInteger(void)
{
size_t test_num;
unsigned int test_num;
int value;
NTSTATUS result;
......
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