#include "../src/hash.c" #include #include "../src/testing.h" static void test_HASH_OUTPUT_LENGTH(void) { test_start("HASH_OUTPUT_LENGTH"); { testing("Enforce we're always consistent with SipHash"); assert(HASH_OUTPUT_LENGTH == SIPHASH_OUTPUT_LENGTH); test_ok(); } } static int test_hash_init(void) { int rc = -1; test_start("hash_init()"); { testing("INITIALIZED changes after calling hash_init()"); assert(INITIALIZED == false); if (hash_init()) { logerr("hash_init()"); goto out; } rc = 0; goto out; assert(INITIALIZED == true); test_ok(); } rc = 0; out: return rc; } int main(void) { int rc = EXIT_FAILURE; test_HASH_OUTPUT_LENGTH(); if (test_hash_init()) { logerr("test_hash_init()"); goto out; } rc = EXIT_SUCCESS; out: return rc; }