12 void foo_invariant (struct foo
* self
, int depth
, const char* file
, int line
)
16 INVARIANT_ASSERT(self
->b
!= 7);
19 foo_invariant (self
->bar
, depth
-1, file
, line
);
22 void foo_dump (struct foo
* self
, int depth
, const char* file
, int line
)
26 DUMP_LOG("dump b is %d", self
->b
);
29 foo_dump (self
->bar
, depth
-1, file
, line
);
32 NOBUG_DEFINE_FLAG(test
);
34 int main(int argc
, char* argv
[])
38 NOBUG_INIT_FLAG(test
);
43 fprintf (stderr
, "testing %d\n", c
);
48 REQUIRE(c
!= 2, "require %d failed", c
);
51 ENSURE(c
!= 4, "ensure %d failed", c
);
53 ASSERT(c
!= 5, "assert5");
54 ASSERT(c
!= 6, "assert", "assert %d failed", c
);
61 INVARIANT(foo
, &f
, 2);
63 ERROR(test
, "logging");
64 ERROR(test
, "logging %d", c
);
66 WARNIF(c
==8, test
, "logging = 8");
67 TRACEIF(c
==9, test
, "logging if %d=9", c
);
70 DUMPIF(c
==10, foo
, &f
, 2);
73 UNIMPLEMENTED("this is unimplemented");
76 PLANNED("this is planned");
82 TODO("something todo");