From 5a270c0815d2384338b4bfbae351ab70d2b0bc4c Mon Sep 17 00:00:00 2001 From: "osboxes.org" Date: Wed, 19 Aug 2020 09:32:50 -0400 Subject: [PATCH] revised first test --- tests/unit/Makefile.am | 4 ++- tests/unit/cardcom_common.c | 56 ------------------------------------- tests/unit/testlib.h | 1 + 3 files changed, 4 insertions(+), 57 deletions(-) delete mode 100644 tests/unit/cardcom_common.c diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index df04addf6..1ec6d11ea 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -14,6 +14,7 @@ AM_CFLAGS = -I$(top_srcdir)/doc/sdk/include/v240 -I$(top_srcdir)/plugins_tools/u if NO_DIALOGS AM_CFLAGS += -DNO_DIALOGS endif +AM_CXXFLAGS = $(AM_CFLAGS) eject_card_SOURCES = eject.c eject_card_LDADD = $(COMMON_LIB) @@ -103,5 +104,6 @@ sign_state_LDADD = $(COMMON_LIB) wrong_init_SOURCES = wrong_init.c wrong_init_LDADD = $(COMMON_LIB) -cardcom_common_SOURCES = cardcom_common.c +cardcom_common_SOURCES = cardcom_common.cpp +cardcom_common_CXXFLAGS = -I$(top_srcdir)/cardcomm/pkcs11/src $(AM_CXXFLAGS) cardcom_common_LDADD = $(COMMON_LIB) diff --git a/tests/unit/cardcom_common.c b/tests/unit/cardcom_common.c deleted file mode 100644 index 8acc4c92d..000000000 --- a/tests/unit/cardcom_common.c +++ /dev/null @@ -1,56 +0,0 @@ -/* **************************************************************************** - - * eID Middleware Project. - * Copyright (C) 2014 FedICT. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License version - * 3.0 as published by the Free Software Foundation. - * - * This software 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 software; if not, see - * http://www.gnu.org/licenses/. - -**************************************************************************** */ -#ifdef WIN32 -#include -#pragma pack(push, cryptoki, 1) -#include "pkcs11.h" -#pragma pack(pop, cryptoki) -#else -#include -#include -#endif -#include -#include "testlib.h" -/*#include "common.h"*/ -TEST_FUNC(scardcom_common){ - return TEST_RV_SKIP; - /*if (typename(wstring_From_string("teststring")) =! TYPE_WSTRING){ - printf("not ok\n"); - return TEST_RV_FAIL; - } - - std::wstring testw = wstring_From_string("teststring"); - if (typename(string_From_wstring(testw)) =! TYPE_STRING){ - printf("not ok\n"); - return TEST_RV_FAIL; - } - - FILE *tfile = NULL - tfile.fopen("testfile.txt","w+") - if (_wfopen_s(tfile, wstring_From_string(std::string ("testfile.txt")), ...) > 0 ){ - printf("not ok\n"); - return TEST_RV_FAIL; - } - - fclose(tfile); - remove("testfile.txt"); - return TEST_RV_SKIP;*/ - } - diff --git a/tests/unit/testlib.h b/tests/unit/testlib.h index 9e9a6bed4..a4b8d1d3a 100644 --- a/tests/unit/testlib.h +++ b/tests/unit/testlib.h @@ -148,6 +148,7 @@ int sessions(void); int sessions_nocard(void); int sessioninfo(void); int slogin(void); +int scardcom_common(void); int nonsensible(void); int objects(void); int readdata(void);