add unit test for sample cache

This commit is contained in:
derselbst 2018-04-06 20:21:14 +02:00
parent 4032ae0a48
commit bd5b2f9a9c
3 changed files with 67 additions and 0 deletions

11
test/test.h Normal file
View file

@ -0,0 +1,11 @@
#pragma once
#include <stdio.h>
#include <stdlib.h>
#define TEST_ASSERT(COND) if (!(COND)) { fprintf(stderr, __FILE__ ":%d assertion ("#COND") failed\n", __LINE__); exit(-1); }
#define TEST_ASSERT_EQ(LHS, RHS) TEST_ASSERT((LHS) == (RHS))
#define TEST_ASSERT_NEQ(LHS, RHS) TEST_ASSERT((LHS) != (RHS))
#define TEST_SUCCESS(FLUID_FUNCT) TEST_ASSERT_NEQ((FLUID_FUNCT), FLUID_FAILED)