winscard/tests: Implement test for two functions of winscard.dll

Sergey Stepanov serg_admin at rambler.ru
Thu May 5 22:16:02 CDT 2011


---
 configure                          |    1 +
 dlls/winscard/tests/Makefile.in    |    7 ++++++
 dlls/winscard/tests/winscard_api.c |   41 ++++++++++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+), 0 deletions(-)
 create mode 100644 dlls/winscard/tests/Makefile.in
 create mode 100644 dlls/winscard/tests/winscard_api.c

diff --git a/configure b/configure
index 4866321..41349da 100755
--- a/configure
+++ b/configure
@@ -15495,6 +15495,7 @@ wine_fn_config_test dlls/winmm/tests winmm_test
 wine_fn_config_dll winnls.dll16 enable_win16
 wine_fn_config_dll winnls32 enable_winnls32 implib
 wine_fn_config_dll winscard enable_winscard implib
+wine_fn_config_test dlls/winscard/tests winscard_test
 wine_fn_config_dll winsock.dll16 enable_win16
 wine_fn_config_dll winspool.drv enable_winspool_drv po,implib winspool
 wine_fn_config_test dlls/winspool.drv/tests winspool.drv_test
diff --git a/dlls/winscard/tests/Makefile.in b/dlls/winscard/tests/Makefile.in
new file mode 100644
index 0000000..aa58d2e
--- /dev/null
+++ b/dlls/winscard/tests/Makefile.in
@@ -0,0 +1,7 @@
+TESTDLL   = winscard.dll
+IMPORTS   = winscard
+
+C_SRCS = \
+	winscard_api.c
+
+ at MAKE_TEST_RULES@
diff --git a/dlls/winscard/tests/winscard_api.c b/dlls/winscard/tests/winscard_api.c
new file mode 100644
index 0000000..fa5a139
--- /dev/null
+++ b/dlls/winscard/tests/winscard_api.c
@@ -0,0 +1,41 @@
+/*
+ * Unit test suite for smart card Functions
+ *
+ * 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 <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winerror.h"
+#include "wingdi.h"
+#include "vfw.h"
+#include "wine/test.h"
+#include "winscard.h"
+
+
+START_TEST(winscard_api)
+{
+    SCARDCONTEXT context;
+    LONG EstablishContext_rezult;
+    LONG IsValidContext_rezult;
+    EstablishContext_rezult = SCardEstablishContext(0,NULL,NULL, &context);
+    ok(EstablishContext_rezult == SCARD_S_SUCCESS, "Can't connect to pcscd daemon %lx\n", EstablishContext_rezult);
+    IsValidContext_rezult = SCardIsValidContext(context);
+    ok((IsValidContext_rezult == SCARD_S_SUCCESS)||(IsValidContext_rezult == SCARD_E_INVALID_HANDLE),
+	"Error call SCardIsValidContext %lx\n", IsValidContext_rezult);
+}
-- 
1.7.4.4




More information about the wine-patches mailing list