Move the test framework into its own subdirectory

This commit is contained in:
Dag-Erling Smørgrav 2015-10-04 07:49:48 +00:00 committed by des
parent ab8f712584
commit f8ebdbc14d
41 changed files with 50 additions and 44 deletions

View file

@ -167,6 +167,7 @@ AC_CONFIG_FILES([
lib/oath/Makefile
lib/rand/Makefile
lib/rsaref/Makefile
lib/test/Makefile
t/Makefile
])
AC_CONFIG_FILES([mkpkgng], [chmod +x mkpkgng])

View file

@ -41,6 +41,7 @@ cryb_HEADERS = \
strlcat.h \
strlcmp.h \
strlcpy.h \
test.h \
to.h \
totp.h \
version.h \

View file

@ -27,8 +27,10 @@
* SUCH DAMAGE.
*/
#ifndef T_H_INCLUDED
#define T_H_INCLUDED
#ifndef CRYB_TEST_H_INCLUDED
#define CRYB_TEST_H_INCLUDED
#include <cryb/coverage.h>
CRYB_DISABLE_COVERAGE

View file

@ -8,7 +8,8 @@ SUBDIRS = \
mac \
mpi \
oath \
rand
rand \
test
if WITH_RSAREF
SUBDIRS += rsaref

View file

@ -316,8 +316,10 @@ aes_setkey_enc(aes_ctx *ctx, const uint8_t *key, int keysize)
case 32:
ctx->nr = 14;
break;
CRYB_DISABLE_COVERAGE
default:
return;
CRYB_RESTORE_COVERAGE
}
ctx->rk = RK = ctx->buf;
for (i = 0; i < (keysize >> 2); i++)
@ -371,8 +373,10 @@ aes_setkey_enc(aes_ctx *ctx, const uint8_t *key, int keysize)
RK[15] = RK[7] ^ RK[14];
}
break;
CRYB_DISABLE_COVERAGE
default:
break;
CRYB_RESTORE_COVERAGE
}
}
@ -397,8 +401,10 @@ aes_setkey_dec(aes_ctx *ctx, const uint8_t *key, int keysize)
case 32:
ctx->nr = 14;
break;
CRYB_DISABLE_COVERAGE
default:
return;
CRYB_RESTORE_COVERAGE
}
ctx->rk = RK = ctx->buf;
aes_setkey_enc(&cty, key, keysize);

View file

@ -32,7 +32,7 @@
#include <stdint.h>
#include <stdlib.h>
#include "t.h"
#include <cryb/test.h>
const uint8_t t_zero[4096] = {
};

View file

@ -39,7 +39,7 @@
#include <string.h>
#include <unistd.h>
#include "t.h"
#include <cryb/test.h>
static struct t_file *tflist;

View file

@ -40,7 +40,7 @@
#include <syslog.h>
#include <unistd.h>
#include "t.h"
#include <cryb/test.h>
/* program name */
const char *t_progname;

View file

@ -56,7 +56,7 @@
#include <stdlib.h>
#include <string.h>
#include "t.h"
#include <cryb/test.h>
/*
* Very simple, non-thread-safe malloc() implementation tailored for unit

View file

@ -38,7 +38,7 @@
#include <syslog.h>
#include <unistd.h>
#include "t.h"
#include <cryb/test.h>
/*
* Compare two buffers, and print a verbose message if they differ.

View file

@ -1,12 +1,7 @@
AM_CPPFLAGS = -I$(top_srcdir)/include
noinst_HEADERS = t.h
EXTRA_DIST =
# Test driver and support code
check_LTLIBRARIES = libt.la
libt_la_SOURCES = t_main.c t_file.c t_util.c t_const.c t_malloc.c
# Individual libraries
libcipher = $(top_builddir)/lib/cipher/libcryb-cipher.la
libcore = $(top_builddir)/lib/core/libcryb-core.la
@ -17,7 +12,7 @@ libmac = $(top_builddir)/lib/mac/libcryb-mac.la
libmpi = $(top_builddir)/lib/mpi/libcryb-mpi.la
liboath = $(top_builddir)/lib/oath/libcryb-oath.la
librand = $(top_builddir)/lib/rand/libcryb-rand.la
libt = $(builddir)/libt.la
libt = $(top_builddir)/lib/test/libcryb-test.la
# Additional headers, flags and libraries for OpenSSL
if WITH_OPENSSL

View file

@ -36,7 +36,7 @@
#include <cryb/endian.h>
#include <cryb/hash.h>
#include "t.h"
#include <cryb/test.h>
#define ADLER32_INVALID 0xffffffffLU

View file

@ -35,7 +35,7 @@
#include <cryb/aes.h>
#include "t.h"
#include <cryb/test.h>
struct t_case {
const char *desc;

View file

@ -35,7 +35,7 @@
#include <cryb/ctype.h>
#include "t.h"
#include <cryb/test.h>
#define OC_DIGIT "0123456789"
#define OC_XDIGIT OC_DIGIT "ABCDEFabcdef"

View file

@ -35,7 +35,7 @@
#include <cryb/endian.h>
#include "t.h"
#include <cryb/test.h>
static uint16_t be16 = 0xf001U;
static uint32_t be32 = 0xdeadbeefUL;

View file

@ -36,7 +36,7 @@
#include <cryb/endian.h>
#include <cryb/hash.h>
#include "t.h"
#include <cryb/test.h>
#define FLETCHER16_INVALID 0xffffU
#define FLETCHER32_INVALID 0xffffffffLU

View file

@ -34,7 +34,7 @@
#include <stdlib.h>
#include <string.h>
#include "t.h"
#include <cryb/test.h>
#if WITH_OPENSSL

View file

@ -34,7 +34,7 @@
#include <stdlib.h>
#include <string.h>
#include "t.h"
#include <cryb/test.h>
#if WITH_OPENSSL

View file

@ -34,7 +34,7 @@
#include <stdlib.h>
#include <string.h>
#include "t.h"
#include <cryb/test.h>
#if WITH_OPENSSL

View file

@ -34,7 +34,7 @@
#include <stdlib.h>
#include <string.h>
#include "t.h"
#include <cryb/test.h>
#if WITH_OPENSSL

View file

@ -34,7 +34,7 @@
#include <stdlib.h>
#include <string.h>
#include "t.h"
#include <cryb/test.h>
#if WITH_OPENSSL

View file

@ -36,7 +36,7 @@
#include <string.h>
#include <time.h>
#include "t.h"
#include <cryb/test.h>
#if WITH_RSAREF

View file

@ -36,7 +36,7 @@
#include <string.h>
#include <time.h>
#include "t.h"
#include <cryb/test.h>
#if WITH_OPENSSL

View file

@ -36,7 +36,7 @@
#include <string.h>
#include <time.h>
#include "t.h"
#include <cryb/test.h>
#if WITH_OPENSSL

View file

@ -36,7 +36,7 @@
#undef HAVE_MEMSET_S
#include <cryb/memset_s.h>
#include "t.h"
#include <cryb/test.h>
#define T_BUF_LEN 32

View file

@ -36,7 +36,7 @@
#include <cryb/endian.h>
#include <cryb/mpi.h>
#include "t.h"
#include <cryb/test.h>
/***************************************************************************

View file

@ -34,7 +34,7 @@
#include <cryb/hash.h>
#include "t.h"
#include <cryb/test.h>
struct t_case {
const char *desc;

View file

@ -34,7 +34,7 @@
#include <cryb/hash.h>
#include "t.h"
#include <cryb/test.h>
#define T_MAGIC_WORD_1 "squeamish"
#define T_MAGIC_WORD_2 "ossifrage"

View file

@ -35,7 +35,7 @@
#include <cryb/rc4.h>
#include "t.h"
#include <cryb/test.h>
struct t_case {
const char *desc;

View file

@ -38,7 +38,7 @@
#include <cryb/rfc3986.h>
#include "t.h"
#include <cryb/test.h>
struct t_case {
const char *desc;

View file

@ -39,7 +39,7 @@
#include <cryb/rfc4648.h>
#include "t.h"
#include <cryb/test.h>
struct t_case {
const char *desc;

View file

@ -36,7 +36,7 @@
#include <string.h>
#include <time.h>
#include "t.h"
#include <cryb/test.h>
#if WITH_OPENSSL

View file

@ -36,7 +36,7 @@
#include <string.h>
#include <time.h>
#include "t.h"
#include <cryb/test.h>
#if WITH_OPENSSL

View file

@ -36,7 +36,7 @@
#include <string.h>
#include <time.h>
#include "t.h"
#include <cryb/test.h>
#if WITH_OPENSSL

View file

@ -36,7 +36,7 @@
#include <string.h>
#include <time.h>
#include "t.h"
#include <cryb/test.h>
#if WITH_OPENSSL

View file

@ -36,7 +36,7 @@
#include <string.h>
#include <time.h>
#include "t.h"
#include <cryb/test.h>
#if WITH_OPENSSL

View file

@ -37,7 +37,7 @@
#include <cryb/string.h>
#include "t.h"
#include <cryb/test.h>
#define char_t char

View file

@ -35,7 +35,7 @@
#undef HAVE_STRLCAT
#include <cryb/strlcat.h>
#include "t.h"
#include <cryb/test.h>
#define T_MAGIC_STR "squeamish ossifrage"
#define T_MAGIC_LEN (sizeof(T_MAGIC_STR) - 1)

View file

@ -36,7 +36,7 @@
#undef HAVE_STRLCMP
#include <cryb/strlcmp.h>
#include "t.h"
#include <cryb/test.h>
#define T_MAGIC_STR "squeamish ossifrage"
#define T_MAGIC_INITIAL 's'

View file

@ -35,7 +35,7 @@
#undef HAVE_STRLCPY
#include <cryb/strlcpy.h>
#include "t.h"
#include <cryb/test.h>
#define T_MAGIC_STR "squeamish ossifrage"
#define T_MAGIC_LEN (sizeof(T_MAGIC_STR) - 1)

View file

@ -38,7 +38,7 @@
#include <cryb/wstring.h>
#include "t.h"
#include <cryb/test.h>
#define char_t wchar_t
#define vsnprintf vswprintf