inetmib1: Add tests for SnmpExtensionInit.

This commit is contained in:
Juan Lang 2008-05-20 20:48:37 -07:00 committed by Alexandre Julliard
parent 2cc8b7e5ce
commit cca77db0a6
9 changed files with 85 additions and 0 deletions

4
.gitignore vendored
View File

@ -158,6 +158,9 @@ dlls/inetcomm/libinetcomm.def
dlls/inetcomm/tests/*.ok
dlls/inetcomm/tests/inetcomm_crosstest.exe
dlls/inetcomm/tests/testlist.c
dlls/inetmib1/tests/*.ok
dlls/inetmib1/tests/inetmib1_crosstest.exe
dlls/inetmib1/tests/testlist.c
dlls/infosoft/tests/*.ok
dlls/infosoft/tests/infosoft_crosstest.exe
dlls/infosoft/tests/testlist.c
@ -642,6 +645,7 @@ programs/winetest/gdiplus_test.exe
programs/winetest/hlink_test.exe
programs/winetest/imm32_test.exe
programs/winetest/inetcomm_test.exe
programs/winetest/inetmib1_test.exe
programs/winetest/infosoft_test.exe
programs/winetest/iphlpapi_test.exe
programs/winetest/itss_test.exe

View File

@ -292,6 +292,7 @@ ALL_MAKEFILES = \
dlls/inetcomm/Makefile \
dlls/inetcomm/tests/Makefile \
dlls/inetmib1/Makefile \
dlls/inetmib1/tests/Makefile \
dlls/infosoft/Makefile \
dlls/infosoft/tests/Makefile \
dlls/initpki/Makefile \
@ -719,6 +720,7 @@ dlls/imm32/tests/Makefile: dlls/imm32/tests/Makefile.in dlls/Maketest.rules
dlls/inetcomm/Makefile: dlls/inetcomm/Makefile.in dlls/Makedll.rules
dlls/inetcomm/tests/Makefile: dlls/inetcomm/tests/Makefile.in dlls/Maketest.rules
dlls/inetmib1/Makefile: dlls/inetmib1/Makefile.in dlls/Makedll.rules
dlls/inetmib1/tests/Makefile: dlls/inetmib1/tests/Makefile.in dlls/Maketest.rules
dlls/infosoft/Makefile: dlls/infosoft/Makefile.in dlls/Makedll.rules
dlls/infosoft/tests/Makefile: dlls/infosoft/tests/Makefile.in dlls/Maketest.rules
dlls/initpki/Makefile: dlls/initpki/Makefile.in dlls/Makedll.rules

3
configure vendored
View File

@ -21782,6 +21782,8 @@ ac_config_files="$ac_config_files dlls/inetcomm/tests/Makefile"
ac_config_files="$ac_config_files dlls/inetmib1/Makefile"
ac_config_files="$ac_config_files dlls/inetmib1/tests/Makefile"
ac_config_files="$ac_config_files dlls/infosoft/Makefile"
ac_config_files="$ac_config_files dlls/infosoft/tests/Makefile"
@ -23046,6 +23048,7 @@ do
"dlls/inetcomm/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/inetcomm/Makefile" ;;
"dlls/inetcomm/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/inetcomm/tests/Makefile" ;;
"dlls/inetmib1/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/inetmib1/Makefile" ;;
"dlls/inetmib1/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/inetmib1/tests/Makefile" ;;
"dlls/infosoft/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/infosoft/Makefile" ;;
"dlls/infosoft/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/infosoft/tests/Makefile" ;;
"dlls/initpki/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/initpki/Makefile" ;;

View File

@ -1804,6 +1804,7 @@ AC_CONFIG_FILES([dlls/imm32/tests/Makefile])
AC_CONFIG_FILES([dlls/inetcomm/Makefile])
AC_CONFIG_FILES([dlls/inetcomm/tests/Makefile])
AC_CONFIG_FILES([dlls/inetmib1/Makefile])
AC_CONFIG_FILES([dlls/inetmib1/tests/Makefile])
AC_CONFIG_FILES([dlls/infosoft/Makefile])
AC_CONFIG_FILES([dlls/infosoft/tests/Makefile])
AC_CONFIG_FILES([dlls/initpki/Makefile])

View File

@ -311,6 +311,7 @@ TESTSUBDIRS = \
hlink/tests \
imm32/tests \
inetcomm/tests \
inetmib1/tests \
infosoft/tests \
iphlpapi/tests \
itss/tests \

View File

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

View File

@ -0,0 +1,57 @@
/*
* Copyright 2008 Juan Lang
*
* 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 <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <snmp.h>
#include "wine/test.h"
static HMODULE inetmib1;
static void testInit(void)
{
BOOL (WINAPI *pInit)(DWORD, HANDLE *, AsnObjectIdentifier *);
BOOL ret;
HANDLE event;
AsnObjectIdentifier oid;
pInit = (void *)GetProcAddress(inetmib1, "SnmpExtensionInit");
if (!pInit)
{
skip("no SnmpExtensionInit\n");
return;
}
/* Crash
ret = pInit(0, NULL, NULL);
ret = pInit(0, NULL, &oid);
ret = pInit(0, &event, NULL);
*/
ret = pInit(0, &event, &oid);
ok(ret, "SnmpExtensionInit failed: %d\n", GetLastError());
todo_wine
ok(!strcmp("1.3.6.1.2.1.1", SnmpUtilOidToA(&oid)),
"Expected 1.3.6.1.2.1.1, got %s\n", SnmpUtilOidToA(&oid));
}
START_TEST(main)
{
inetmib1 = LoadLibraryA("inetmib1");
testInit();
}

View File

@ -50,6 +50,7 @@ TESTBINS = \
hlink_test.exe \
imm32_test.exe \
inetcomm_test.exe \
inetmib1_test.exe \
infosoft_test.exe \
iphlpapi_test.exe \
itss_test.exe \
@ -157,6 +158,8 @@ imm32_test.exe: $(DLLDIR)/imm32/tests/imm32_test.exe$(DLLEXT)
cp $(DLLDIR)/imm32/tests/imm32_test.exe$(DLLEXT) $@ && $(STRIP) $@
inetcomm_test.exe: $(DLLDIR)/inetcomm/tests/inetcomm_test.exe$(DLLEXT)
cp $(DLLDIR)/inetcomm/tests/inetcomm_test.exe$(DLLEXT) $@ && $(STRIP) $@
inetmib1_test.exe: $(DLLDIR)/inetmib1/tests/inetmib1_test.exe$(DLLEXT)
cp $(DLLDIR)/inetmib1/tests/inetmib1_test.exe$(DLLEXT) $@ && $(STRIP) $@
infosoft_test.exe: $(DLLDIR)/infosoft/tests/infosoft_test.exe$(DLLEXT)
cp $(DLLDIR)/infosoft/tests/infosoft_test.exe$(DLLEXT) $@ && $(STRIP) $@
iphlpapi_test.exe: $(DLLDIR)/iphlpapi/tests/iphlpapi_test.exe$(DLLEXT)

View File

@ -111,6 +111,7 @@ gdiplus_test.exe TESTRES "gdiplus_test.exe"
hlink_test.exe TESTRES "hlink_test.exe"
imm32_test.exe TESTRES "imm32_test.exe"
inetcomm_test.exe TESTRES "inetcomm_test.exe"
inetmib1_test.exe TESTRES "inetmib1_test.exe"
infosoft_test.exe TESTRES "infosoft_test.exe"
iphlpapi_test.exe TESTRES "iphlpapi_test.exe"
itss_test.exe TESTRES "itss_test.exe"