Header and header.

This commit is contained in:
Bandie 2018-05-11 04:18:34 +02:00
parent b7cb4c0b81
commit 72e62a95a1
Signed by: Bandie
GPG Key ID: C1E133BC65A822DD
3 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,6 @@
CFLAGS += -DTEST
bin_PROGRAMS = test
test_SOURCES = test.h ../src/pam_panic/pam_panic_authdevice.c ../src/pam_panic/pam_panic_reject.c test.c
test_SOURCES = ../src/pam_panic/pam_panic_authdevice.c ../src/pam_panic/pam_panic_reject.c test.c
test_LDFLAGS = -lpam -lcunit
all:

View File

@ -1,10 +1,18 @@
/*
FILENAME : test.c
DESCRIPTION : Test suites with CUnit for pam_panic
AUTHOR : Bandie
DATE : 2018-05-11T04:13:51+02:00
LICENSE : GNU-GPLv3
*/
#include <stdint.h>
#include <unistd.h>
#include <security/pam_modules.h>
#include "../src/pam_panic/pam_panic_authdevice.h"
#include "../src/pam_panic/pam_panic_reject.h"
#include <CUnit/Basic.h>
#include <CUnit/TestRun.h>
#define STATE_GOOD 0
#define STATE_BAD 99
@ -36,7 +44,6 @@ void test_authDeviceGood(void) {
fclose(f);
int ret = authDevice(NULL, gU, bU, NULL, 0, 0, 0);
printf("%d\n", ret);
CU_ASSERT_EQUAL(ret, STATE_GOOD);
unlink(gU);
}

View File

@ -1 +0,0 @@
#define TEST