aboutsummaryrefslogtreecommitdiffstats
path: root/simple_test.c
diff options
context:
space:
mode:
authorshmibs <shmibs@gmail.com>2014-08-01 09:05:48 -0700
committershmibs <shmibs@gmail.com>2014-08-01 09:05:48 -0700
commit17c76a851e3c3550f6398aad11e7c71e1a122576 (patch)
tree9e15eb284966dec97032452b6cd3383da4fd6fb4 /simple_test.c
parent0cfbc56786d1e0141aaa89497515acaa89824665 (diff)
downloadsimple-test-17c76a851e3c3550f6398aad11e7c71e1a122576.tar.gz
all around cleanup
Diffstat (limited to 'simple_test.c')
-rw-r--r--simple_test.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/simple_test.c b/simple_test.c
deleted file mode 100644
index e57db38..0000000
--- a/simple_test.c
+++ /dev/null
@@ -1,52 +0,0 @@
-#include "test.h"
-#include "header_with_stuff_to_be_tested.h"
-
-BEGIN_TEST
-
-/* a simple test using only stack mem */
-TEST("description of the first test")
-{
- int var1=2;
- int var2=4;
-
- /* add is a function included from our hypothetical
- * header_with_stuff_to_be_tested */
- EXPECT_INT("error message shown on failing",
- var1+var2, add(var1, var2));
-}
-
-/* this test uses heap memory, so things get a bit
- * more complicated */
-TEST("this is the second test")
-{
- /* first, ensure all your pointers which will
- * point to heap mem are declared */
- char *heap_string=NULL;
-
- /* next, declare a list of statements to be
- * called to clean up memory once the test
- * is completed */
- CLEANUP(
- if(heap_string != NULL)
- free(heap_string);
- )
-
- /* then, define the body of the test */
-
- /* STATE can be used to report (with pretty
- * formatting) the current state within the
- * test, which may be useful in the case of
- * a segfault */
- STATE("grabbing heap string");
-
- heap_string=get_heap_string_value();
-
- EXPECT_STR("i suck at grabbing pointers!",
- "expected value", heap_string);
-
- /* finally, call RETURN(); to run the
- * cleanup code and continue */
- RETURN();
-}
-
-END_TEST