Vijay Kiran Kamuju : msasn1/tests: Add initial tests.
Alexandre Julliard
julliard at winehq.org
Mon May 4 15:49:18 CDT 2020
Module: wine
Branch: master
Commit: 4e2ad334b5881af7661be4d6df3c51aae92ca4a2
URL: https://source.winehq.org/git/wine.git/?a=commit;h=4e2ad334b5881af7661be4d6df3c51aae92ca4a2
Author: Vijay Kiran Kamuju <infyquest at gmail.com>
Date: Wed Apr 29 19:45:01 2020 +0200
msasn1/tests: Add initial tests.
Signed-off-by: Vijay Kiran Kamuju <infyquest at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
configure | 1 +
configure.ac | 1 +
dlls/msasn1/tests/Makefile.in | 5 ++++
dlls/msasn1/tests/asn1.c | 58 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 65 insertions(+)
diff --git a/configure b/configure
index b94c0ce7aa..3da5851930 100755
--- a/configure
+++ b/configure
@@ -20760,6 +20760,7 @@ wine_fn_config_makefile dlls/msado15 enable_msado15
wine_fn_config_makefile dlls/msado15/tests enable_tests
wine_fn_config_makefile dlls/msadp32.acm enable_msadp32_acm
wine_fn_config_makefile dlls/msasn1 enable_msasn1
+wine_fn_config_makefile dlls/msasn1/tests enable_tests
wine_fn_config_makefile dlls/mscat32 enable_mscat32
wine_fn_config_makefile dlls/mscms enable_mscms
wine_fn_config_makefile dlls/mscms/tests enable_tests
diff --git a/configure.ac b/configure.ac
index 3d0c88fd9d..27db99f304 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3438,6 +3438,7 @@ WINE_CONFIG_MAKEFILE(dlls/msado15)
WINE_CONFIG_MAKEFILE(dlls/msado15/tests)
WINE_CONFIG_MAKEFILE(dlls/msadp32.acm)
WINE_CONFIG_MAKEFILE(dlls/msasn1)
+WINE_CONFIG_MAKEFILE(dlls/msasn1/tests)
WINE_CONFIG_MAKEFILE(dlls/mscat32)
WINE_CONFIG_MAKEFILE(dlls/mscms)
WINE_CONFIG_MAKEFILE(dlls/mscms/tests)
diff --git a/dlls/msasn1/tests/Makefile.in b/dlls/msasn1/tests/Makefile.in
new file mode 100644
index 0000000000..395ef933c0
--- /dev/null
+++ b/dlls/msasn1/tests/Makefile.in
@@ -0,0 +1,5 @@
+TESTDLL = msasn1.dll
+IMPORTS = msasn1
+
+C_SRCS = \
+ asn1.c
diff --git a/dlls/msasn1/tests/asn1.c b/dlls/msasn1/tests/asn1.c
new file mode 100644
index 0000000000..19019fc72b
--- /dev/null
+++ b/dlls/msasn1/tests/asn1.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2020 Vijay Kiran Kamuju
+ *
+ * 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 <stdio.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "msasn1.h"
+#include "wine/test.h"
+
+static void test_CreateModule(void)
+{
+ const ASN1GenericFun_t encfn[] = { NULL };
+ const ASN1GenericFun_t decfn[] = { NULL };
+ const ASN1FreeFun_t freefn[] = { NULL };
+ const ASN1uint32_t size[] = { 0 };
+ ASN1magic_t name = 0x61736e31;
+ ASN1module_t mod;
+
+ mod = ASN1_CreateModule(0, 0, 0, 0, NULL, NULL, NULL, NULL, 0);
+ ok(!mod, "Expected Failure.\n");
+
+ mod = ASN1_CreateModule(0, 0, 0, 0, encfn, NULL, NULL, NULL, 0);
+ ok(!mod, "Expected Failure.\n");
+
+ mod = ASN1_CreateModule(0, 0, 0, 0, encfn, decfn, NULL, NULL, 0);
+ ok(!mod, "Expected Failure.\n");
+
+ mod = ASN1_CreateModule(0, 0, 0, 0, encfn, decfn, freefn, NULL, 0);
+ ok(!mod, "Expected Failure.\n");
+
+ mod = ASN1_CreateModule(0, 0, 0, 0, encfn, decfn, freefn, size, 0);
+ todo_wine ok(!!mod, "Failed to create module.\n");
+
+ mod = ASN1_CreateModule(ASN1_THIS_VERSION, ASN1_BER_RULE_DER, ASN1FLAGS_NOASSERT, 1, encfn, decfn, freefn, size, name);
+ todo_wine ok(!!mod, "Failed to create module.\n");
+}
+
+START_TEST(asn1)
+{
+ test_CreateModule();
+}
More information about the wine-cvs
mailing list