11 void foo_invariant (struct foo
* self
, int depth
, const char* file
, int line
, const char* func
)
15 INVARIANT_ASSERT(self
->b
!= 7);
18 foo_invariant (self
->bar
, depth
-1, file
, line
, func
);
21 void nobug_foo_dump (const struct foo
* self
, const int depth
, const char* file
, const int line
, const char* func
)
25 DUMP_LOG("dump b is %d", self
->b
);
27 nobug_foo_dump (self
->bar
, depth
-1, file
, line
, func
);
31 NOBUG_DEFINE_FLAG(all
);
32 NOBUG_DEFINE_FLAG_PARENT(test
, all
);
34 int main(int argc
, char* argv
[])
38 NOBUG_INIT_FLAG(test
);
46 fprintf (stderr
, "testing %d\n", c
);
51 REQUIRE(c
!= 2, "require %d failed", c
);
54 ENSURE(c
!= 4, "ensure %d failed", c
);
56 ASSERT(c
!= 5, "assert5");
57 ASSERT(c
!= 6, "assert", "assert %d failed", c
);
64 INVARIANT(foo
, &f
, 2);
66 ERROR(test
, "logging");
67 ERROR(test
, "logging %d", c
);
69 WARN_IF(c
==8, test
, "logging = 8");
70 TRACE_IF(c
==9, test
, "logging if %d=9", c
);
72 DUMP(test
, foo
, &f
, 2);
73 DUMP_IF(c
==10, test
, foo
, &f
, 2);
76 UNIMPLEMENTED("this is unimplemented");
79 PLANNED("this is planned");
82 FIXME("here is a bug");
85 TODO("something todo");