Commit f7ea9941 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

ntdll/tests: Enable compilation with long types in large_int.c

parent db6e5014
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
* We use function pointers here as there is no import library for NTDLL on * We use function pointers here as there is no import library for NTDLL on
* windows. * windows.
*/ */
#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdlib.h> #include <stdlib.h>
...@@ -297,7 +298,7 @@ static void one_RtlInt64ToUnicodeString_test(int test_num, const largeint2str_t ...@@ -297,7 +298,7 @@ static void one_RtlInt64ToUnicodeString_test(int test_num, const largeint2str_t
#ifdef _WIN64 #ifdef _WIN64
if (largeint2str->value >> 32 == 0xffffffff) /* this crashes on 64-bit Vista */ if (largeint2str->value >> 32 == 0xffffffff) /* this crashes on 64-bit Vista */
{ {
skip( "Value ffffffff%08x broken on 64-bit windows\n", (DWORD)largeint2str->value ); skip( "Value ffffffff%08lx broken on 64-bit windows\n", (DWORD)largeint2str->value );
return; return;
} }
#endif #endif
...@@ -340,7 +341,7 @@ static void one_RtlInt64ToUnicodeString_test(int test_num, const largeint2str_t ...@@ -340,7 +341,7 @@ static void one_RtlInt64ToUnicodeString_test(int test_num, const largeint2str_t
} /* if */ } /* if */
} else { } else {
ok(result == largeint2str->result, ok(result == largeint2str->result,
"(test %d): RtlInt64ToUnicodeString(0x%s, %d, [out]) has result %x, expected: %x\n", "(test %d): RtlInt64ToUnicodeString(0x%s, %d, [out]) has result %lx, expected: %lx\n",
test_num, wine_dbgstr_longlong(largeint2str->value), largeint2str->base, result, largeint2str->result); test_num, wine_dbgstr_longlong(largeint2str->value), largeint2str->base, result, largeint2str->result);
if (result == STATUS_SUCCESS) { if (result == STATUS_SUCCESS) {
ok(unicode_string.Buffer[unicode_string.Length/sizeof(WCHAR)] == '\0', ok(unicode_string.Buffer[unicode_string.Length/sizeof(WCHAR)] == '\0',
...@@ -349,7 +350,7 @@ static void one_RtlInt64ToUnicodeString_test(int test_num, const largeint2str_t ...@@ -349,7 +350,7 @@ static void one_RtlInt64ToUnicodeString_test(int test_num, const largeint2str_t
} /* if */ } /* if */
} /* if */ } /* if */
ok(memcmp(unicode_string.Buffer, expected_unicode_string.Buffer, LARGE_STRI_BUFFER_LENGTH * sizeof(WCHAR)) == 0, ok(memcmp(unicode_string.Buffer, expected_unicode_string.Buffer, LARGE_STRI_BUFFER_LENGTH * sizeof(WCHAR)) == 0,
"(test %d): RtlInt64ToUnicodeString(0x%x%08x, %d, [out]) assigns string \"%s\", expected: \"%s\"\n", "(test %d): RtlInt64ToUnicodeString(0x%lx%08lx, %d, [out]) assigns string \"%s\", expected: \"%s\"\n",
test_num, (DWORD)(largeint2str->value >>32), (DWORD)largeint2str->value, largeint2str->base, test_num, (DWORD)(largeint2str->value >>32), (DWORD)largeint2str->value, largeint2str->base,
ansi_str.Buffer, expected_ansi_str.Buffer); ansi_str.Buffer, expected_ansi_str.Buffer);
ok(unicode_string.Length == expected_unicode_string.Length, ok(unicode_string.Length == expected_unicode_string.Length,
...@@ -384,7 +385,7 @@ static void one_RtlLargeIntegerToChar_test(int test_num, const largeint2str_t *l ...@@ -384,7 +385,7 @@ static void one_RtlLargeIntegerToChar_test(int test_num, const largeint2str_t *l
#ifdef _WIN64 #ifdef _WIN64
if (largeint2str->value >> 32 == 0xffffffff) /* this crashes on 64-bit Vista */ if (largeint2str->value >> 32 == 0xffffffff) /* this crashes on 64-bit Vista */
{ {
skip( "Value ffffffff%08x broken on 64-bit windows\n", (DWORD)largeint2str->value ); skip( "Value ffffffff%08lx broken on 64-bit windows\n", (DWORD)largeint2str->value );
return; return;
} }
#endif #endif
...@@ -398,7 +399,7 @@ static void one_RtlLargeIntegerToChar_test(int test_num, const largeint2str_t *l ...@@ -398,7 +399,7 @@ static void one_RtlLargeIntegerToChar_test(int test_num, const largeint2str_t *l
result = pRtlLargeIntegerToChar(&value, largeint2str->base, largeint2str->MaximumLength, dest_str); result = pRtlLargeIntegerToChar(&value, largeint2str->base, largeint2str->MaximumLength, dest_str);
} /* if */ } /* if */
ok(result == largeint2str->result, ok(result == largeint2str->result,
"(test %d): RtlLargeIntegerToChar(0x%s, %d, %d, [out]) has result %x, expected: %x\n", "(test %d): RtlLargeIntegerToChar(0x%s, %d, %d, [out]) has result %lx, expected: %lx\n",
test_num, wine_dbgstr_longlong(largeint2str->value), largeint2str->base, test_num, wine_dbgstr_longlong(largeint2str->value), largeint2str->base,
largeint2str->MaximumLength, result, largeint2str->result); largeint2str->MaximumLength, result, largeint2str->result);
ok(memcmp(dest_str, largeint2str->Buffer, LARGE_STRI_BUFFER_LENGTH) == 0, ok(memcmp(dest_str, largeint2str->Buffer, LARGE_STRI_BUFFER_LENGTH) == 0,
...@@ -421,24 +422,24 @@ static void test_RtlLargeIntegerToChar(void) ...@@ -421,24 +422,24 @@ static void test_RtlLargeIntegerToChar(void)
value = largeint2str[0].value; value = largeint2str[0].value;
result = pRtlLargeIntegerToChar(&value, 20, largeint2str[0].MaximumLength, NULL); result = pRtlLargeIntegerToChar(&value, 20, largeint2str[0].MaximumLength, NULL);
ok(result == STATUS_INVALID_PARAMETER, ok(result == STATUS_INVALID_PARAMETER,
"(test a): RtlLargeIntegerToChar(0x%s, %d, %d, NULL) has result %x, expected: %x\n", "(test a): RtlLargeIntegerToChar(0x%s, %d, %d, NULL) has result %lx, expected: %lx\n",
wine_dbgstr_longlong(largeint2str[0].value), 20, wine_dbgstr_longlong(largeint2str[0].value), 20,
largeint2str[0].MaximumLength, result, STATUS_INVALID_PARAMETER); largeint2str[0].MaximumLength, result, STATUS_INVALID_PARAMETER);
result = pRtlLargeIntegerToChar(&value, 20, 0, NULL); result = pRtlLargeIntegerToChar(&value, 20, 0, NULL);
ok(result == STATUS_INVALID_PARAMETER, ok(result == STATUS_INVALID_PARAMETER,
"(test b): RtlLargeIntegerToChar(0x%s, %d, %d, NULL) has result %x, expected: %x\n", "(test b): RtlLargeIntegerToChar(0x%s, %d, %d, NULL) has result %lx, expected: %lx\n",
wine_dbgstr_longlong(largeint2str[0].value), 20, wine_dbgstr_longlong(largeint2str[0].value), 20,
largeint2str[0].MaximumLength, result, STATUS_INVALID_PARAMETER); largeint2str[0].MaximumLength, result, STATUS_INVALID_PARAMETER);
result = pRtlLargeIntegerToChar(&value, largeint2str[0].base, 0, NULL); result = pRtlLargeIntegerToChar(&value, largeint2str[0].base, 0, NULL);
ok(result == STATUS_BUFFER_OVERFLOW, ok(result == STATUS_BUFFER_OVERFLOW,
"(test c): RtlLargeIntegerToChar(0x%s, %d, %d, NULL) has result %x, expected: %x\n", "(test c): RtlLargeIntegerToChar(0x%s, %d, %d, NULL) has result %lx, expected: %lx\n",
wine_dbgstr_longlong(largeint2str[0].value), largeint2str[0].base, 0, result, STATUS_BUFFER_OVERFLOW); wine_dbgstr_longlong(largeint2str[0].value), largeint2str[0].base, 0, result, STATUS_BUFFER_OVERFLOW);
result = pRtlLargeIntegerToChar(&value, largeint2str[0].base, largeint2str[0].MaximumLength, NULL); result = pRtlLargeIntegerToChar(&value, largeint2str[0].base, largeint2str[0].MaximumLength, NULL);
ok(result == STATUS_ACCESS_VIOLATION, ok(result == STATUS_ACCESS_VIOLATION,
"(test d): RtlLargeIntegerToChar(0x%s, %d, %d, NULL) has result %x, expected: %x\n", "(test d): RtlLargeIntegerToChar(0x%s, %d, %d, NULL) has result %lx, expected: %lx\n",
wine_dbgstr_longlong(largeint2str[0].value), wine_dbgstr_longlong(largeint2str[0].value),
largeint2str[0].base, largeint2str[0].MaximumLength, result, STATUS_ACCESS_VIOLATION); largeint2str[0].base, largeint2str[0].MaximumLength, result, STATUS_ACCESS_VIOLATION);
} }
......
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