summaryrefslogtreecommitdiffstats
path: root/tests/types.c
blob: 9f08ac8740c0c507c026874b3aba179163358006 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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