7 static Point
*global_point
;
12 Point
*a
= g_rc_box_new (Point
);
18 a
= g_rc_box_new0 (Point
);
20 g_assert_cmpfloat (a
->x
, ==, 0.f
);
21 g_assert_cmpfloat (a
->y
, ==, 0.f
);
27 point_clear (Point
*p
)
31 g_assert_cmpfloat (p
->x
, ==, 42.0f
);
32 g_assert_cmpfloat (p
->y
, ==, 47.0f
);
34 g_assert_true (global_point
== p
);
39 test_rcbox_release_full (void)
41 Point
*p
= g_rc_box_new (Point
);
49 g_assert_true (g_rc_box_acquire (p
) == p
);
51 g_rc_box_release_full (p
, (GDestroyNotify
) point_clear
);
52 g_assert_nonnull (global_point
);
53 g_assert_true (p
== global_point
);
55 g_rc_box_release_full (p
, (GDestroyNotify
) point_clear
);
56 g_assert_null (global_point
);
62 Point
*a
= g_rc_box_new (Point
);
63 Point
*b
= g_rc_box_dup (a
);
65 g_assert_true (a
!= b
);
75 g_test_init (&argc
, &argv
, NULL
);
77 g_test_add_func ("/rcbox/new", test_rcbox_new
);
78 g_test_add_func ("/rcbox/dup", test_rcbox_dup
);
79 g_test_add_func ("/rcbox/release-full", test_rcbox_release_full
);