Something went wrong. Try again.
Basic C project template.
Something went wrong. Try again.
12345678910111213141516171819#pragma once#include <stdio.h>#include <stdlib.h>#include <string.h>
#define ASSERT(cond) \ do { \ if (!(cond)) { \ fprintf(stderr, "FAIL %s:%d %s\n", __FILE__, __LINE__, #cond); \ exit(1); \ } \ } while (0)
#define ASSERT_EQ(a, b) ASSERT((a) == (b))#define ASSERT_NE(a, b) ASSERT((a) != (b))#define ASSERT_STR_EQ(a, b) ASSERT(strcmp((a), (b)) == 0)#define ASSERT_NULL(p) ASSERT((p) == NULL)#define ASSERT_NOT_NULL(p) ASSERT((p) != NULL)