Module: wine Branch: master Commit: fc37683985168c952a3dc6fba3280d2845977168 URL: https://gitlab.winehq.org/wine/wine/-/commit/fc37683985168c952a3dc6fba3280d2...
Author: Francois Gouget fgouget@codeweavers.com Date: Wed May 10 17:17:24 2023 +0200
msvcrt/tests: Check that some functions are only available in 32-bit code.
---
dlls/msvcrt/tests/environ.c | 20 ++++++-------------- dlls/msvcrt/tests/time.c | 21 ++++++++++++--------- 2 files changed, 18 insertions(+), 23 deletions(-)
diff --git a/dlls/msvcrt/tests/environ.c b/dlls/msvcrt/tests/environ.c index 3d6b55dffa8..22f697a12ea 100644 --- a/dlls/msvcrt/tests/environ.c +++ b/dlls/msvcrt/tests/environ.c @@ -95,14 +95,10 @@ static void test__environ(void) return; }
- /* Examine the returned pointer from __p__environ(), if available. */ - if (p__p__environ) - { - ok( *p__p__environ() == *p_environ, - "Expected _environ pointers to be identical\n" ); - } + if (sizeof(void*) != sizeof(int)) + ok( !p__p__environ, "__p__environ() should be 32-bit only\n"); else - skip( "__p__environ() is not available\n" ); + ok( *p__p__environ() == *p_environ, "Expected _environ pointers to be identical\n" );
if (p_get_environ) { @@ -158,14 +154,10 @@ static void test__wenviron(void) return; }
- /* Examine the returned pointer from __p__wenviron(), if available. */ - if (p__p__wenviron) - { - ok( *p__p__wenviron() == NULL, - "Expected _wenviron pointers to be NULL\n" ); - } + if (sizeof(void*) != sizeof(int)) + ok( !p__p__wenviron, "__p__wenviron() should be 32-bit only\n"); else - skip( "__p__wenviron() is not available\n" ); + ok( *p__p__wenviron() == NULL, "Expected _wenviron pointers to be NULL\n" );
if (p_get_wenviron) { diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c index d4e0ac40239..4ed17c940a9 100644 --- a/dlls/msvcrt/tests/time.c +++ b/dlls/msvcrt/tests/time.c @@ -590,15 +590,15 @@ static void test_daylight(void) return; }
- if (!p___p__daylight) + /* Examine the returned pointer from __p__environ(), if available. */ + if (sizeof(void*) != sizeof(int)) + ok( !p___p__daylight, "___p__daylight() should be 32-bit only\n"); + else { - skip("__p__daylight not available\n"); - return; + ret1 = p__daylight(); + ret2 = p___p__daylight(); + ok(ret1 && ret1 == ret2, "got %p\n", ret1); } - - ret1 = p__daylight(); - ret2 = p___p__daylight(); - ok(ret1 && ret1 == ret2, "got %p\n", ret1); }
static void test_strftime(void) @@ -907,8 +907,11 @@ static void test__tzset(void) char TZ_env[256]; int ret;
- if(!p___p__daylight || !p___p__timezone || !p___p__dstbias) { - skip("__p__daylight, __p__timezone or __p__dstbias is not available\n"); + if (sizeof(void*) != sizeof(int)) + { + ok(!p___p__daylight, "___p__daylight() should be 32-bit only\n"); + ok(!p___p__timezone, "___p__timezone() should be 32-bit only\n"); + ok(!p___p__dstbias, "___p__dstbias() should be 32-bit only\n"); return; }