diff options
| author | Tom Harley | 2023-02-01 20:48:40 +0000 |
|---|---|---|
| committer | Tom Harley | 2023-02-01 20:56:29 +0000 |
| commit | e600b4729cee5f624b6f1f457c07aa75aa0ed278 (patch) | |
| tree | b011e0a6aa88eb2a5eab614c7b8e2b6ee55bb057 /examples/unit/test_framework.c | |
| parent | Adjust int type in run_func.c (diff) | |
| download | sinter-e600b4729cee5f624b6f1f457c07aa75aa0ed278.tar.gz sinter-e600b4729cee5f624b6f1f457c07aa75aa0ed278.zip | |
Fix unit tests
Now the unit tests will run again! :)
Diffstat (limited to 'examples/unit/test_framework.c')
| -rw-r--r-- | examples/unit/test_framework.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/examples/unit/test_framework.c b/examples/unit/test_framework.c index 22ededd..0a86efc 100644 --- a/examples/unit/test_framework.c +++ b/examples/unit/test_framework.c @@ -1,9 +1,19 @@ #include <assert.h> +#include <string.h> + +#include <gc.h> void *test(void); -void *inter_main(void) { - return test(); +int main(void) { + test(); + return 0; +} + +void *gc_alloc(size_t size) { + void *p = GC_MALLOC(size); + assert(p); + return p; } void *assert_equals(void *a, void *b, void *c) { @@ -11,3 +21,9 @@ void *assert_equals(void *a, void *b, void *c) { assert(ia == ib); return c; } + +void *assert_string_equals(void *a, void *b, void *c) { + char *sa = (char *) a, *sb = (char *) b; + assert(!strcmp(sa, sb)); + return c; +} |
