Module: wine Branch: stable Commit: 14349f4f78336ea85d3933ed9ee572ab2b790f21 URL: https://source.winehq.org/git/wine.git/?a=commit;h=14349f4f78336ea85d3933ed9...
Author: Vijay Kiran Kamuju infyquest@gmail.com Date: Wed Apr 29 19:45:01 2020 +0200
msasn1/tests: Add initial tests.
Signed-off-by: Vijay Kiran Kamuju infyquest@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit 4e2ad334b5881af7661be4d6df3c51aae92ca4a2) Signed-off-by: Michael Stefaniuc mstefani@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 b3a56d1a35f..05194a51d2f 100755 --- a/configure +++ b/configure @@ -20611,6 +20611,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 5e363315967..95730668e92 100644 --- a/configure.ac +++ b/configure.ac @@ -3422,6 +3422,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 00000000000..395ef933c0d --- /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 00000000000..19019fc72b0 --- /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(); +}