diff options
| author | gramanas <anastasis.gramm2@gmail.com> | 2022-05-10 21:12:33 +0300 | 
|---|---|---|
| committer | gramanas <anastasis.gramm2@gmail.com> | 2022-05-10 21:12:33 +0300 | 
| commit | 16538abf8d1231279133508ba15376145b818518 (patch) | |
| tree | e19079645f87163f674faa333044330c37374ea9 /tests/types.c | |
| parent | e739c5dccc0faf13cbddacd1950e203305aa4bab (diff) | |
| download | foodtools-16538abf8d1231279133508ba15376145b818518.tar.gz foodtools-16538abf8d1231279133508ba15376145b818518.tar.bz2 foodtools-16538abf8d1231279133508ba15376145b818518.zip | |
autotools and check testign suite
Diffstat (limited to 'tests/types.c')
| -rw-r--r-- | tests/types.c | 39 | 
1 files changed, 39 insertions, 0 deletions
| diff --git a/tests/types.c b/tests/types.c new file mode 100644 index 0000000..9f08ac8 --- /dev/null +++ b/tests/types.c @@ -0,0 +1,39 @@ +/* -*- eval: (outline-minor-mode); outline-regexp: "START_TEST("; -*- */ + +static check_empty_recipe(recipe * r) { +  ck_assert_int_eq(r->n, 1); +  ck_assert_int_eq(r->in, 0); +  ck_assert_int_eq(r->sn, 0); +  ck_assert_int_eq(r->rn, 0); + +  ck_assert_int_eq(r->sha1[0], '\0'); + +  ck_assert_ptr_null(r->i); +  ck_assert_ptr_null(r->s); +  ck_assert_ptr_null(r->r); +  ck_assert_ptr_null(r->filename); +  ck_assert_ptr_null(r->path); +  ck_assert_ptr_null(r->title); +} + +START_TEST(create_recipe) +{ +  recipe * r = new_recipe(); + +  check_empty_recipe(r); + +  free_recipe(r); +} +END_TEST + +START_TEST(create_subrecipe) +{ +  recipe * r = new_recipe(); +  recipe * r_sub = new_recipe(); +  new_subrecipe(r, r_sub); + +  check_empty_recipe(r->r[r->rn -1]); + +  free_recipe(r); +} +END_TEST | 
