Skip to content

Instantly share code, notes, and snippets.

@keizo042
Created September 5, 2016 13:07
Show Gist options
  • Save keizo042/69429a3b0e851990db3739b2fbc89829 to your computer and use it in GitHub Desktop.
Save keizo042/69429a3b0e851990db3739b2fbc89829 to your computer and use it in GitHub Desktop.
// when depoyment
//
// $ gcc sample.c main.c -o sample
// when testing
//
// $ gcc -DDEBUG sample.c test/test_main.c -o test/test
#include <stdio.h>
#define FAIL 1
#define SUCCESS 0
static int
f()
{
return 1;
}
#ifdef DEBUG
int f_test()
{
if(f() != 1)
{
printf("fail\n");
return FAIL;
}
return SUCCESS;
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment