From 86a0b2915a137debe3e2fe527fad1581b0ab806a Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Tue, 21 Oct 2008 22:06:33 +0200 Subject: [PATCH] userenv/tests: Skip a few tests on NT4. --- dlls/userenv/tests/userenv.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/dlls/userenv/tests/userenv.c b/dlls/userenv/tests/userenv.c index af6a4e1aa33..49491f7efdd 100644 --- a/dlls/userenv/tests/userenv.c +++ b/dlls/userenv/tests/userenv.c @@ -162,8 +162,6 @@ static void test_create_env(void) int i, j; static const struct profile_item common_vars[] = { - { "ALLUSERSPROFILE", { 1, 1, 0, 0 } }, - { "CommonProgramFiles", { 1, 1, 1, 1 } }, { "ComSpec", { 1, 1, 0, 0 } }, { "COMPUTERNAME", { 1, 1, 1, 1 } }, { "NUMBER_OF_PROCESSORS", { 1, 1, 0, 0 } }, @@ -174,7 +172,11 @@ static void test_create_env(void) { "PROCESSOR_REVISION", { 1, 1, 0, 0 } }, { "SystemDrive", { 1, 1, 0, 0 } }, { "SystemRoot", { 1, 1, 0, 0 } }, - { "windir", { 1, 1, 0, 0 } }, + { "windir", { 1, 1, 0, 0 } } + }; + static const struct profile_item common_post_nt4_vars[] = { + { "ALLUSERSPROFILE", { 1, 1, 0, 0 } }, + { "CommonProgramFiles", { 1, 1, 1, 1 } }, { "ProgramFiles", { 1, 1, 0, 0 } } }; static const struct profile_item htok_vars[] = { @@ -216,7 +218,7 @@ static void test_create_env(void) r = CreateEnvironmentBlock((LPVOID) &env[3], htok, TRUE); expect(TRUE, r); - /* Test for common environment variables */ + /* Test for common environment variables (NT4 and higher) */ for (i = 0; i < sizeof(common_vars)/sizeof(common_vars[0]); i++) { for (j = 0; j < 4; j++) @@ -229,6 +231,26 @@ static void test_create_env(void) } } + /* Test for common environment variables (post NT4) */ + if (!GetEnvironmentVariableA("ALLUSERSPROFILE", NULL, 0)) + { + win_skip("Some environment variables are not present on NT4\n"); + } + else + { + for (i = 0; i < sizeof(common_post_nt4_vars)/sizeof(common_post_nt4_vars[0]); i++) + { + for (j = 0; j < 4; j++) + { + r = get_env(env[j], common_post_nt4_vars[i].name, &st); + if (common_post_nt4_vars[i].todo[j]) + todo_wine expect_env(TRUE, r, common_post_nt4_vars[i].name); + else + expect_env(TRUE, r, common_post_nt4_vars[i].name); + } + } + } + /* Test for environment variables with values that depends on htok */ for (i = 0; i < sizeof(htok_vars)/sizeof(htok_vars[0]); i++) {