Juan Lang : inetmib1: Add tests for SnmpExtensionInit.
Alexandre Julliard
julliard at winehq.org
Wed Jun 25 04:47:25 CDT 2008
Module: wine
Branch: master
Commit: cca77db0a6bdd2e88b84a8365a042eb7e79cc951
URL: http://source.winehq.org/git/wine.git/?a=commit;h=cca77db0a6bdd2e88b84a8365a042eb7e79cc951
Author: Juan Lang <juan.lang at gmail.com>
Date: Tue May 20 20:48:37 2008 -0700
inetmib1: Add tests for SnmpExtensionInit.
---
.gitignore | 4 +++
Makefile.in | 2 +
configure | 3 ++
configure.ac | 1 +
dlls/Makefile.in | 1 +
dlls/inetmib1/tests/Makefile.in | 13 +++++++++
dlls/inetmib1/tests/main.c | 57 +++++++++++++++++++++++++++++++++++++++
programs/winetest/Makefile.in | 3 ++
programs/winetest/winetest.rc | 1 +
9 files changed, 85 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index 36c5849..d546c2e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/Makefile.in b/Makefile.in
index 7d253fb..f2dbcfc 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -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
diff --git a/configure b/configure
index 4b5989c..e855076 100755
--- a/configure
+++ b/configure
@@ -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" ;;
diff --git a/configure.ac b/configure.ac
index 4810dc3..77287de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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])
diff --git a/dlls/Makefile.in b/dlls/Makefile.in
index 4cb06a8..9470561 100644
--- a/dlls/Makefile.in
+++ b/dlls/Makefile.in
@@ -311,6 +311,7 @@ TESTSUBDIRS = \
hlink/tests \
imm32/tests \
inetcomm/tests \
+ inetmib1/tests \
infosoft/tests \
iphlpapi/tests \
itss/tests \
diff --git a/dlls/inetmib1/tests/Makefile.in b/dlls/inetmib1/tests/Makefile.in
new file mode 100644
index 0000000..bd6f144
--- /dev/null
+++ b/dlls/inetmib1/tests/Makefile.in
@@ -0,0 +1,13 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../../..
+SRCDIR = @srcdir@
+VPATH = @srcdir@
+TESTDLL = inetmib1.dll
+IMPORTS = snmpapi kernel32
+
+CTESTS = \
+ main.c
+
+ at MAKE_TEST_RULES@
+
+ at DEPENDENCIES@ # everything below this line is overwritten by make depend
diff --git a/dlls/inetmib1/tests/main.c b/dlls/inetmib1/tests/main.c
new file mode 100644
index 0000000..80c763d
--- /dev/null
+++ b/dlls/inetmib1/tests/main.c
@@ -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();
+}
diff --git a/programs/winetest/Makefile.in b/programs/winetest/Makefile.in
index e7c6fb6..89e0f5d 100644
--- a/programs/winetest/Makefile.in
+++ b/programs/winetest/Makefile.in
@@ -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)
diff --git a/programs/winetest/winetest.rc b/programs/winetest/winetest.rc
index 05b28c3..5c78c8f 100644
--- a/programs/winetest/winetest.rc
+++ b/programs/winetest/winetest.rc
@@ -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"
More information about the wine-cvs
mailing list