From a8b9b15b4f02ce3c6c7eac0d9393c44cb3fc668d Mon Sep 17 00:00:00 2001 From: ZoRo Date: Mon, 15 Jan 2018 19:25:03 +0000 Subject: Initial commit --- test.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 test.c (limited to 'test.c') diff --git a/test.c b/test.c new file mode 100644 index 0000000..9bb8f31 --- /dev/null +++ b/test.c @@ -0,0 +1,82 @@ +#include +#include + +#include "buf.h" +#include "debug.h" + +#define BUF_SIZE_1 1024 +#define BUF_SIZE_2 2048 + +void blow_if_error(int err) +{ + if (err < 0) + { + printf("Should be no error but there is\n"); + exit(1); + } +} + +#define B(X) PNL();blow_if_error(X); + +void error_is_good(int err) +{ + if (err >= 0) + { + printf("Should be error but there is no\n"); + exit(1); + } +} + +void print_s(char *str, int sz) +{ + int i = 0; + for (i=0;i