Separate test function and main()

This allows for inclusion of the test function/file in a program with an
existing main().  This is an isolated piece of #19.
main
Kyle Altendorf 2019-09-21 16:12:31 -04:00
parent 42efb6c384
commit 84ec6d2c74
3 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,6 @@
CC=gcc
CFLAGS=-Wall --std=c99
SRC=siphash.c halfsiphash.c test.c
SRC=siphash.c halfsiphash.c test.c testmain.c
BIN=test debug vectors
ifneq ($(cROUNDS),)

2
test.c
View File

@ -43,7 +43,7 @@ const char *labels[4] = {
size_t lengths[4] = {8, 16, 4, 8};
int main() {
int siphash_test() {
uint8_t in[64], out[16], k[16];
int i;
#ifndef GETVECTORS

5
testmain.c 100644
View File

@ -0,0 +1,5 @@
int siphash_test();
int main(void) {
return siphash_test();
}