Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
8b01f4ae
Commit
8b01f4ae
authored
Oct 21, 2008
by
Paul Vriens
Committed by
Alexandre Julliard
Oct 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userenv/tests: Rewrite the test to cope with multiple blocks of tests.
parent
c19b967c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
67 deletions
+29
-67
userenv.c
dlls/userenv/tests/userenv.c
+29
-67
No files found.
dlls/userenv/tests/userenv.c
View file @
8b01f4ae
...
@@ -157,7 +157,7 @@ static void test_create_env(void)
...
@@ -157,7 +157,7 @@ static void test_create_env(void)
{
{
BOOL
r
;
BOOL
r
;
HANDLE
htok
;
HANDLE
htok
;
WCHAR
*
env
1
,
*
env2
,
*
env3
,
*
env4
;
WCHAR
*
env
[
4
]
;
char
*
st
;
char
*
st
;
int
i
,
j
;
int
i
,
j
;
...
@@ -175,15 +175,13 @@ static void test_create_env(void)
...
@@ -175,15 +175,13 @@ static void test_create_env(void)
{
"SystemDrive"
,
{
1
,
1
,
0
,
0
}
},
{
"SystemDrive"
,
{
1
,
1
,
0
,
0
}
},
{
"SystemRoot"
,
{
1
,
1
,
0
,
0
}
},
{
"SystemRoot"
,
{
1
,
1
,
0
,
0
}
},
{
"windir"
,
{
1
,
1
,
0
,
0
}
},
{
"windir"
,
{
1
,
1
,
0
,
0
}
},
{
"ProgramFiles"
,
{
1
,
1
,
0
,
0
}
},
{
"ProgramFiles"
,
{
1
,
1
,
0
,
0
}
}
{
0
,
{
0
,
0
,
0
,
0
}
}
};
};
static
const
struct
profile_item
htok_vars
[]
=
{
static
const
struct
profile_item
htok_vars
[]
=
{
{
"PATH"
,
{
1
,
1
,
0
,
0
}
},
{
"PATH"
,
{
1
,
1
,
0
,
0
}
},
{
"TEMP"
,
{
1
,
1
,
0
,
0
}
},
{
"TEMP"
,
{
1
,
1
,
0
,
0
}
},
{
"TMP"
,
{
1
,
1
,
0
,
0
}
},
{
"TMP"
,
{
1
,
1
,
0
,
0
}
},
{
"USERPROFILE"
,
{
1
,
1
,
0
,
0
}
},
{
"USERPROFILE"
,
{
1
,
1
,
0
,
0
}
}
{
0
,
{
0
,
0
,
0
,
0
}
}
};
};
r
=
SetEnvironmentVariableA
(
"WINE_XYZZY"
,
"ZZYZX"
);
r
=
SetEnvironmentVariableA
(
"WINE_XYZZY"
,
"ZZYZX"
);
...
@@ -206,87 +204,51 @@ static void test_create_env(void)
...
@@ -206,87 +204,51 @@ static void test_create_env(void)
expect
(
FALSE
,
r
);
expect
(
FALSE
,
r
);
}
}
r
=
CreateEnvironmentBlock
((
LPVOID
)
&
env
1
,
NULL
,
FALSE
);
r
=
CreateEnvironmentBlock
((
LPVOID
)
&
env
[
0
]
,
NULL
,
FALSE
);
expect
(
TRUE
,
r
);
expect
(
TRUE
,
r
);
r
=
CreateEnvironmentBlock
((
LPVOID
)
&
env
2
,
htok
,
FALSE
);
r
=
CreateEnvironmentBlock
((
LPVOID
)
&
env
[
1
]
,
htok
,
FALSE
);
expect
(
TRUE
,
r
);
expect
(
TRUE
,
r
);
r
=
CreateEnvironmentBlock
((
LPVOID
)
&
env
3
,
NULL
,
TRUE
);
r
=
CreateEnvironmentBlock
((
LPVOID
)
&
env
[
2
]
,
NULL
,
TRUE
);
expect
(
TRUE
,
r
);
expect
(
TRUE
,
r
);
r
=
CreateEnvironmentBlock
((
LPVOID
)
&
env
4
,
htok
,
TRUE
);
r
=
CreateEnvironmentBlock
((
LPVOID
)
&
env
[
3
]
,
htok
,
TRUE
);
expect
(
TRUE
,
r
);
expect
(
TRUE
,
r
);
/* Test for common environment variables */
/* Test for common environment variables */
i
=
0
;
for
(
i
=
0
;
i
<
sizeof
(
common_vars
)
/
sizeof
(
common_vars
[
0
]);
i
++
)
while
(
common_vars
[
i
].
name
)
{
{
j
=
0
;
for
(
j
=
0
;
j
<
4
;
j
++
)
r
=
get_env
(
env1
,
common_vars
[
i
].
name
,
&
st
);
{
if
(
common_vars
[
i
].
todo
[
j
])
r
=
get_env
(
env
[
j
],
common_vars
[
i
].
name
,
&
st
);
todo_wine
expect_env
(
TRUE
,
r
,
common_vars
[
i
].
name
);
if
(
common_vars
[
i
].
todo
[
j
])
else
todo_wine
expect_env
(
TRUE
,
r
,
common_vars
[
i
].
name
);
expect_env
(
TRUE
,
r
,
common_vars
[
i
].
name
);
else
j
++
;
expect_env
(
TRUE
,
r
,
common_vars
[
i
].
name
);
r
=
get_env
(
env2
,
common_vars
[
i
].
name
,
&
st
);
}
if
(
common_vars
[
i
].
todo
[
j
])
todo_wine
expect_env
(
TRUE
,
r
,
common_vars
[
i
].
name
);
else
expect_env
(
TRUE
,
r
,
common_vars
[
i
].
name
);
j
++
;
r
=
get_env
(
env3
,
common_vars
[
i
].
name
,
&
st
);
if
(
common_vars
[
i
].
todo
[
j
])
todo_wine
expect_env
(
TRUE
,
r
,
common_vars
[
i
].
name
);
else
expect_env
(
TRUE
,
r
,
common_vars
[
i
].
name
);
j
++
;
r
=
get_env
(
env4
,
common_vars
[
i
].
name
,
&
st
);
if
(
common_vars
[
i
].
todo
[
j
])
todo_wine
expect_env
(
TRUE
,
r
,
common_vars
[
i
].
name
);
else
expect_env
(
TRUE
,
r
,
common_vars
[
i
].
name
);
i
++
;
}
}
/* Test for environment variables with values that depends on htok */
/* Test for environment variables with values that depends on htok */
i
=
0
;
for
(
i
=
0
;
i
<
sizeof
(
htok_vars
)
/
sizeof
(
htok_vars
[
0
]);
i
++
)
while
(
htok_vars
[
i
].
name
)
{
{
j
=
0
;
for
(
j
=
0
;
j
<
4
;
j
++
)
r
=
get_env
(
env1
,
htok_vars
[
i
].
name
,
&
st
);
{
if
(
htok_vars
[
i
].
todo
[
j
])
r
=
get_env
(
env
[
j
],
htok_vars
[
i
].
name
,
&
st
);
todo_wine
expect_env
(
TRUE
,
r
,
htok_vars
[
i
].
name
);
if
(
htok_vars
[
i
].
todo
[
j
])
else
todo_wine
expect_env
(
TRUE
,
r
,
htok_vars
[
i
].
name
);
expect_env
(
TRUE
,
r
,
htok_vars
[
i
].
name
);
else
j
++
;
expect_env
(
TRUE
,
r
,
htok_vars
[
i
].
name
);
r
=
get_env
(
env2
,
htok_vars
[
i
].
name
,
&
st
);
}
if
(
htok_vars
[
i
].
todo
[
j
])
todo_wine
expect_env
(
TRUE
,
r
,
htok_vars
[
i
].
name
);
else
expect_env
(
TRUE
,
r
,
htok_vars
[
i
].
name
);
j
++
;
r
=
get_env
(
env3
,
htok_vars
[
i
].
name
,
&
st
);
if
(
htok_vars
[
i
].
todo
[
j
])
todo_wine
expect_env
(
TRUE
,
r
,
htok_vars
[
i
].
name
);
else
expect_env
(
TRUE
,
r
,
htok_vars
[
i
].
name
);
j
++
;
r
=
get_env
(
env4
,
htok_vars
[
i
].
name
,
&
st
);
if
(
htok_vars
[
i
].
todo
[
j
])
todo_wine
expect_env
(
TRUE
,
r
,
htok_vars
[
i
].
name
);
else
expect_env
(
TRUE
,
r
,
htok_vars
[
i
].
name
);
i
++
;
}
}
r
=
get_env
(
env
1
,
"WINE_XYZZY"
,
&
st
);
r
=
get_env
(
env
[
0
]
,
"WINE_XYZZY"
,
&
st
);
expect
(
FALSE
,
r
);
expect
(
FALSE
,
r
);
r
=
get_env
(
env
2
,
"WINE_XYZZY"
,
&
st
);
r
=
get_env
(
env
[
1
]
,
"WINE_XYZZY"
,
&
st
);
expect
(
FALSE
,
r
);
expect
(
FALSE
,
r
);
r
=
get_env
(
env
3
,
"WINE_XYZZY"
,
&
st
);
r
=
get_env
(
env
[
2
]
,
"WINE_XYZZY"
,
&
st
);
expect
(
TRUE
,
r
);
expect
(
TRUE
,
r
);
r
=
get_env
(
env
4
,
"WINE_XYZZY"
,
&
st
);
r
=
get_env
(
env
[
3
]
,
"WINE_XYZZY"
,
&
st
);
expect
(
TRUE
,
r
);
expect
(
TRUE
,
r
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment