secur32: Add fixed test for SSPI functionality.

Kai Blin blin at gmx.net
Wed Aug 3 05:13:49 CDT 2005


This test will run both on wine and win32, testing
QuerySecurityPackageInfoA(). The patch is to set up the test environment
for secur32.dll.

ChangeLog:
Kai Blin <blin at gmx.net> Set up tests for secur32

-- 
Kai Blin, (blin at gmx dot net)
"It might help if we ran the MBA's out of Washington."
-- Admiral Grace Hopper
-------------- next part --------------
Index: configure.ac
===================================================================
RCS file: /home/wine/wine/configure.ac,v
retrieving revision 1.384
diff -u -3 -r1.384 configure.ac
--- configure.ac	2 Aug 2005 11:29:05 -0000	1.384
+++ configure.ac	2 Aug 2005 23:47:49 -0000
@@ -1698,6 +1698,7 @@
 dlls/rsaenh/Makefile
 dlls/rsaenh/tests/Makefile
 dlls/secur32/Makefile
+dlls/secur32/tests/Makefile
 dlls/sensapi/Makefile
 dlls/serialui/Makefile
 dlls/setupapi/Makefile
Index: dlls/secur32/Makefile.in
===================================================================
RCS file: /home/wine/wine/dlls/secur32/Makefile.in,v
retrieving revision 1.3
diff -u -3 -r1.3 Makefile.in
--- dlls/secur32/Makefile.in	13 May 2005 17:44:47 -0000	1.3
+++ dlls/secur32/Makefile.in	2 Aug 2005 23:48:00 -0000
@@ -12,6 +12,8 @@
 	thunks.c \
 	wrapper.c
 
+SUBDIRS = tests
+
 @MAKE_DLL_RULES@
 
 ### Dependencies:
--- /dev/null	2004-02-19 15:43:50.000000000 +0100
+++ dlls/secur32/tests/Makefile.in	2005-08-03 01:45:18.516848056 +0200
@@ -0,0 +1,13 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+TESTDLL   = secur32.dll
+IMPORTS   = secur32
+
+CTESTS = \
+	main.c
+
+ at MAKE_TEST_RULES@
+
+### Dependencies:
--- /dev/null	2004-02-19 15:43:50.000000000 +0100
+++ dlls/secur32/tests/main.c	2005-08-03 12:05:54.615961976 +0200
@@ -0,0 +1,57 @@
+/*
+ * Miscellaneous secur32 tests
+ *
+ * Copyright 2005 Kai Blin
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <windows.h>
+#include <winsock2.h>
+#include <mswsock.h>
+#include "wine/test.h"
+#include <winbase.h>
+#include <sspi.h>
+
+#define BUFF_SIZE 2048
+
+
+static void testQuerySecurityPackageInfo(void)
+{
+    SECURITY_STATUS     sec_status = 0;
+    SEC_CHAR            *sec_pkg_name = NULL;
+    PSecPkgInfo         pkg_info;
+    PBYTE               input_buffer = NULL;
+    PBYTE               output_buffer = NULL;
+    DWORD               max_token;
+    
+    lstrcpy(sec_pkg_name, "Negotiate");
+    
+    sec_status = QuerySecurityPackageInfo( sec_pkg_name, &pkg_info);
+
+    ok(sec_status != SEC_E_OK, 
+       "Return value of QuerySecurityPackageInfo() should be %d, but is %d\n",
+       (int)SEC_E_OK, (int)sec_status );
+
+    max_token = pkg_info->cbMaxToken;
+    printf("Max token = %ld\n", max_token);
+}
+
+START_TEST(main)
+{
+    testQuerySecurityPackageInfo();
+}


More information about the wine-patches mailing list