Add debug functions
This commit is contained in:
@ -65,6 +65,10 @@ int main(int argc, const char **argv) {
|
||||
STATIC_A(1);
|
||||
STATIC_A(2);
|
||||
STATIC_A(3);
|
||||
assert(refcount_debug_context_count_object(c, &static_a_1, static_a_1.next)
|
||||
== 1);
|
||||
assert(refcount_debug_context_count_object(c, &static_a_1, static_a_2.next)
|
||||
== 0);
|
||||
|
||||
A *a = make_a(c, 10, "Hello world\n");
|
||||
assert(!refcount_context_is_static(c, a));
|
||||
@ -124,6 +128,7 @@ int main(int argc, const char **argv) {
|
||||
first->next = a;
|
||||
a = first;
|
||||
assert(refcount_context_num_refs(c, a) == 1);
|
||||
assert(refcount_debug_context_count_object(c, a, a) == 1);
|
||||
|
||||
refcount_context_ref(c, a);
|
||||
refcount_context_unref(c, a);
|
||||
|
Reference in New Issue
Block a user