userenv: Add initial tests for CreateEnvironmentBlock.

This commit is contained in:
Lei Zhang 2008-04-29 18:09:24 -07:00 committed by Alexandre Julliard
parent e35c79efbf
commit ffb0457982
10 changed files with 93 additions and 0 deletions

5
.gitignore vendored
View File

@ -419,6 +419,10 @@ dlls/user32/libuser32.def
dlls/user32/tests/*.ok
dlls/user32/tests/testlist.c
dlls/user32/tests/user32_crosstest.exe
dlls/userenv/libuserenv.def
dlls/userenv/tests/*.ok
dlls/userenv/tests/testlist.c
dlls/userenv/tests/userenv_crosstest.exe
dlls/usp10/libusp10.def
dlls/usp10/tests/*.ok
dlls/usp10/tests/testlist.c
@ -681,6 +685,7 @@ programs/winetest/snmpapi_test.exe
programs/winetest/spoolss_test.exe
programs/winetest/urlmon_test.exe
programs/winetest/user32_test.exe
programs/winetest/userenv_test.exe
programs/winetest/usp10_test.exe
programs/winetest/uxtheme_test.exe
programs/winetest/version_test.exe

View File

@ -459,6 +459,7 @@ ALL_MAKEFILES = \
dlls/user32/Makefile \
dlls/user32/tests/Makefile \
dlls/userenv/Makefile \
dlls/userenv/tests/Makefile \
dlls/usp10/Makefile \
dlls/usp10/tests/Makefile \
dlls/uuid/Makefile \
@ -884,6 +885,7 @@ dlls/urlmon/tests/Makefile: dlls/urlmon/tests/Makefile.in dlls/Maketest.rules
dlls/user32/Makefile: dlls/user32/Makefile.in dlls/Makedll.rules
dlls/user32/tests/Makefile: dlls/user32/tests/Makefile.in dlls/Maketest.rules
dlls/userenv/Makefile: dlls/userenv/Makefile.in dlls/Makedll.rules
dlls/userenv/tests/Makefile: dlls/userenv/tests/Makefile.in dlls/Maketest.rules
dlls/usp10/Makefile: dlls/usp10/Makefile.in dlls/Makedll.rules
dlls/usp10/tests/Makefile: dlls/usp10/tests/Makefile.in dlls/Maketest.rules
dlls/uuid/Makefile: dlls/uuid/Makefile.in dlls/Makeimplib.rules

3
configure vendored
View File

@ -22077,6 +22077,8 @@ ac_config_files="$ac_config_files dlls/user32/tests/Makefile"
ac_config_files="$ac_config_files dlls/userenv/Makefile"
ac_config_files="$ac_config_files dlls/userenv/tests/Makefile"
ac_config_files="$ac_config_files dlls/usp10/Makefile"
ac_config_files="$ac_config_files dlls/usp10/tests/Makefile"
@ -23170,6 +23172,7 @@ do
"dlls/user32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/user32/Makefile" ;;
"dlls/user32/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/user32/tests/Makefile" ;;
"dlls/userenv/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/userenv/Makefile" ;;
"dlls/userenv/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/userenv/tests/Makefile" ;;
"dlls/usp10/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/usp10/Makefile" ;;
"dlls/usp10/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/usp10/tests/Makefile" ;;
"dlls/uuid/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/uuid/Makefile" ;;

View File

@ -1977,6 +1977,7 @@ AC_CONFIG_FILES([dlls/urlmon/tests/Makefile])
AC_CONFIG_FILES([dlls/user32/Makefile])
AC_CONFIG_FILES([dlls/user32/tests/Makefile])
AC_CONFIG_FILES([dlls/userenv/Makefile])
AC_CONFIG_FILES([dlls/userenv/tests/Makefile])
AC_CONFIG_FILES([dlls/usp10/Makefile])
AC_CONFIG_FILES([dlls/usp10/tests/Makefile])
AC_CONFIG_FILES([dlls/uuid/Makefile])

View File

@ -355,6 +355,7 @@ TESTSUBDIRS = \
spoolss/tests \
urlmon/tests \
user32/tests \
userenv/tests \
usp10/tests \
uxtheme/tests \
version/tests \
@ -650,6 +651,7 @@ IMPORT_LIBS = \
url/liburl.$(IMPLIBEXT) \
urlmon/liburlmon.$(IMPLIBEXT) \
user32/libuser32.$(IMPLIBEXT) \
userenv/libuserenv.$(IMPLIBEXT) \
usp10/libusp10.$(IMPLIBEXT) \
uxtheme/libuxtheme.$(IMPLIBEXT) \
vdmdbg/libvdmdbg.$(IMPLIBEXT) \
@ -1013,6 +1015,9 @@ urlmon/liburlmon.$(IMPLIBEXT): urlmon/urlmon.spec $(WINEBUILD)
user32/libuser32.$(IMPLIBEXT): user32/user32.spec $(WINEBUILD)
@cd user32 && $(MAKE) libuser32.$(IMPLIBEXT)
userenv/libuserenv.$(IMPLIBEXT): userenv/userenv.spec $(WINEBUILD)
@cd userenv && $(MAKE) libuserenv.$(IMPLIBEXT)
usp10/libusp10.$(IMPLIBEXT): usp10/usp10.spec $(WINEBUILD)
@cd usp10 && $(MAKE) libusp10.$(IMPLIBEXT)

View File

@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = userenv.dll
IMPORTS = kernel32
IMPORTLIB = userenv
C_SRCS = \
userenv_main.c

View File

@ -0,0 +1,13 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = userenv.dll
IMPORTS = userenv advapi32 kernel32
CTESTS = \
userenv.c
@MAKE_TEST_RULES@
@DEPENDENCIES@ # everything below this line is overwritten by make depend

View File

@ -0,0 +1,59 @@
/*
* Unit test suite for userenv functions
*
* Copyright 2008 Google (Lei Zhang)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdlib.h>
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "userenv.h"
#include "wine/test.h"
#define expect(EXPECTED,GOT) ok((GOT)==(EXPECTED), "Expected %d, got %d\n", (EXPECTED), (GOT))
static void test_create_env(void)
{
BOOL r;
HANDLE htok;
WCHAR * env;
WCHAR * env2;
r = CreateEnvironmentBlock(NULL, NULL, FALSE);
expect(FALSE, r);
r = CreateEnvironmentBlock((LPVOID) &env, NULL, FALSE);
todo_wine expect(TRUE, r);
r = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY|TOKEN_DUPLICATE, &htok);
expect(TRUE, r);
r = CreateEnvironmentBlock(NULL, htok, FALSE);
expect(FALSE, r);
r = CreateEnvironmentBlock((LPVOID) &env2, htok, FALSE);
todo_wine expect(TRUE, r);
}
START_TEST(userenv)
{
test_create_env();
}

View File

@ -95,6 +95,7 @@ TESTBINS = \
spoolss_test.exe \
urlmon_test.exe \
user32_test.exe \
userenv_test.exe \
usp10_test.exe \
uxtheme_test.exe \
version_test.exe \
@ -246,6 +247,8 @@ urlmon_test.exe: $(DLLDIR)/urlmon/tests/urlmon_test.exe$(DLLEXT)
cp $(DLLDIR)/urlmon/tests/urlmon_test.exe$(DLLEXT) $@ && $(STRIP) $@
user32_test.exe: $(DLLDIR)/user32/tests/user32_test.exe$(DLLEXT)
cp $(DLLDIR)/user32/tests/user32_test.exe$(DLLEXT) $@ && $(STRIP) $@
userenv_test.exe: $(DLLDIR)/userenv/tests/userenv_test.exe$(DLLEXT)
cp $(DLLDIR)/userenv/tests/userenv_test.exe$(DLLEXT) $@ && $(STRIP) $@
usp10_test.exe: $(DLLDIR)/usp10/tests/usp10_test.exe$(DLLEXT)
cp $(DLLDIR)/usp10/tests/usp10_test.exe$(DLLEXT) $@ && $(STRIP) $@
uxtheme_test.exe: $(DLLDIR)/uxtheme/tests/uxtheme_test.exe$(DLLEXT)

View File

@ -156,6 +156,7 @@ snmpapi_test.exe TESTRES "snmpapi_test.exe"
spoolss_test.exe TESTRES "spoolss_test.exe"
urlmon_test.exe TESTRES "urlmon_test.exe"
user32_test.exe TESTRES "user32_test.exe"
userenv_test.exe TESTRES "userenv_test.exe"
usp10_test.exe TESTRES "usp10_test.exe"
uxtheme_test.exe TESTRES "uxtheme_test.exe"
version_test.exe TESTRES "version_test.exe"