pdh: Add tests for opening and closing queries.

This commit is contained in:
Hans Leidekker 2007-07-08 14:06:08 +02:00 committed by Alexandre Julliard
parent 8f28d4369e
commit 0a6f6874af
10 changed files with 88 additions and 0 deletions

5
.gitignore vendored
View File

@ -431,6 +431,10 @@ dlls/olesvr.dll16
dlls/olesvr32/libolesvr32.def
dlls/opengl32/libopengl32.def
dlls/opengl32/version.res
dlls/pdh/libpdh.def
dlls/pdh/tests/*.ok
dlls/pdh/tests/pdh_crosstest.exe
dlls/pdh/tests/testlist.c
dlls/powrprof/libpowrprof.def
dlls/printui/printui.res
dlls/psapi/libpsapi.def
@ -883,6 +887,7 @@ programs/winetest/ntprint_test.exe
programs/winetest/odbccp32_test.exe
programs/winetest/ole32_test.exe
programs/winetest/oleaut32_test.exe
programs/winetest/pdh_test.exe
programs/winetest/psapi_test.exe
programs/winetest/quartz_test.exe
programs/winetest/riched20_test.exe

View File

@ -332,6 +332,7 @@ ALL_MAKEFILES = \
dlls/olesvr32/Makefile \
dlls/opengl32/Makefile \
dlls/pdh/Makefile \
dlls/pdh/tests/Makefile \
dlls/powrprof/Makefile \
dlls/printui/Makefile \
dlls/psapi/Makefile \
@ -690,6 +691,7 @@ dlls/olepro32/Makefile: dlls/olepro32/Makefile.in dlls/Makedll.rules
dlls/olesvr32/Makefile: dlls/olesvr32/Makefile.in dlls/Makedll.rules
dlls/opengl32/Makefile: dlls/opengl32/Makefile.in dlls/Makedll.rules
dlls/pdh/Makefile: dlls/pdh/Makefile.in dlls/Makedll.rules
dlls/pdh/tests/Makefile: dlls/pdh/tests/Makefile.in dlls/Maketest.rules
dlls/powrprof/Makefile: dlls/powrprof/Makefile.in dlls/Makedll.rules
dlls/printui/Makefile: dlls/printui/Makefile.in dlls/Makedll.rules
dlls/psapi/Makefile: dlls/psapi/Makefile.in dlls/Makedll.rules

3
configure vendored
View File

@ -20471,6 +20471,8 @@ ac_config_files="$ac_config_files dlls/opengl32/Makefile"
ac_config_files="$ac_config_files dlls/pdh/Makefile"
ac_config_files="$ac_config_files dlls/pdh/tests/Makefile"
ac_config_files="$ac_config_files dlls/powrprof/Makefile"
ac_config_files="$ac_config_files dlls/printui/Makefile"
@ -21549,6 +21551,7 @@ do
"dlls/olesvr32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/olesvr32/Makefile" ;;
"dlls/opengl32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/opengl32/Makefile" ;;
"dlls/pdh/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/pdh/Makefile" ;;
"dlls/pdh/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/pdh/tests/Makefile" ;;
"dlls/powrprof/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/powrprof/Makefile" ;;
"dlls/printui/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/printui/Makefile" ;;
"dlls/psapi/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/psapi/Makefile" ;;

View File

@ -1661,6 +1661,7 @@ AC_CONFIG_FILES([dlls/olepro32/Makefile])
AC_CONFIG_FILES([dlls/olesvr32/Makefile])
AC_CONFIG_FILES([dlls/opengl32/Makefile])
AC_CONFIG_FILES([dlls/pdh/Makefile])
AC_CONFIG_FILES([dlls/pdh/tests/Makefile])
AC_CONFIG_FILES([dlls/powrprof/Makefile])
AC_CONFIG_FILES([dlls/printui/Makefile])
AC_CONFIG_FILES([dlls/psapi/Makefile])

View File

@ -274,6 +274,7 @@ TESTSUBDIRS = \
odbccp32/tests \
ole32/tests \
oleaut32/tests \
pdh/tests \
psapi/tests \
quartz/tests \
riched20/tests \
@ -550,6 +551,7 @@ IMPORT_LIBS = \
olepro32/libolepro32.$(IMPLIBEXT) \
olesvr32/libolesvr32.$(IMPLIBEXT) \
opengl32/libopengl32.$(IMPLIBEXT) \
pdh/libpdh.$(IMPLIBEXT) \
powrprof/libpowrprof.$(IMPLIBEXT) \
psapi/libpsapi.$(IMPLIBEXT) \
quartz/libquartz.$(IMPLIBEXT) \
@ -840,6 +842,9 @@ olesvr32/libolesvr32.$(IMPLIBEXT): olesvr32/olesvr32.spec $(WINEBUILD)
opengl32/libopengl32.$(IMPLIBEXT): opengl32/opengl32.spec $(WINEBUILD)
@cd opengl32 && $(MAKE) libopengl32.$(IMPLIBEXT)
pdh/libpdh.$(IMPLIBEXT): pdh/pdh.spec $(WINEBUILD)
@cd pdh && $(MAKE) libpdh.$(IMPLIBEXT)
powrprof/libpowrprof.$(IMPLIBEXT): powrprof/powrprof.spec $(WINEBUILD)
@cd powrprof && $(MAKE) libpowrprof.$(IMPLIBEXT)

View File

@ -3,6 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = pdh.dll
IMPORTLIB = libpdh.$(IMPLIBEXT)
IMPORTS = kernel32
C_SRCS = \

View File

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

54
dlls/pdh/tests/pdh.c Normal file
View File

@ -0,0 +1,54 @@
/*
* Tests for pdh.dll (Performance Data Helper)
*
* Copyright 2007 Hans Leidekker
*
* 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 <stdio.h>
#include "windows.h"
#include "pdh.h"
#include "pdhmsg.h"
#include "wine/test.h"
static void test_open_close_query( void )
{
PDH_STATUS ret;
PDH_HQUERY query;
ret = PdhOpenQueryA( NULL, 0, NULL );
ok(ret == PDH_INVALID_ARGUMENT, "PdhOpenQueryA failed 0x%08x\n", ret);
ret = PdhOpenQueryA( NULL, 0, &query );
ok(ret == ERROR_SUCCESS, "PdhOpenQueryA failed 0x%08x\n", ret);
ret = PdhCloseQuery( NULL );
ok(ret == PDH_INVALID_HANDLE, "PdhCloseQuery failed 0x%08x\n", ret);
ret = PdhCloseQuery( &query );
ok(ret == PDH_INVALID_HANDLE, "PdhCloseQuery failed 0x%08x\n", ret);
ret = PdhCloseQuery( query );
ok(ret == ERROR_SUCCESS, "PdhCloseQuery failed 0x%08x\n", ret);
}
START_TEST(pdh)
{
test_open_close_query();
}

View File

@ -64,6 +64,7 @@ TESTBINS = \
odbccp32_test.exe \
ole32_test.exe \
oleaut32_test.exe \
pdh_test.exe \
psapi_test.exe \
quartz_test.exe \
riched20_test.exe \
@ -171,6 +172,8 @@ ole32_test.exe: $(DLLDIR)/ole32/tests/ole32_test.exe$(DLLEXT)
cp $(DLLDIR)/ole32/tests/ole32_test.exe$(DLLEXT) $@ && $(STRIP) $@
oleaut32_test.exe: $(DLLDIR)/oleaut32/tests/oleaut32_test.exe$(DLLEXT)
cp $(DLLDIR)/oleaut32/tests/oleaut32_test.exe$(DLLEXT) $@ && $(STRIP) $@
pdh_test.exe: $(DLLDIR)/pdh/tests/pdh_test.exe$(DLLEXT)
cp $(DLLDIR)/pdh/tests/pdh_test.exe$(DLLEXT) $@ && $(STRIP) $@
psapi_test.exe: $(DLLDIR)/psapi/tests/psapi_test.exe$(DLLEXT)
cp $(DLLDIR)/psapi/tests/psapi_test.exe$(DLLEXT) $@ && $(STRIP) $@
quartz_test.exe: $(DLLDIR)/quartz/tests/quartz_test.exe$(DLLEXT)

View File

@ -187,6 +187,7 @@ ntprint_test.exe TESTRES "ntprint_test.exe"
odbccp32_test.exe TESTRES "odbccp32_test.exe"
ole32_test.exe TESTRES "ole32_test.exe"
oleaut32_test.exe TESTRES "oleaut32_test.exe"
pdh_test.exe TESTRES "pdh_test.exe"
psapi_test.exe TESTRES "psapi_test.exe"
quartz_test.exe TESTRES "quartz_test.exe"
riched20_test.exe TESTRES "riched20_test.exe"