1
0
Fork 0

tests: Avoid g_assert() use in unit tests

This is aimed towards allowing g_assert() to be compiled out of
release builds by ensuring they do not affect the testsuite.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4011>
This commit is contained in:
Christian Hergert 2024-09-06 13:16:01 -07:00 committed by Sebastian Wick
parent bce2790f7f
commit 2666aabde2
94 changed files with 695 additions and 690 deletions

View file

@ -41,7 +41,7 @@ test_read_fd_mmap (int fd,
string_size = strlen (expected_string) + 1;
mem = mmap (NULL, string_size, PROT_READ, MAP_PRIVATE, fd, 0);
g_assert (mem != MAP_FAILED);
g_assert_true (mem != MAP_FAILED);
if (strcmp (expected_string, mem) != 0)
{
@ -105,7 +105,7 @@ test_open_write_read (const char *path)
int fd;
fd = open (path, O_RDWR);
g_assert (fd != -1);
g_assert_cmpint (fd, !=, -1);
if (!test_write_read (fd))
{
@ -136,9 +136,9 @@ main (int argc,
#if defined(HAVE_MEMFD_CREATE)
fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_PRIVATE);
g_assert (fd != -1);
g_assert_cmpint (fd, !=, -1);
other_fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_PRIVATE);
g_assert (other_fd != -1);
g_assert_cmpint (other_fd, !=, -1);
/* When MAPMODE_PRIVATE was used, meta_anonymous_file_open_fd() should always
* return the same fd. */
@ -179,9 +179,9 @@ main (int argc,
fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_SHARED);
g_assert (fd != -1);
g_assert_cmpint (fd, !=, -1);
other_fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_SHARED);
g_assert (other_fd != -1);
g_assert_cmpint (other_fd, !=, -1);
/* The MAPMODE_SHARED fd should not have readonly seals applied */
if (test_readonly_seals (fd))
@ -221,7 +221,7 @@ main (int argc,
goto fail;
fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_PRIVATE);
g_assert (fd != -1);
g_assert_cmpint (fd, !=, -1);
if (!test_read_fd_mmap (fd, teststring))
goto fail;
@ -230,9 +230,9 @@ main (int argc,
}
#else
fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_PRIVATE);
g_assert (fd != -1);
g_assert_cmpint (fd, !=, -1);
other_fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_PRIVATE);
g_assert (other_fd != -1);
g_assert_cmpint (other_fd, !=, -1);
/* Writing and reading the written data should succeed */
if (!test_write_read (fd))
@ -247,9 +247,9 @@ main (int argc,
fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_SHARED);
g_assert (fd != -1);
g_assert_cmpint (fd, !=, -1);
other_fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_SHARED);
g_assert (other_fd != -1);
g_assert_cmpint (other_fd, !=, -1);
if (!test_read_fd_mmap (fd, teststring))
goto fail;

View file

@ -102,7 +102,9 @@ get_strut_list (int which)
ans = NULL;
g_assert (which >=0 && which <= 6);
g_assert_cmpint (which, >=, 0);
g_assert_cmpint (which, <=, 6);
switch (which)
{
case 0:
@ -180,7 +182,10 @@ get_monitor_edges (int which_monitor_set, int which_strut_set)
GList *xins;
xins = NULL;
g_assert (which_monitor_set >=0 && which_monitor_set <= 3);
g_assert_cmpint (which_monitor_set, >=, 0);
g_assert_cmpint (which_monitor_set, <=, 3);
switch (which_monitor_set)
{
case 0:
@ -237,7 +242,7 @@ test_merge_regions (void)
num_contains = num_merged = num_part_contains = num_adjacent = 0;
compare = region = get_screen_region (2);
g_assert (region);
g_assert_nonnull (region);
printf ("Merging stats:\n");
printf (" Length of initial list: %d\n", g_list_length (region));
@ -253,14 +258,14 @@ test_merge_regions (void)
MtkRectangle *a = compare->data;
GList *other = compare->next;
g_assert (a->width > 0 && a->height > 0);
g_assert_true (a->width > 0 && a->height > 0);
while (other)
{
MtkRectangle *b = other->data;
GList *delete_me = NULL;
g_assert (b->width > 0 && b->height > 0);
g_assert_true (b->width > 0 && b->height > 0);
#ifdef PRINT_DEBUG
printf (" -- Comparing %s to %s --\n",
@ -532,8 +537,8 @@ test_region_fitting (void)
for (i = 0; i < NUM_RANDOM_RUNS; i++)
{
get_random_rect (&rect);
g_assert (meta_rectangle_contained_in_region (region, &rect) == FALSE ||
meta_rectangle_could_fit_in_region (region, &rect) == TRUE);
g_assert_true (meta_rectangle_contained_in_region (region, &rect) == FALSE ||
meta_rectangle_could_fit_in_region (region, &rect) == TRUE);
}
meta_rectangle_free_list_and_elements (region);
@ -541,23 +546,23 @@ test_region_fitting (void)
region = get_screen_region (1);
rect = MTK_RECTANGLE_INIT (50, 50, 400, 400);
g_assert (meta_rectangle_could_fit_in_region (region, &rect));
g_assert (meta_rectangle_contained_in_region (region, &rect));
g_assert_true (meta_rectangle_could_fit_in_region (region, &rect));
g_assert_true (meta_rectangle_contained_in_region (region, &rect));
rect = MTK_RECTANGLE_INIT (250, 0, 500, 1150);
g_assert (!meta_rectangle_could_fit_in_region (region, &rect));
g_assert (!meta_rectangle_contained_in_region (region, &rect));
g_assert_false (meta_rectangle_could_fit_in_region (region, &rect));
g_assert_false (meta_rectangle_contained_in_region (region, &rect));
rect = MTK_RECTANGLE_INIT (250, 0, 400, 400);
g_assert (meta_rectangle_could_fit_in_region (region, &rect));
g_assert (!meta_rectangle_contained_in_region (region, &rect));
g_assert_true (meta_rectangle_could_fit_in_region (region, &rect));
g_assert_false (meta_rectangle_contained_in_region (region, &rect));
meta_rectangle_free_list_and_elements (region);
region = get_screen_region (2);
rect = MTK_RECTANGLE_INIT (1000, 50, 600, 1100);
g_assert (meta_rectangle_could_fit_in_region (region, &rect));
g_assert (!meta_rectangle_contained_in_region (region, &rect));
g_assert_true (meta_rectangle_could_fit_in_region (region, &rect));
g_assert_false (meta_rectangle_contained_in_region (region, &rect));
meta_rectangle_free_list_and_elements (region);
}
@ -584,8 +589,8 @@ test_clamping_to_region (void)
fixed_directions,
&rect,
&min_size);
g_assert (meta_rectangle_could_fit_in_region (region, &rect) == TRUE);
g_assert (rect.x == temp.x && rect.y == temp.y);
g_assert_true (meta_rectangle_could_fit_in_region (region, &rect));
g_assert_true (rect.x == temp.x && rect.y == temp.y);
}
meta_rectangle_free_list_and_elements (region);
@ -597,14 +602,14 @@ test_clamping_to_region (void)
fixed_directions,
&rect,
&min_size);
g_assert (rect.width == 1600 && rect.height == 1140);
g_assert_true (rect.width == 1600 && rect.height == 1140);
rect = MTK_RECTANGLE_INIT (275, -50, 410, 10000);
meta_rectangle_clamp_to_fit_into_region (region,
fixed_directions,
&rect,
&min_size);
g_assert (rect.width == 400 && rect.height == 1180);
g_assert_true (rect.width == 400 && rect.height == 1180);
rect = MTK_RECTANGLE_INIT (50, 50, 10000, 10000);
min_size.height = 1170;
@ -612,7 +617,7 @@ test_clamping_to_region (void)
fixed_directions,
&rect,
&min_size);
g_assert (rect.width == 400 && rect.height == 1180);
g_assert_true (rect.width == 400 && rect.height == 1180);
rect = MTK_RECTANGLE_INIT (50, 50, 10000, 10000);
min_size.width = 600; min_size.height = 1170;
@ -625,7 +630,7 @@ test_clamping_to_region (void)
&min_size);
g_test_assert_expected_messages ();
g_assert (rect.width == 600 && rect.height == 1170);
g_assert_true (rect.width == 600 && rect.height == 1170);
rect = MTK_RECTANGLE_INIT (350, 50, 100, 1100);
min_size.width = 1; min_size.height = 1;
@ -634,7 +639,7 @@ test_clamping_to_region (void)
fixed_directions,
&rect,
&min_size);
g_assert (rect.width == 100 && rect.height == 1100);
g_assert_true (rect.width == 100 && rect.height == 1100);
rect = MTK_RECTANGLE_INIT (300, 70, 500, 1100);
min_size.width = 1; min_size.height = 1;
@ -643,7 +648,7 @@ test_clamping_to_region (void)
fixed_directions,
&rect,
&min_size);
g_assert (rect.width == 400 && rect.height == 1100);
g_assert_true (rect.width == 400 && rect.height == 1100);
rect = MTK_RECTANGLE_INIT (300, 70, 999999, 999999);
min_size.width = 100; min_size.height = 200;
@ -657,7 +662,7 @@ test_clamping_to_region (void)
&min_size);
g_test_assert_expected_messages ();
g_assert (rect.width == 100 && rect.height == 999999);
g_assert_true (rect.width == 100 && rect.height == 999999);
meta_rectangle_free_list_and_elements (region);
}
@ -698,7 +703,7 @@ test_clipping_to_region (void)
if (rect_overlaps_region (region, &rect))
{
meta_rectangle_clip_to_region (region, 0, &rect);
g_assert (meta_rectangle_contained_in_region (region, &rect) == TRUE);
g_assert_true (meta_rectangle_contained_in_region (region, &rect));
}
}
meta_rectangle_free_list_and_elements (region);
@ -710,35 +715,35 @@ test_clipping_to_region (void)
meta_rectangle_clip_to_region (region,
fixed_directions,
&rect);
g_assert (mtk_rectangle_equal (region->data, &rect));
g_assert_true (mtk_rectangle_equal (region->data, &rect));
rect = MTK_RECTANGLE_INIT (300, 1000, 400, 200);
temp = MTK_RECTANGLE_INIT (300, 1000, 400, 150);
meta_rectangle_clip_to_region (region,
fixed_directions,
&rect);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT (400, 1000, 300, 200);
temp = MTK_RECTANGLE_INIT (450, 1000, 250, 200);
meta_rectangle_clip_to_region (region,
fixed_directions,
&rect);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT (400, 1000, 300, 200);
temp = MTK_RECTANGLE_INIT (400, 1000, 300, 150);
meta_rectangle_clip_to_region (region,
FIXED_DIRECTION_X,
&rect);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT (400, 1000, 300, 200);
temp = MTK_RECTANGLE_INIT (400, 1000, 300, 150);
meta_rectangle_clip_to_region (region,
FIXED_DIRECTION_X,
&rect);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
meta_rectangle_free_list_and_elements (region);
}
@ -758,7 +763,7 @@ test_shoving_into_region (void)
if (meta_rectangle_could_fit_in_region (region, &rect))
{
meta_rectangle_shove_into_region (region, 0, &rect);
g_assert (meta_rectangle_contained_in_region (region, &rect));
g_assert_true (meta_rectangle_contained_in_region (region, &rect));
}
}
meta_rectangle_free_list_and_elements (region);
@ -771,42 +776,42 @@ test_shoving_into_region (void)
meta_rectangle_shove_into_region (region,
fixed_directions,
&rect);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT (425, 1000, 300, 200);
temp = MTK_RECTANGLE_INIT (450, 1000, 300, 200);
meta_rectangle_shove_into_region (region,
fixed_directions,
&rect);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT (425, 1000, 300, 200);
temp = MTK_RECTANGLE_INIT (425, 950, 300, 200);
meta_rectangle_shove_into_region (region,
FIXED_DIRECTION_X,
&rect);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT ( 300, 1000, 400, 200);
temp = MTK_RECTANGLE_INIT (1200, 1000, 400, 200);
meta_rectangle_shove_into_region (region,
FIXED_DIRECTION_Y,
&rect);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT ( 800, 1150, 400, 50); /* Completely "offscreen" :) */
temp = MTK_RECTANGLE_INIT ( 800, 1050, 400, 50);
meta_rectangle_shove_into_region (region,
0,
&rect);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT (-1000, 0, 400, 150); /* Offscreen in 2 directions */
temp = MTK_RECTANGLE_INIT ( 0, 20, 400, 150);
meta_rectangle_shove_into_region (region,
0,
&rect);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
meta_rectangle_free_list_and_elements (region);
}
@ -1091,7 +1096,7 @@ test_gravity_resize (void)
META_GRAVITY_NORTH_WEST,
20,
5);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT ( 50, 300, 250, 400);
temp = MTK_RECTANGLE_INIT (165, 300, 20, 5);
@ -1100,7 +1105,7 @@ test_gravity_resize (void)
META_GRAVITY_NORTH,
20,
5);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT ( 50, 300, 250, 400);
temp = MTK_RECTANGLE_INIT (280, 300, 20, 5);
@ -1109,7 +1114,7 @@ test_gravity_resize (void)
META_GRAVITY_NORTH_EAST,
20,
5);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT ( 50, 300, 250, 400);
temp = MTK_RECTANGLE_INIT ( 50, 695, 50, 5);
@ -1118,7 +1123,7 @@ test_gravity_resize (void)
META_GRAVITY_SOUTH_WEST,
50,
5);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT ( 50, 300, 250, 400);
temp = MTK_RECTANGLE_INIT (150, 695, 50, 5);
@ -1127,7 +1132,7 @@ test_gravity_resize (void)
META_GRAVITY_SOUTH,
50,
5);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT ( 50, 300, 250, 400);
temp = MTK_RECTANGLE_INIT (250, 695, 50, 5);
@ -1136,7 +1141,7 @@ test_gravity_resize (void)
META_GRAVITY_SOUTH_EAST,
50,
5);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT (167, 738, 237, 843);
temp = MTK_RECTANGLE_INIT (167, 1113, 832, 93);
@ -1145,7 +1150,7 @@ test_gravity_resize (void)
META_GRAVITY_WEST,
832,
93);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT ( 167, 738, 237, 843);
temp = MTK_RECTANGLE_INIT (-131, 1113, 833, 93);
@ -1154,7 +1159,7 @@ test_gravity_resize (void)
META_GRAVITY_CENTER,
832,
93);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT (300, 1000, 400, 200);
temp = MTK_RECTANGLE_INIT (270, 994, 430, 212);
@ -1163,7 +1168,7 @@ test_gravity_resize (void)
META_GRAVITY_EAST,
430,
211);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
rect = MTK_RECTANGLE_INIT (300, 1000, 400, 200);
temp = MTK_RECTANGLE_INIT (300, 1000, 430, 211);
@ -1172,7 +1177,7 @@ test_gravity_resize (void)
META_GRAVITY_STATIC,
430,
211);
g_assert (mtk_rectangle_equal (&rect, &temp));
g_assert_true (mtk_rectangle_equal (&rect, &temp));
}
#define EPSILON 0.000000001
@ -1190,7 +1195,7 @@ test_find_closest_point_to_line (void)
x2, y2,
px, py,
&rx, &ry);
g_assert (fabs (rx - answer_x) < EPSILON && fabs (ry - answer_y) < EPSILON);
g_assert_true (fabs (rx - answer_x) < EPSILON && fabs (ry - answer_y) < EPSILON);
/* Special test for x1 == x2, so that slop of line is infinite */
x1 = 3.0; y1 = 49.0;
@ -1201,7 +1206,7 @@ test_find_closest_point_to_line (void)
x2, y2,
px, py,
&rx, &ry);
g_assert (fabs (rx - answer_x) < EPSILON && fabs (ry - answer_y) < EPSILON);
g_assert_true (fabs (rx - answer_x) < EPSILON && fabs (ry - answer_y) < EPSILON);
/* Special test for y1 == y2, so perp line has slope of infinity */
x1 = 3.14; y1 = 7.0;
@ -1212,7 +1217,7 @@ test_find_closest_point_to_line (void)
x2, y2,
px, py,
&rx, &ry);
g_assert (fabs (rx - answer_x) < EPSILON && fabs (ry - answer_y) < EPSILON);
g_assert_true (fabs (rx - answer_x) < EPSILON && fabs (ry - answer_y) < EPSILON);
/* Test when we the point we want to be closest to is actually on the line */
x1 = 3.0; y1 = 49.0;
@ -1223,7 +1228,7 @@ test_find_closest_point_to_line (void)
x2, y2,
px, py,
&rx, &ry);
g_assert (fabs (rx - answer_x) < EPSILON && fabs (ry - answer_y) < EPSILON);
g_assert_true (fabs (rx - answer_x) < EPSILON && fabs (ry - answer_y) < EPSILON);
}
void

View file

@ -57,13 +57,13 @@ clutter_test_init (int *argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, argc, argv, NULL));
g_assert (meta_context_setup (context, NULL));
g_assert_true (meta_context_configure (context, argc, argv, NULL));
g_assert_true (meta_context_setup (context, NULL));
test_environ = g_new0 (ClutterTestEnvironment, 1);
test_environ->context = context;
g_assert (meta_context_start (context, NULL));
g_assert_true (meta_context_start (context, NULL));
clutter_test_main_loop = g_main_loop_new (NULL, FALSE);
}
@ -238,7 +238,7 @@ clutter_test_add_data_full (const char *test_path,
g_return_if_fail (test_path != NULL);
g_return_if_fail (test_func != NULL);
g_assert (test_environ != NULL);
g_assert_nonnull (test_environ);
data = g_new (ClutterTestData, 1);
data->test_func = test_func;

View file

@ -140,7 +140,7 @@ actor_destruction (void)
g_print ("Calling destroy()...\n");
clutter_actor_destroy (test);
g_assert (destroy_called);
g_assert_true (destroy_called);
g_assert_false (parent_set_called);
g_assert_false (property_changed);
g_assert_null (child);

View file

@ -127,15 +127,15 @@ actor_event_hold (void)
clutter_event_get_gesture_motion_delta (captured_event, &dx, &dy);
clutter_event_get_gesture_motion_delta_unaccelerated (captured_event, &udx, &udy);
g_assert (actual_position.x == test_case->x);
g_assert (actual_position.y == test_case->y);
g_assert_cmpfloat (actual_position.x, ==, test_case->x);
g_assert_cmpfloat (actual_position.y, ==, test_case->y);
g_assert_null (actual_axes);
g_assert (actual_phase == test_case->phase);
g_assert (actual_n_fingers == test_case->n_fingers);
g_assert (dx == 0);
g_assert (dy == 0);
g_assert (udx == 0);
g_assert (udy == 0);
g_assert_cmpint (actual_phase, ==, test_case->phase);
g_assert_cmpint (actual_n_fingers, ==, test_case->n_fingers);
g_assert_cmpfloat (dx, ==, 0);
g_assert_cmpfloat (dy, ==, 0);
g_assert_cmpfloat (udx, ==, 0);
g_assert_cmpfloat (udy, ==, 0);
clutter_event_free (captured_event);
}

View file

@ -31,8 +31,8 @@ actor_add_child (void)
iter = clutter_actor_get_next_sibling (iter);
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "baz");
g_assert (iter == clutter_actor_get_last_child (actor));
g_assert (clutter_actor_get_next_sibling (iter) == NULL);
g_assert_true (iter == clutter_actor_get_last_child (actor));
g_assert_null (clutter_actor_get_next_sibling (iter));
iter = clutter_actor_get_last_child (actor);
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "baz");
@ -42,11 +42,11 @@ actor_add_child (void)
iter = clutter_actor_get_previous_sibling (iter);
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "foo");
g_assert (iter == clutter_actor_get_first_child (actor));
g_assert (clutter_actor_get_previous_sibling (iter) == NULL);
g_assert_true (iter == clutter_actor_get_first_child (actor));
g_assert_null (clutter_actor_get_previous_sibling (iter));
clutter_actor_destroy (actor);
g_assert (actor == NULL);
g_assert_null (actor);
}
static void
@ -65,9 +65,9 @@ actor_insert_child (void)
0);
iter = clutter_actor_get_first_child (actor);
g_assert (iter != NULL);
g_assert_nonnull (iter);
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "foo");
g_assert (iter == clutter_actor_get_child_at_index (actor, 0));
g_assert_true (iter == clutter_actor_get_child_at_index (actor, 0));
clutter_actor_insert_child_below (actor,
g_object_new (CLUTTER_TYPE_ACTOR,
@ -81,7 +81,7 @@ actor_insert_child (void)
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "bar");
iter = clutter_actor_get_next_sibling (iter);
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "foo");
g_assert (iter == clutter_actor_get_child_at_index (actor, 1));
g_assert_true (iter == clutter_actor_get_child_at_index (actor, 1));
iter = clutter_actor_get_first_child (actor);
clutter_actor_insert_child_above (actor,
@ -108,8 +108,8 @@ actor_insert_child (void)
0);
iter = clutter_actor_get_child_at_index (actor, 0);
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "1");
g_assert (clutter_actor_get_first_child (actor) == iter);
g_assert (clutter_actor_get_last_child (actor) == iter);
g_assert_true (clutter_actor_get_first_child (actor) == iter);
g_assert_true (clutter_actor_get_last_child (actor) == iter);
clutter_actor_insert_child_at_index (actor,
g_object_new (CLUTTER_TYPE_ACTOR,
@ -118,10 +118,10 @@ actor_insert_child (void)
0);
iter = clutter_actor_get_child_at_index (actor, 0);
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "2");
g_assert (clutter_actor_get_first_child (actor) == iter);
g_assert_true (clutter_actor_get_first_child (actor) == iter);
iter = clutter_actor_get_child_at_index (actor, 1);
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "1");
g_assert (clutter_actor_get_last_child (actor) == iter);
g_assert_true (clutter_actor_get_last_child (actor) == iter);
clutter_actor_insert_child_at_index (actor,
g_object_new (CLUTTER_TYPE_ACTOR,
@ -130,10 +130,10 @@ actor_insert_child (void)
-1);
iter = clutter_actor_get_child_at_index (actor, 2);
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "3");
g_assert (clutter_actor_get_last_child (actor) == iter);
g_assert_true (clutter_actor_get_last_child (actor) == iter);
clutter_actor_destroy (actor);
g_assert (actor == NULL);
g_assert_null (actor);
}
static void
@ -154,7 +154,7 @@ actor_remove_child (void)
g_assert_cmpint (clutter_actor_get_n_children (actor), ==, 2);
g_assert (clutter_actor_get_first_child (actor) != clutter_actor_get_last_child (actor));
g_assert_true (clutter_actor_get_first_child (actor) != clutter_actor_get_last_child (actor));
iter = clutter_actor_get_first_child (actor);
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "foo");
@ -168,16 +168,16 @@ actor_remove_child (void)
iter = clutter_actor_get_first_child (actor);
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "bar");
g_assert (clutter_actor_get_first_child (actor) == clutter_actor_get_last_child (actor));
g_assert_true (clutter_actor_get_first_child (actor) == clutter_actor_get_last_child (actor));
clutter_actor_remove_child (actor, clutter_actor_get_first_child (actor));
g_assert_cmpint (clutter_actor_get_n_children (actor), ==, 0);
g_assert (clutter_actor_get_first_child (actor) == NULL);
g_assert (clutter_actor_get_last_child (actor) == NULL);
g_assert_null (clutter_actor_get_first_child (actor));
g_assert_null (clutter_actor_get_last_child (actor));
clutter_actor_destroy (actor);
g_assert (actor == NULL);
g_assert_null (actor);
}
static void
@ -220,9 +220,9 @@ actor_raise_child (void)
g_assert_cmpstr (clutter_actor_get_name (clutter_actor_get_child_at_index (actor, 2)),
==,
"bar");
g_assert (!clutter_actor_is_visible (iter));
g_assert_false (clutter_actor_is_visible (iter));
g_object_get (iter, "show-on-set-parent", &show_on_set_parent, NULL);
g_assert (!show_on_set_parent);
g_assert_false (show_on_set_parent);
iter = clutter_actor_get_child_at_index (actor, 0);
clutter_actor_set_child_above_sibling (actor, iter, NULL);
@ -237,13 +237,13 @@ actor_raise_child (void)
g_assert_cmpstr (clutter_actor_get_name (clutter_actor_get_child_at_index (actor, 2)),
==,
"foo");
g_assert (!clutter_actor_is_visible (iter));
g_assert_false (clutter_actor_is_visible (iter));
g_object_get (iter, "show-on-set-parent", &show_on_set_parent, NULL);
g_assert (!show_on_set_parent);
g_assert_false (show_on_set_parent);
clutter_actor_destroy (actor);
g_assert (actor == NULL);
g_assert (iter == NULL);
g_assert_null (actor);
g_assert_null (iter);
}
static void
@ -286,9 +286,9 @@ actor_lower_child (void)
g_assert_cmpstr (clutter_actor_get_name (clutter_actor_get_child_at_index (actor, 2)),
==,
"baz");
g_assert (!clutter_actor_is_visible (iter));
g_assert_false (clutter_actor_is_visible (iter));
g_object_get (iter, "show-on-set-parent", &show_on_set_parent, NULL);
g_assert (!show_on_set_parent);
g_assert_false (show_on_set_parent);
iter = clutter_actor_get_child_at_index (actor, 2);
clutter_actor_set_child_below_sibling (actor, iter, NULL);
@ -302,12 +302,12 @@ actor_lower_child (void)
g_assert_cmpstr (clutter_actor_get_name (clutter_actor_get_child_at_index (actor, 2)),
==,
"foo");
g_assert (!clutter_actor_is_visible (iter));
g_assert_false (clutter_actor_is_visible (iter));
g_object_get (iter, "show-on-set-parent", &show_on_set_parent, NULL);
g_assert (!show_on_set_parent);
g_assert_false (show_on_set_parent);
clutter_actor_destroy (actor);
g_assert (actor == NULL);
g_assert_null (actor);
}
static void
@ -368,7 +368,7 @@ actor_replace_child (void)
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "baz");
clutter_actor_destroy (actor);
g_assert (actor == NULL);
g_assert_null (actor);
}
static void
@ -396,7 +396,7 @@ actor_remove_all (void)
g_assert_cmpint (clutter_actor_get_n_children (actor), ==, 0);
clutter_actor_destroy (actor);
g_assert (actor == NULL);
g_assert_null (actor);
}
static void
@ -470,7 +470,7 @@ actor_container_signals (void)
&remove_count);
clutter_actor_destroy (actor);
g_assert (actor == NULL);
g_assert_null (actor);
}
static void

View file

@ -20,12 +20,12 @@ actor_initial_state (void)
clutter_actor_is_realized (actor) ? "yes" : "no",
clutter_actor_is_mapped (actor) ? "yes" : "no");
g_assert (!(clutter_actor_is_realized (actor)));
g_assert (!(clutter_actor_is_mapped (actor)));
g_assert (!(clutter_actor_is_visible (actor)));
g_assert_false ((clutter_actor_is_realized (actor)));
g_assert_false ((clutter_actor_is_mapped (actor)));
g_assert_false ((clutter_actor_is_visible (actor)));
clutter_actor_destroy (actor);
g_assert (actor == NULL);
g_assert_null (actor);
}
static void
@ -45,12 +45,12 @@ actor_shown_not_parented (void)
clutter_actor_is_realized (actor) ? "yes" : "no",
clutter_actor_is_mapped (actor) ? "yes" : "no");
g_assert (!clutter_actor_is_realized (actor));
g_assert (!clutter_actor_is_mapped (actor));
g_assert (clutter_actor_is_visible (actor));
g_assert_false (clutter_actor_is_realized (actor));
g_assert_false (clutter_actor_is_mapped (actor));
g_assert_true (clutter_actor_is_visible (actor));
clutter_actor_destroy (actor);
g_assert (actor == NULL);
g_assert_null (actor);
}
static void
@ -63,16 +63,16 @@ actor_realized (void)
actor = clutter_actor_new ();
g_assert (!(clutter_actor_is_realized (actor)));
g_assert_false ((clutter_actor_is_realized (actor)));
clutter_actor_hide (actor); /* don't show, so won't map */
clutter_actor_add_child (stage, actor);
clutter_actor_realize (actor);
g_assert (clutter_actor_is_realized (actor));
g_assert_true (clutter_actor_is_realized (actor));
g_assert (!(clutter_actor_is_mapped (actor)));
g_assert (!(clutter_actor_is_visible (actor)));
g_assert_false ((clutter_actor_is_mapped (actor)));
g_assert_false ((clutter_actor_is_visible (actor)));
clutter_actor_destroy (actor);
}
@ -88,8 +88,8 @@ actor_mapped (void)
actor = clutter_actor_new ();
g_assert (!(clutter_actor_is_realized (actor)));
g_assert (!(clutter_actor_is_mapped (actor)));
g_assert_false ((clutter_actor_is_realized (actor)));
g_assert_false ((clutter_actor_is_mapped (actor)));
clutter_actor_add_child (stage, actor);
@ -100,9 +100,9 @@ actor_mapped (void)
clutter_actor_is_realized (actor) ? "yes" : "no",
clutter_actor_is_mapped (actor) ? "yes" : "no");
g_assert (clutter_actor_is_realized (actor));
g_assert (clutter_actor_is_mapped (actor));
g_assert (clutter_actor_is_visible (actor));
g_assert_true (clutter_actor_is_realized (actor));
g_assert_true (clutter_actor_is_mapped (actor));
g_assert_true (clutter_actor_is_visible (actor));
clutter_actor_hide (actor);
@ -113,9 +113,9 @@ actor_mapped (void)
clutter_actor_is_realized (actor) ? "yes" : "no",
clutter_actor_is_mapped (actor) ? "yes" : "no");
g_assert (clutter_actor_is_realized (actor));
g_assert (!clutter_actor_is_mapped (actor));
g_assert (!clutter_actor_is_visible (actor));
g_assert_true (clutter_actor_is_realized (actor));
g_assert_false (clutter_actor_is_mapped (actor));
g_assert_false (clutter_actor_is_visible (actor));
clutter_actor_destroy (actor);
}
@ -134,30 +134,30 @@ actor_visibility_not_recursive (void)
clutter_actor_hide (group); /* don't show, so won't map */
clutter_actor_hide (actor); /* don't show, so won't map */
g_assert (!(clutter_actor_is_visible (stage)));
g_assert (!(clutter_actor_is_visible (group)));
g_assert (!(clutter_actor_is_visible (actor)));
g_assert_false ((clutter_actor_is_visible (stage)));
g_assert_false ((clutter_actor_is_visible (group)));
g_assert_false ((clutter_actor_is_visible (actor)));
clutter_actor_add_child (stage, group);
clutter_actor_add_child (group, actor);
clutter_actor_show (actor);
g_assert (clutter_actor_is_visible (actor));
g_assert (!clutter_actor_is_visible (group));
g_assert (!clutter_actor_is_visible (stage));
g_assert_true (clutter_actor_is_visible (actor));
g_assert_false (clutter_actor_is_visible (group));
g_assert_false (clutter_actor_is_visible (stage));
clutter_actor_show (stage);
g_assert (clutter_actor_is_visible (actor));
g_assert (!clutter_actor_is_visible (group));
g_assert (clutter_actor_is_visible (stage));
g_assert_true (clutter_actor_is_visible (actor));
g_assert_false (clutter_actor_is_visible (group));
g_assert_true (clutter_actor_is_visible (stage));
clutter_actor_hide (actor);
clutter_actor_hide (group);
clutter_actor_hide (stage);
g_assert (!clutter_actor_is_visible (actor));
g_assert_false (clutter_actor_is_visible (actor));
clutter_actor_show (stage);
g_assert (!clutter_actor_is_visible (actor));
g_assert_false (clutter_actor_is_visible (actor));
clutter_actor_destroy (actor);
clutter_actor_destroy (group);
@ -179,23 +179,23 @@ actor_realize_not_recursive (void)
clutter_actor_hide (group); /* don't show, so won't map */
clutter_actor_hide (actor); /* don't show, so won't map */
g_assert (!(clutter_actor_is_realized (group)));
g_assert (!(clutter_actor_is_realized (actor)));
g_assert_false ((clutter_actor_is_realized (group)));
g_assert_false ((clutter_actor_is_realized (actor)));
clutter_actor_add_child (stage, group);
clutter_actor_add_child (group, actor);
clutter_actor_realize (group);
g_assert (clutter_actor_is_realized (group));
g_assert_true (clutter_actor_is_realized (group));
g_assert (!(clutter_actor_is_mapped (group)));
g_assert (!(clutter_actor_is_visible (group)));
g_assert_false ((clutter_actor_is_mapped (group)));
g_assert_false ((clutter_actor_is_visible (group)));
/* realizing group did not realize the child */
g_assert (!clutter_actor_is_realized (actor));
g_assert (!(clutter_actor_is_mapped (actor)));
g_assert (!(clutter_actor_is_visible (actor)));
g_assert_false (clutter_actor_is_realized (actor));
g_assert_false ((clutter_actor_is_mapped (actor)));
g_assert_false ((clutter_actor_is_visible (actor)));
clutter_actor_destroy (actor);
clutter_actor_destroy (group);
@ -217,33 +217,33 @@ actor_map_recursive (void)
clutter_actor_hide (group); /* hide at first */
clutter_actor_show (actor); /* show at first */
g_assert (!(clutter_actor_is_realized (group)));
g_assert (!(clutter_actor_is_realized (actor)));
g_assert (!(clutter_actor_is_mapped (group)));
g_assert (!(clutter_actor_is_mapped (actor)));
g_assert (!(clutter_actor_is_visible (group)));
g_assert ((clutter_actor_is_visible (actor)));
g_assert_false ((clutter_actor_is_realized (group)));
g_assert_false ((clutter_actor_is_realized (actor)));
g_assert_false ((clutter_actor_is_mapped (group)));
g_assert_false ((clutter_actor_is_mapped (actor)));
g_assert_false ((clutter_actor_is_visible (group)));
g_assert_true ((clutter_actor_is_visible (actor)));
clutter_actor_add_child (stage, group);
clutter_actor_add_child (group, actor);
g_assert (!(clutter_actor_is_realized (group)));
g_assert (!(clutter_actor_is_realized (actor)));
g_assert (!(clutter_actor_is_mapped (group)));
g_assert (!(clutter_actor_is_mapped (actor)));
g_assert (!(clutter_actor_is_visible (group)));
g_assert ((clutter_actor_is_visible (actor)));
g_assert_false ((clutter_actor_is_realized (group)));
g_assert_false ((clutter_actor_is_realized (actor)));
g_assert_false ((clutter_actor_is_mapped (group)));
g_assert_false ((clutter_actor_is_mapped (actor)));
g_assert_false ((clutter_actor_is_visible (group)));
g_assert_true ((clutter_actor_is_visible (actor)));
/* show group, which should map and realize both
* group and child.
*/
clutter_actor_show (group);
g_assert (clutter_actor_is_realized (group));
g_assert (clutter_actor_is_realized (actor));
g_assert (clutter_actor_is_mapped (group));
g_assert (clutter_actor_is_mapped (actor));
g_assert (clutter_actor_is_visible (group));
g_assert (clutter_actor_is_visible (actor));
g_assert_true (clutter_actor_is_realized (group));
g_assert_true (clutter_actor_is_realized (actor));
g_assert_true (clutter_actor_is_mapped (group));
g_assert_true (clutter_actor_is_mapped (actor));
g_assert_true (clutter_actor_is_visible (group));
g_assert_true (clutter_actor_is_visible (actor));
clutter_actor_destroy (actor);
clutter_actor_destroy (group);
@ -260,7 +260,7 @@ actor_show_on_set_parent (void)
group = clutter_actor_new ();
g_assert (!(clutter_actor_is_visible (group)));
g_assert_false ((clutter_actor_is_visible (group)));
clutter_actor_add_child (stage, group);
@ -269,16 +269,16 @@ actor_show_on_set_parent (void)
"show-on-set-parent", &show_on_set_parent,
NULL);
g_assert (!(clutter_actor_is_visible (actor)));
g_assert (show_on_set_parent);
g_assert_false ((clutter_actor_is_visible (actor)));
g_assert_true (show_on_set_parent);
clutter_actor_add_child (group, actor);
g_object_get (actor,
"show-on-set-parent", &show_on_set_parent,
NULL);
g_assert (clutter_actor_is_visible (actor));
g_assert (show_on_set_parent);
g_assert_true (clutter_actor_is_visible (actor));
g_assert_true (show_on_set_parent);
g_object_ref (actor);
clutter_actor_remove_child (group, actor);
@ -286,10 +286,10 @@ actor_show_on_set_parent (void)
"show-on-set-parent", &show_on_set_parent,
NULL);
g_assert (!clutter_actor_is_realized (actor));
g_assert (!clutter_actor_is_mapped (actor));
g_assert (clutter_actor_is_visible (actor));
g_assert (show_on_set_parent);
g_assert_false (clutter_actor_is_realized (actor));
g_assert_false (clutter_actor_is_mapped (actor));
g_assert_true (clutter_actor_is_visible (actor));
g_assert_true (show_on_set_parent);
clutter_actor_destroy (actor);
clutter_actor_destroy (group);
@ -300,9 +300,9 @@ actor_show_on_set_parent (void)
g_object_get (actor,
"show-on-set-parent", &show_on_set_parent,
NULL);
g_assert (!clutter_actor_is_visible (actor));
g_assert (!clutter_actor_is_mapped (actor));
g_assert (show_on_set_parent);
g_assert_false (clutter_actor_is_visible (actor));
g_assert_false (clutter_actor_is_mapped (actor));
g_assert_true (show_on_set_parent);
clutter_actor_destroy (actor);
@ -312,9 +312,9 @@ actor_show_on_set_parent (void)
g_object_get (actor,
"show-on-set-parent", &show_on_set_parent,
NULL);
g_assert (!clutter_actor_is_visible (actor));
g_assert (!clutter_actor_is_mapped (actor));
g_assert (!show_on_set_parent);
g_assert_false (clutter_actor_is_visible (actor));
g_assert_false (clutter_actor_is_mapped (actor));
g_assert_false (show_on_set_parent);
clutter_actor_destroy (actor);
}
@ -338,16 +338,16 @@ clone_no_map (void)
clutter_actor_add_child (group, actor);
clutter_actor_add_child (stage, group);
g_assert (!(clutter_actor_is_mapped (group)));
g_assert (!(clutter_actor_is_mapped (actor)));
g_assert_false ((clutter_actor_is_mapped (group)));
g_assert_false ((clutter_actor_is_mapped (actor)));
clone = clutter_clone_new (group);
clutter_actor_add_child (stage, clone);
g_assert (clutter_actor_is_mapped (clone));
g_assert (!(clutter_actor_is_mapped (group)));
g_assert (!(clutter_actor_is_mapped (actor)));
g_assert_true (clutter_actor_is_mapped (clone));
g_assert_false ((clutter_actor_is_mapped (group)));
g_assert_false ((clutter_actor_is_mapped (actor)));
clutter_actor_destroy (actor);
clutter_actor_destroy (CLUTTER_ACTOR (clone));

View file

@ -33,21 +33,21 @@ actor_iter_traverse_children (void)
i = 0;
clutter_actor_iter_init (&iter, actor);
g_assert (clutter_actor_iter_is_valid (&iter));
g_assert_true (clutter_actor_iter_is_valid (&iter));
while (clutter_actor_iter_next (&iter, &child))
{
g_assert (CLUTTER_IS_ACTOR (child));
g_assert (clutter_actor_get_parent (child) == actor);
g_assert_true (CLUTTER_IS_ACTOR (child));
g_assert_true (clutter_actor_get_parent (child) == actor);
if (!g_test_quiet ())
g_print ("actor %d = '%s'\n", i, clutter_actor_get_name (child));
if (i == 0)
g_assert (child == clutter_actor_get_first_child (actor));
g_assert_true (child == clutter_actor_get_first_child (actor));
if (i == (n_actors - 1))
g_assert (child == clutter_actor_get_last_child (actor));
g_assert_true (child == clutter_actor_get_last_child (actor));
i += 1;
}
@ -56,21 +56,21 @@ actor_iter_traverse_children (void)
i = 0;
clutter_actor_iter_init (&iter, actor);
g_assert (clutter_actor_iter_is_valid (&iter));
g_assert_true (clutter_actor_iter_is_valid (&iter));
while (clutter_actor_iter_prev (&iter, &child))
{
g_assert (CLUTTER_IS_ACTOR (child));
g_assert (clutter_actor_get_parent (child) == actor);
g_assert_true (CLUTTER_IS_ACTOR (child));
g_assert_true (clutter_actor_get_parent (child) == actor);
if (!g_test_quiet ())
g_print ("actor %d = '%s'\n", i, clutter_actor_get_name (child));
if (i == 0)
g_assert (child == clutter_actor_get_last_child (actor));
g_assert_true (child == clutter_actor_get_last_child (actor));
if (i == (n_actors - 1))
g_assert (child == clutter_actor_get_first_child (actor));
g_assert_true (child == clutter_actor_get_first_child (actor));
i += 1;
}
@ -108,24 +108,24 @@ actor_iter_traverse_remove (void)
i = 0;
clutter_actor_iter_init (&iter, actor);
g_assert (clutter_actor_iter_is_valid (&iter));
g_assert_true (clutter_actor_iter_is_valid (&iter));
while (clutter_actor_iter_next (&iter, &child))
{
g_assert (CLUTTER_IS_ACTOR (child));
g_assert (clutter_actor_get_parent (child) == actor);
g_assert_true (CLUTTER_IS_ACTOR (child));
g_assert_true (clutter_actor_get_parent (child) == actor);
if (!g_test_quiet ())
g_print ("actor %d = '%s'\n", i, clutter_actor_get_name (child));
if (i == 0)
g_assert (child == clutter_actor_get_first_child (actor));
g_assert_true (child == clutter_actor_get_first_child (actor));
if (i == (n_actors - 1))
g_assert (child == clutter_actor_get_last_child (actor));
g_assert_true (child == clutter_actor_get_last_child (actor));
clutter_actor_iter_remove (&iter);
g_assert (clutter_actor_iter_is_valid (&iter));
g_assert_true (clutter_actor_iter_is_valid (&iter));
i += 1;
}
@ -168,22 +168,22 @@ actor_iter_assignment (void)
iter_b = iter_a;
g_assert (clutter_actor_iter_is_valid (&iter_a));
g_assert (clutter_actor_iter_is_valid (&iter_b));
g_assert_true (clutter_actor_iter_is_valid (&iter_a));
g_assert_true (clutter_actor_iter_is_valid (&iter_b));
while (clutter_actor_iter_next (&iter_a, &child))
{
g_assert (CLUTTER_IS_ACTOR (child));
g_assert (clutter_actor_get_parent (child) == actor);
g_assert_true (CLUTTER_IS_ACTOR (child));
g_assert_true (clutter_actor_get_parent (child) == actor);
if (!g_test_quiet ())
g_print ("actor %2d = '%s'\n", i, clutter_actor_get_name (child));
if (i == 0)
g_assert (child == clutter_actor_get_first_child (actor));
g_assert_true (child == clutter_actor_get_first_child (actor));
if (i == (n_actors - 1))
g_assert (child == clutter_actor_get_last_child (actor));
g_assert_true (child == clutter_actor_get_last_child (actor));
i += 1;
}
@ -194,16 +194,16 @@ actor_iter_assignment (void)
while (clutter_actor_iter_prev (&iter_b, &child))
{
g_assert (clutter_actor_get_parent (child) == actor);
g_assert_true (clutter_actor_get_parent (child) == actor);
if (!g_test_quiet ())
g_print ("actor %2d = '%s'\n", i, clutter_actor_get_name (child));
if (i == n_actors - 1)
g_assert (child == clutter_actor_get_last_child (actor));
g_assert_true (child == clutter_actor_get_last_child (actor));
if (i == 0)
g_assert (child == clutter_actor_get_first_child (actor));
g_assert_true (child == clutter_actor_get_first_child (actor));
i -= 1;
}

View file

@ -20,21 +20,21 @@ actor_meta_clear (void)
clutter_actor_add_constraint (actor, clutter_bind_constraint_new (stage, CLUTTER_BIND_ALL, 0));
clutter_actor_add_effect (actor, clutter_blur_effect_new ());
g_assert (clutter_actor_has_actions (actor));
g_assert (clutter_actor_has_constraints (actor));
g_assert (clutter_actor_has_effects (actor));
g_assert_true (clutter_actor_has_actions (actor));
g_assert_true (clutter_actor_has_constraints (actor));
g_assert_true (clutter_actor_has_effects (actor));
clutter_actor_clear_actions (actor);
g_assert (!clutter_actor_has_actions (actor));
g_assert_false (clutter_actor_has_actions (actor));
clutter_actor_clear_constraints (actor);
g_assert (!clutter_actor_has_constraints (actor));
g_assert_false (clutter_actor_has_constraints (actor));
clutter_actor_clear_effects (actor);
g_assert (!clutter_actor_has_effects (actor));
g_assert_false (clutter_actor_has_effects (actor));
clutter_actor_destroy (actor);
g_assert (actor == NULL);
g_assert_null (actor);
}
CLUTTER_TEST_SUITE (

View file

@ -19,7 +19,7 @@ opacity_label (void)
if (!g_test_quiet ())
g_print ("label 50%%.get_color()/1\n");
clutter_text_get_color (CLUTTER_TEXT (label), &color_check);
g_assert (color_check.alpha == label_color.alpha);
g_assert_cmpint (color_check.alpha, ==, label_color.alpha);
clutter_actor_add_child (stage, label);
clutter_actor_set_position (label, 10, 10);
@ -27,16 +27,16 @@ opacity_label (void)
if (!g_test_quiet ())
g_print ("label 50%%.get_color()/2\n");
clutter_text_get_color (CLUTTER_TEXT (label), &color_check);
g_assert (color_check.alpha == label_color.alpha);
g_assert_cmpint (color_check.alpha, ==, label_color.alpha);
if (!g_test_quiet ())
g_print ("label 50%%.get_paint_opacity()/1\n");
g_assert (clutter_actor_get_paint_opacity (label) == 255);
g_assert_cmpint (clutter_actor_get_paint_opacity (label), ==, 255);
if (!g_test_quiet ())
g_print ("label 50%%.get_paint_opacity()/2\n");
clutter_actor_set_opacity (label, 128);
g_assert (clutter_actor_get_paint_opacity (label) == 128);
g_assert_cmpint (clutter_actor_get_paint_opacity (label), ==, 128);
clutter_actor_destroy (label);
}
@ -60,18 +60,18 @@ opacity_rectangle (void)
if (!g_test_quiet ())
g_print ("rect 100%%.get_color()/1\n");
clutter_actor_get_background_color (rect, &color_check);
g_assert (color_check.alpha == rect_color.alpha);
g_assert_cmpint (color_check.alpha, ==, rect_color.alpha);
clutter_actor_add_child (stage, rect);
if (!g_test_quiet ())
g_print ("rect 100%%.get_color()/2\n");
clutter_actor_set_background_color (rect, &color_check);
g_assert (color_check.alpha == rect_color.alpha);
g_assert_cmpint (color_check.alpha, ==, rect_color.alpha);
if (!g_test_quiet ())
g_print ("rect 100%%.get_paint_opacity()\n");
g_assert (clutter_actor_get_paint_opacity (rect) == 255);
g_assert_cmpint (clutter_actor_get_paint_opacity (rect), ==, 255);
clutter_actor_destroy (rect);
}
@ -101,18 +101,18 @@ opacity_paint (void)
if (!g_test_quiet ())
g_print ("label 50%% + group 50%%.get_color()/1\n");
clutter_text_get_color (CLUTTER_TEXT (label), &color_check);
g_assert (color_check.alpha == label_color.alpha);
g_assert_cmpint (color_check.alpha, ==, label_color.alpha);
clutter_actor_add_child (group1, label);
if (!g_test_quiet ())
g_print ("label 50%% + group 50%%.get_color()/2\n");
clutter_text_get_color (CLUTTER_TEXT (label), &color_check);
g_assert (color_check.alpha == label_color.alpha);
g_assert_cmpint (color_check.alpha, ==, label_color.alpha);
if (!g_test_quiet ())
g_print ("label 50%% + group 50%%.get_paint_opacity() = 128\n");
g_assert (clutter_actor_get_paint_opacity (label) == 128);
g_assert_cmpint (clutter_actor_get_paint_opacity (label), ==, 128);
clutter_actor_destroy (label);
@ -127,18 +127,18 @@ opacity_paint (void)
if (!g_test_quiet ())
g_print ("rect 100%% + group 100%% + group 50%%.get_color()/1\n");
clutter_actor_get_background_color (rect, &color_check);
g_assert (color_check.alpha == rect_color.alpha);
g_assert_cmpint (color_check.alpha, ==, rect_color.alpha);
clutter_actor_add_child (group2, rect);
if (!g_test_quiet ())
g_print ("rect 100%% + group 100%% + group 50%%.get_color()/2\n");
clutter_actor_get_background_color (rect, &color_check);
g_assert (color_check.alpha == rect_color.alpha);
g_assert_cmpint (color_check.alpha, ==, rect_color.alpha);
if (!g_test_quiet ())
g_print ("rect 100%%.get_paint_opacity()\n");
g_assert (clutter_actor_get_paint_opacity (rect) == 128);
g_assert_cmpint (clutter_actor_get_paint_opacity (rect), ==, 128);
clutter_actor_destroy (group1);
}

View file

@ -217,7 +217,7 @@ actor_pick (void)
state.actors[state.failed_idx]);
}
g_assert (state.pass);
g_assert_true (state.pass);
g_list_free_full (state.actor_list, (GDestroyNotify) clutter_actor_destroy);
}

View file

@ -40,7 +40,7 @@ actor_pivot (void)
clutter_actor_get_transform (actor_implicit, &result_implicit);
clutter_actor_get_transform (actor_explicit, &result_explicit);
g_assert (graphene_matrix_equal (&result_implicit, &result_explicit));
g_assert_true (graphene_matrix_equal (&result_implicit, &result_explicit));
clutter_actor_destroy (actor_implicit);
clutter_actor_destroy (actor_explicit);

View file

@ -102,7 +102,7 @@ foo_new_shader_effect_get_static_source (ClutterShaderEffect *effect)
/* This should only be called once even though we have two actors
using this effect */
g_assert (!already_called);
g_assert_false (already_called);
already_called = TRUE;

View file

@ -98,8 +98,8 @@ actor_preferred_size (void)
&min_width, &min_height,
&nat_width, &nat_height);
g_assert (self->preferred_width_called);
g_assert (self->preferred_height_called);
g_assert_true (self->preferred_width_called);
g_assert_true (self->preferred_height_called);
g_assert_cmpfloat (min_width, ==, 100);
g_assert_cmpfloat (min_height, ==, 100);
g_assert_cmpfloat (nat_width, ==, min_width);
@ -109,7 +109,7 @@ actor_preferred_size (void)
g_print ("Preferred width\n");
self->preferred_width_called = FALSE;
clutter_actor_get_preferred_width (test, 10, &min_width, &nat_width);
g_assert (self->preferred_width_called);
g_assert_true (self->preferred_width_called);
g_assert_cmpfloat (min_width, ==, 10);
g_assert_cmpfloat (nat_width, ==, 100);
@ -117,7 +117,7 @@ actor_preferred_size (void)
g_print ("Preferred height\n");
self->preferred_height_called = FALSE;
clutter_actor_get_preferred_height (test, 200, &min_height, &nat_height);
g_assert (self->preferred_height_called);
g_assert_true (self->preferred_height_called);
g_assert_cmpfloat (min_height, !=, 10);
g_assert_cmpfloat (nat_height, ==, 100);
@ -125,7 +125,7 @@ actor_preferred_size (void)
g_print ("Preferred width (cached)\n");
self->preferred_width_called = FALSE;
clutter_actor_get_preferred_width (test, 10, &min_width, &nat_width);
g_assert (!self->preferred_width_called);
g_assert_false (self->preferred_width_called);
g_assert_cmpfloat (min_width, ==, 10);
g_assert_cmpfloat (nat_width, ==, 100);
@ -133,7 +133,7 @@ actor_preferred_size (void)
g_print ("Preferred height (cache eviction)\n");
self->preferred_height_called = FALSE;
clutter_actor_get_preferred_height (test, 10, &min_height, &nat_height);
g_assert (self->preferred_height_called);
g_assert_true (self->preferred_height_called);
g_assert_cmpfloat (min_height, ==, 50);
g_assert_cmpfloat (nat_height, ==, 100);
@ -176,8 +176,8 @@ actor_fixed_size (void)
if (!g_test_quiet ())
g_print ("Notification properties\n");
g_assert (min_width_set && nat_width_set);
g_assert (min_height_set && nat_height_set);
g_assert_true (min_width_set && nat_width_set);
g_assert_true (min_height_set && nat_height_set);
clutter_actor_get_preferred_size (rect,
&min_width, &min_height,
@ -202,8 +202,8 @@ actor_fixed_size (void)
"natural-width-set", &nat_width_set,
"natural-height-set", &nat_height_set,
NULL);
g_assert (!min_width_set && !nat_width_set);
g_assert (!min_height_set && !nat_height_set);
g_assert_false (min_width_set && !nat_width_set);
g_assert_false (min_height_set && !nat_height_set);
g_assert_cmpfloat (clutter_actor_get_width (rect), ==, 0);
g_assert_cmpfloat (clutter_actor_get_height (rect), ==, 0);

View file

@ -92,9 +92,9 @@ key_group_action_activate (KeyGroup *self,
ClutterActor *child = NULL;
g_assert_cmpstr (action_name, ==, "activate");
g_assert (key_val == CLUTTER_KEY_Return ||
key_val == CLUTTER_KEY_KP_Enter ||
key_val == CLUTTER_KEY_ISO_Enter);
g_assert_true (key_val == CLUTTER_KEY_Return ||
key_val == CLUTTER_KEY_KP_Enter ||
key_val == CLUTTER_KEY_ISO_Enter);
if (self->selected_index == -1)
return FALSE;
@ -117,7 +117,7 @@ key_group_key_press (ClutterActor *actor,
gboolean res;
pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (actor));
g_assert (pool != NULL);
g_assert_nonnull (pool);
res = clutter_binding_pool_activate (pool,
clutter_event_get_key_symbol (event),

View file

@ -210,7 +210,7 @@ do_tests (CallbackData *data)
while (data)
{
gboolean result = check_result (data);
g_assert (result == FALSE);
g_assert_false (result);
data = data->next;
}
@ -331,8 +331,8 @@ cally_text (void)
}
else
{
g_assert (data.test_failed != TRUE);
g_assert (data1.test_failed != TRUE);
g_assert_false (data.test_failed);
g_assert_false (data1.test_failed);
}
}

View file

@ -202,7 +202,7 @@ frame_clock_timeline_switch (void)
*/
g_assert_cmpint (lateness_us, >, -2 * refresh_interval_us);
g_assert (clutter_timeline_get_frame_clock (timeline) == frame_clock2);
g_assert_true (clutter_timeline_get_frame_clock (timeline) == frame_clock2);
/* The duration is 1s, with a 60hz clock, and we switch after 0.5s. To verify
* we continued to get frames, check that we have a bit more than half of the

View file

@ -441,7 +441,7 @@ schedule_update_now_hw_callback (gpointer user_data)
clutter_frame_clock_schedule_update (frame_clock);
clutter_frame_clock_schedule_update_now (frame_clock);
g_assert (!test->idle_source_id);
g_assert_false (test->idle_source_id);
test->idle_source_id = g_idle_add (assert_not_reached_idle, NULL);
return G_SOURCE_CONTINUE;

View file

@ -10,28 +10,28 @@ interval_initial_state (void)
const GValue *value;
interval = clutter_interval_new (G_TYPE_INT, 0, 100);
g_assert (CLUTTER_IS_INTERVAL (interval));
g_assert (clutter_interval_get_value_type (interval) == G_TYPE_INT);
g_assert_true (CLUTTER_IS_INTERVAL (interval));
g_assert_true (clutter_interval_get_value_type (interval) == G_TYPE_INT);
clutter_interval_get_interval (interval, &initial, &final);
g_assert_cmpint (initial, ==, 0);
g_assert_cmpint (final, ==, 100);
value = clutter_interval_compute (interval, 0);
g_assert (G_VALUE_HOLDS_INT (value));
g_assert_true (G_VALUE_HOLDS_INT (value));
g_assert_cmpint (g_value_get_int (value), ==, 0);
value = clutter_interval_compute (interval, 1);
g_assert (G_VALUE_HOLDS_INT (value));
g_assert_true (G_VALUE_HOLDS_INT (value));
g_assert_cmpint (g_value_get_int (value), ==, 100);
value = clutter_interval_compute (interval, 0.5);
g_assert (G_VALUE_HOLDS_INT (value));
g_assert_true (G_VALUE_HOLDS_INT (value));
g_assert_cmpint (g_value_get_int (value), ==, 50);
clutter_interval_set_final (interval, 200);
value = clutter_interval_peek_final_value (interval);
g_assert (G_VALUE_HOLDS_INT (value));
g_assert_true (G_VALUE_HOLDS_INT (value));
g_assert_cmpint (g_value_get_int (value), ==, 200);
g_object_unref (interval);
@ -57,11 +57,11 @@ interval_transform (void)
g_value_unset (&value);
value_p = clutter_interval_peek_initial_value (interval);
g_assert (G_VALUE_HOLDS_FLOAT (value_p));
g_assert_true (G_VALUE_HOLDS_FLOAT (value_p));
g_assert_cmpfloat (g_value_get_float (value_p), ==, 0.f);
value_p = clutter_interval_peek_final_value (interval);
g_assert (G_VALUE_HOLDS_FLOAT (value_p));
g_assert_true (G_VALUE_HOLDS_FLOAT (value_p));
g_assert_cmpfloat (g_value_get_float (value_p), ==, 100.f);
g_object_unref (interval);

View file

@ -140,27 +140,27 @@ do_tests (CallbackData *data)
/* TEST 1: change the text */
clutter_text_set_text (CLUTTER_TEXT (data->label), "Counter 0");
pango_layout_set_text (data->test_layout, "Counter 0", -1);
g_assert (check_result (data, "Change text", TRUE) == FALSE);
g_assert_false (check_result (data, "Change text", TRUE));
/* TEST 2: change a single character */
clutter_text_set_text (CLUTTER_TEXT (data->label), "Counter 1");
pango_layout_set_text (data->test_layout, "Counter 1", -1);
g_assert (check_result (data, "Change a single character", TRUE) == FALSE);
g_assert_false (check_result (data, "Change a single character", TRUE));
/* TEST 3: move the label */
clutter_actor_set_position (data->label, 10, 0);
g_assert (check_result (data, "Move the label", FALSE) == FALSE);
g_assert_false (check_result (data, "Move the label", FALSE));
/* TEST 4: change the font */
clutter_text_set_font_name (CLUTTER_TEXT (data->label), "Serif 15");
fd = pango_font_description_from_string ("Serif 15");
pango_layout_set_font_description (data->test_layout, fd);
pango_font_description_free (fd);
g_assert (check_result (data, "Change the font", TRUE) == FALSE);
g_assert_false (check_result (data, "Change the font", TRUE));
/* TEST 5: change the color */
clutter_text_set_color (CLUTTER_TEXT (data->label), &red);
g_assert (check_result (data, "Change the color", FALSE) == FALSE);
g_assert_false (check_result (data, "Change the color", FALSE));
/* TEST 6: change the attributes */
attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
@ -173,19 +173,19 @@ do_tests (CallbackData *data)
pango_layout_set_attributes (data->test_layout, attr_list_copy);
pango_attr_list_unref (attr_list_copy);
pango_attr_list_unref (attr_list);
g_assert (check_result (data, "Change the attributes", TRUE) == FALSE);
g_assert_false (check_result (data, "Change the attributes", TRUE));
/* TEST 7: change the text again */
clutter_text_set_attributes (CLUTTER_TEXT (data->label), NULL);
clutter_text_set_text (CLUTTER_TEXT (data->label), long_text);
pango_layout_set_attributes (data->test_layout, NULL);
pango_layout_set_text (data->test_layout, long_text, -1);
g_assert (check_result (data, "Change the text again", TRUE) == FALSE);
g_assert_false (check_result (data, "Change the text again", TRUE));
/* TEST 8: enable markup */
clutter_text_set_use_markup (CLUTTER_TEXT (data->label), TRUE);
pango_layout_set_markup (data->test_layout, long_text, -1);
g_assert (check_result (data, "Enable markup", TRUE) == FALSE);
g_assert_false (check_result (data, "Enable markup", TRUE));
/* This part can't be a test because Clutter won't restrict the
width if wrapping and ellipsizing is disabled so the extents will
@ -200,7 +200,7 @@ do_tests (CallbackData *data)
clutter_text_set_ellipsize (CLUTTER_TEXT (data->label),
PANGO_ELLIPSIZE_END);
pango_layout_set_ellipsize (data->test_layout, PANGO_ELLIPSIZE_END);
g_assert (check_result (data, "Enable ellipsize", TRUE) == FALSE);
g_assert_false (check_result (data, "Enable ellipsize", TRUE));
clutter_text_set_ellipsize (CLUTTER_TEXT (data->label),
PANGO_ELLIPSIZE_NONE);
pango_layout_set_ellipsize (data->test_layout, PANGO_ELLIPSIZE_NONE);
@ -209,7 +209,7 @@ do_tests (CallbackData *data)
/* TEST 10: enable line wrap */
clutter_text_set_line_wrap (CLUTTER_TEXT (data->label), TRUE);
pango_layout_set_wrap (data->test_layout, PANGO_WRAP_WORD);
g_assert (check_result (data, "Enable line wrap", TRUE) == FALSE);
g_assert_false (check_result (data, "Enable line wrap", TRUE));
/* TEST 11: change wrap mode
* FIXME - broken
@ -217,7 +217,7 @@ do_tests (CallbackData *data)
clutter_text_set_line_wrap_mode (CLUTTER_TEXT (data->label),
PANGO_WRAP_CHAR);
pango_layout_set_wrap (data->test_layout, PANGO_WRAP_CHAR);
g_assert (check_result (data, "Change wrap mode", TRUE) == FALSE);
g_assert_false (check_result (data, "Change wrap mode", TRUE));
/* TEST 12: enable justify */
clutter_text_set_justify (CLUTTER_TEXT (data->label), TRUE);
@ -226,13 +226,13 @@ do_tests (CallbackData *data)
justification after setting the text but this fixes it.
See http://bugzilla.gnome.org/show_bug.cgi?id=551865 */
pango_layout_context_changed (data->test_layout);
g_assert (check_result (data, "Enable justify", TRUE) == FALSE);
g_assert_false (check_result (data, "Enable justify", TRUE));
/* TEST 13: change alignment */
clutter_text_set_line_alignment (CLUTTER_TEXT (data->label),
PANGO_ALIGN_RIGHT);
pango_layout_set_alignment (data->test_layout, PANGO_ALIGN_RIGHT);
g_assert (check_result (data, "Change alignment", TRUE) == FALSE);
g_assert_false (check_result (data, "Change alignment", TRUE));
clutter_test_quit ();
@ -294,6 +294,6 @@ text_cache (void)
g_print ("pass\n");
}
else
g_assert (data.test_failed != TRUE);
g_assert_false (data.test_failed);
}

View file

@ -28,12 +28,12 @@ text_utf8_validation (void)
char bytes[6];
int nbytes;
g_assert (g_unichar_validate (t->unichar));
g_assert_true (g_unichar_validate (t->unichar));
nbytes = g_unichar_to_utf8 (t->unichar, bytes);
bytes[nbytes] = '\0';
g_assert_cmpint (nbytes, ==, t->nbytes);
g_assert (memcmp (t->bytes, bytes, nbytes) == 0);
g_assert_cmpint (memcmp (t->bytes, bytes, nbytes), ==, 0);
unichar = g_utf8_get_char_validated (bytes, nbytes);
g_assert_cmpint (unichar, ==, t->unichar);
@ -51,7 +51,7 @@ static int
get_nchars (ClutterText *text)
{
const char *s = clutter_text_get_text (text);
g_assert (g_utf8_validate (s, -1, NULL));
g_assert_true (g_utf8_validate (s, -1, NULL));
return g_utf8_strlen (s, -1);
}
@ -453,10 +453,10 @@ validate_markup_attributes (ClutterText *text,
PangoAttrIterator *iter;
layout = clutter_text_get_layout (text);
g_assert (layout != NULL);
g_assert_nonnull (layout);
attrs = pango_layout_get_attributes (layout);
g_assert (attrs != NULL);
g_assert_nonnull (attrs);
iter = pango_attr_list_get_iterator (attrs);
while (pango_attr_iterator_next (iter))
@ -467,7 +467,7 @@ validate_markup_attributes (ClutterText *text,
if (attributes == NULL)
break;
g_assert (attributes->data != NULL);
g_assert_nonnull (attributes->data);
a = attributes->data;
@ -483,7 +483,7 @@ validate_markup_attributes (ClutterText *text,
continue;
}
g_assert (a->klass->type == attr_type);
g_assert_true (a->klass->type == attr_type);
g_assert_cmpint (a->start_index, ==, start_index);
g_assert_cmpint (a->end_index, ==, end_index);

View file

@ -102,7 +102,7 @@ validate_part (TestState *state,
/* Otherwise it should be the color for this division */
correct_color = corner_colors + (y * SOURCE_DIVISIONS_X) + x;
g_assert (pixels != NULL);
g_assert_nonnull (pixels);
g_assert_cmpint (pixels[0], ==, correct_color->red);
g_assert_cmpint (pixels[1], ==, correct_color->green);
g_assert_cmpint (pixels[2], ==, correct_color->blue);

View file

@ -103,7 +103,7 @@ timeline_progress_mode (void)
timeline = clutter_timeline_new_for_actor (stage, 1000);
g_assert (clutter_timeline_get_progress_mode (timeline) == CLUTTER_LINEAR);
g_assert_cmpint (clutter_timeline_get_progress_mode (timeline), ==, CLUTTER_LINEAR);
g_assert_cmpfloat (clutter_timeline_get_progress (timeline), ==, 0.0);
clutter_timeline_advance (timeline, 500);

View file

@ -64,7 +64,7 @@ timeline_new_frame_cb (ClutterTimeline *timeline,
data->timeline_num, frame_no,
clutter_timeline_get_delta (timeline));
g_assert (frame_no >= 0 && frame_no <= FRAME_COUNT);
g_assert_true (frame_no >= 0 && frame_no <= FRAME_COUNT);
data->frame_hit_count[frame_no]++;
}
@ -210,17 +210,17 @@ timeline_base (void)
10 * 1000 / FPS);
markers = clutter_timeline_list_markers (timeline_1, 5 * 1000 / FPS,
&n_markers);
g_assert (markers != NULL);
g_assert (n_markers == 3);
g_assert_nonnull (markers);
g_assert_true (n_markers == 3);
g_strfreev (markers);
timeline_data_init (&data_2, 2);
timeline_2 = clutter_timeline_new_for_actor (stage, FRAME_COUNT * 1000 / FPS);
clutter_timeline_add_marker_at_time (timeline_2, "bar", 2 * 1000 / FPS);
markers = clutter_timeline_list_markers (timeline_2, -1, &n_markers);
g_assert (markers != NULL);
g_assert (n_markers == 1);
g_assert (strcmp (markers[0], "bar") == 0);
g_assert_nonnull (markers);
g_assert_true (n_markers == 1);
g_assert_cmpint (strcmp (markers[0], "bar"), ==, 0);
g_strfreev (markers);
timeline_data_init (&data_3, 3);
@ -278,9 +278,9 @@ timeline_base (void)
clutter_test_main ();
g_assert (check_timeline (timeline_1, &data_1, TRUE));
g_assert (check_timeline (timeline_2, &data_2, TRUE));
g_assert (check_timeline (timeline_3, &data_3, TRUE));
g_assert_true (check_timeline (timeline_1, &data_1, TRUE));
g_assert_true (check_timeline (timeline_2, &data_2, TRUE));
g_assert_true (check_timeline (timeline_3, &data_3, TRUE));
g_printerr ("With delay...\n");
@ -300,9 +300,9 @@ timeline_base (void)
clutter_test_main ();
g_assert (check_timeline (timeline_1, &data_1, FALSE));
g_assert (check_timeline (timeline_2, &data_2, FALSE));
g_assert (check_timeline (timeline_3, &data_3, FALSE));
g_assert_true (check_timeline (timeline_1, &data_1, FALSE));
g_assert_true (check_timeline (timeline_2, &data_2, FALSE));
g_assert_true (check_timeline (timeline_3, &data_3, FALSE));
g_object_unref (timeline_1);
g_object_unref (timeline_2);

View file

@ -137,7 +137,7 @@ key_group_key_press (ClutterActor *actor,
gboolean res;
pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (actor));
g_assert (pool != NULL);
g_assert_nonnull (pool);
res = clutter_binding_pool_activate (pool,
clutter_event_get_key_symbol (event),

View file

@ -191,8 +191,8 @@ my_thing_get_preferred_width (ClutterActor *self,
if (natural_right < 0)
natural_right = 0;
g_assert (min_right >= min_left);
g_assert (natural_right >= natural_left);
g_assert_true (min_right >= min_left);
g_assert_true (natural_right >= natural_left);
if (min_width_p)
*min_width_p = min_right - min_left;
@ -265,8 +265,8 @@ my_thing_get_preferred_height (ClutterActor *self,
if (natural_bottom < 0)
natural_bottom = 0;
g_assert (min_bottom >= min_top);
g_assert (natural_bottom >= natural_top);
g_assert_true (min_bottom >= min_top);
g_assert_true (natural_bottom >= natural_top);
if (min_height_p)
*min_height_p = min_bottom - min_top;

View file

@ -171,7 +171,7 @@ on_captured_event (ClutterText *text,
uchar += ((gunichar) to_hex_digit (ch) << ((4 - i) * 4));
}
g_assert (g_unichar_validate (uchar));
g_assert_true (g_unichar_validate (uchar));
g_string_overwrite (str, 0, contents);
g_string_insert_unichar (str,

View file

@ -68,12 +68,12 @@ clutter_test_create_bitmap_from_file (CoglContext *ctx,
/* According to current docs this should be true and so
* the translation to cogl pixel format below valid */
g_assert (bits_per_sample == 8);
g_assert_cmpint (bits_per_sample, ==, 8);
if (has_alpha)
g_assert (n_channels == 4);
g_assert_cmpint (n_channels, ==, 4);
else
g_assert (n_channels == 3);
g_assert_cmpint (n_channels, ==, 3);
/* Translate to cogl pixel format */
switch (color_space)

View file

@ -328,7 +328,7 @@ test_utils_texture_new_from_data (CoglContext *ctx,
CoglTexture *tex;
g_assert_cmpint (format, !=, COGL_PIXEL_FORMAT_ANY);
g_assert (data != NULL);
g_assert_nonnull (data);
/* Wrap the data into a bitmap */
bmp = cogl_bitmap_new_for_data (ctx,
@ -391,7 +391,7 @@ meta_create_cogl_test_context (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
if (g_strcmp0 ("COGL_TEST_VERBOSE", "1") == 0)
cogl_test_is_verbose = TRUE;

View file

@ -65,7 +65,7 @@ color_hls_roundtrip (void)
cogl_color_to_hsl (&color, &hue, &saturation, &luminance);
g_assert_cmpfloat (hue, ==, 0.0f);
g_assert (luminance >= 0.0f && luminance <= 1.0f);
g_assert_true (luminance >= 0.0f && luminance <= 1.0f);
g_assert_cmpfloat (saturation, ==, 0.0f);
if (!g_test_quiet ())
{
@ -100,9 +100,9 @@ color_hls_roundtrip (void)
(float)0x7f / 255.0f, TEST_CASE_EPSILON);
cogl_color_to_hsl (&color, &hue, &saturation, &luminance);
g_assert (hue >= 0.0f && hue < 360.0f);
g_assert (luminance >= 0.0f && luminance <= 1.0f);
g_assert (saturation >= 0.0f && saturation <= 1.0f);
g_assert_true (hue >= 0.0f && hue < 360.0f);
g_assert_true (luminance >= 0.0f && luminance <= 1.0f);
g_assert_true (saturation >= 0.0f && saturation <= 1.0f);
if (!g_test_quiet ())
{
g_print ("RGB = { %x, %x, %x }, HLS = { %.2f, %.2f, %.2f }\n",
@ -133,15 +133,15 @@ color_from_string_invalid (void)
{
CoglColor color;
g_assert (!cogl_color_from_string (&color, "ff0000ff"));
g_assert (!cogl_color_from_string (&color, "#decaffbad"));
g_assert (!cogl_color_from_string (&color, "ponies"));
g_assert (!cogl_color_from_string (&color, "rgb(255, 0, 0, 0)"));
g_assert (!cogl_color_from_string (&color, "rgba(1.0, 0, 0)"));
g_assert (!cogl_color_from_string (&color, "hsl(100, 0, 0)"));
g_assert (!cogl_color_from_string (&color, "hsla(10%, 0%, 50%)"));
g_assert (!cogl_color_from_string (&color, "hsla(100%, 0%, 50%, 20%)"));
g_assert (!cogl_color_from_string (&color, "hsla(0.5, 0.9, 0.2, 0.4)"));
g_assert_false (cogl_color_from_string (&color, "ff0000ff"));
g_assert_false (cogl_color_from_string (&color, "#decaffbad"));
g_assert_false (cogl_color_from_string (&color, "ponies"));
g_assert_false (cogl_color_from_string (&color, "rgb(255, 0, 0, 0)"));
g_assert_false (cogl_color_from_string (&color, "rgba(1.0, 0, 0)"));
g_assert_false (cogl_color_from_string (&color, "hsl(100, 0, 0)"));
g_assert_false (cogl_color_from_string (&color, "hsla(10%, 0%, 50%)"));
g_assert_false (cogl_color_from_string (&color, "hsla(100%, 0%, 50%, 20%)"));
g_assert_false (cogl_color_from_string (&color, "hsla(0.5, 0.9, 0.2, 0.4)"));
}
static void
@ -149,7 +149,7 @@ color_from_string_valid (void)
{
CoglColor color;
g_assert (cogl_color_from_string (&color, "#ff0000ff"));
g_assert_true (cogl_color_from_string (&color, "#ff0000ff"));
if (!g_test_quiet ())
{
g_print ("color = { %x, %x, %x, %x }, expected = { 0xff, 0, 0, 0xff }\n",
@ -167,7 +167,7 @@ color_from_string_valid (void)
g_assert_cmpfloat_with_epsilon (cogl_color_get_alpha (&color),
1.0f, TEST_CASE_EPSILON);
g_assert (cogl_color_from_string (&color, "#0f0f"));
g_assert_true (cogl_color_from_string (&color, "#0f0f"));
if (!g_test_quiet ())
{
g_print ("color = { %x, %x, %x, %x }, expected = { 0, 0xff, 0, 0xff }\n",
@ -185,7 +185,7 @@ color_from_string_valid (void)
g_assert_cmpfloat_with_epsilon (cogl_color_get_alpha (&color),
1.0f, TEST_CASE_EPSILON);
g_assert (cogl_color_from_string (&color, "#0000ff"));
g_assert_true (cogl_color_from_string (&color, "#0000ff"));
if (!g_test_quiet ())
{
g_print ("color = { %x, %x, %x, %x }, expected = { 0, 0, 0xff, 0xff }\n",
@ -203,7 +203,7 @@ color_from_string_valid (void)
g_assert_cmpfloat_with_epsilon (cogl_color_get_alpha (&color),
1.0f, TEST_CASE_EPSILON);
g_assert (cogl_color_from_string (&color, "#abc"));
g_assert_true (cogl_color_from_string (&color, "#abc"));
if (!g_test_quiet ())
{
g_print ("color = { %x, %x, %x, %x }, expected = { 0xaa, 0xbb, 0xcc, 0xff }\n",
@ -221,7 +221,7 @@ color_from_string_valid (void)
g_assert_cmpfloat_with_epsilon (cogl_color_get_alpha (&color),
1.0f, TEST_CASE_EPSILON);
g_assert (cogl_color_from_string (&color, "#123abc"));
g_assert_true (cogl_color_from_string (&color, "#123abc"));
if (!g_test_quiet ())
{
g_print ("color = { %x, %x, %x, %x }, expected = { 0x12, 0x3a, 0xbc, 0xff }\n",
@ -239,7 +239,7 @@ color_from_string_valid (void)
g_assert_cmpfloat_with_epsilon (cogl_color_get_alpha (&color),
1.0f, TEST_CASE_EPSILON);
g_assert (cogl_color_from_string (&color, "rgb(255, 128, 64)"));
g_assert_true (cogl_color_from_string (&color, "rgb(255, 128, 64)"));
if (!g_test_quiet ())
{
g_print ("color = { %x, %x, %x, %x }, expected = { 255, 128, 64, 255 }\n",
@ -257,7 +257,7 @@ color_from_string_valid (void)
g_assert_cmpfloat_with_epsilon (cogl_color_get_alpha (&color),
1.0f, TEST_CASE_EPSILON);
g_assert (cogl_color_from_string (&color, "rgba ( 30%, 0, 25%, 0.5 ) "));
g_assert_true (cogl_color_from_string (&color, "rgba ( 30%, 0, 25%, 0.5 ) "));
if (!g_test_quiet ())
{
g_print ("color = { %x, %x, %x, %x }, expected = { %.1f, 0, %.1f, 128 }\n",
@ -277,7 +277,7 @@ color_from_string_valid (void)
g_assert_cmpfloat_with_epsilon (cogl_color_get_alpha (&color),
0.5, TEST_CASE_EPSILON);
g_assert (cogl_color_from_string (&color, "rgb( 50%, -50%, 150% )"));
g_assert_true (cogl_color_from_string (&color, "rgb( 50%, -50%, 150% )"));
if (!g_test_quiet ())
{
g_print ("color = { %x, %x, %x, %x }, expected = { 127, 0, 255, 255 }\n",
@ -295,7 +295,7 @@ color_from_string_valid (void)
g_assert_cmpfloat_with_epsilon (cogl_color_get_alpha (&color),
1.0f, TEST_CASE_EPSILON);
g_assert (cogl_color_from_string (&color, "hsl( 0, 100%, 50% )"));
g_assert_true (cogl_color_from_string (&color, "hsl( 0, 100%, 50% )"));
if (!g_test_quiet ())
{
g_print ("color = { %x, %x, %x, %x }, expected = { 255, 0, 0, 255 }\n",
@ -313,9 +313,9 @@ color_from_string_valid (void)
g_assert_cmpfloat_with_epsilon (cogl_color_get_alpha (&color),
1.0f, TEST_CASE_EPSILON);
g_assert (cogl_color_from_string (&color, "hsl( 0, 100%, 50% )"));
g_assert_true (cogl_color_from_string (&color, "hsl( 0, 100%, 50% )"));
g_assert (cogl_color_from_string (&color, "hsla( 0, 100%, 50%, 0.5 )"));
g_assert_true (cogl_color_from_string (&color, "hsla( 0, 100%, 50%, 0.5 )"));
if (!g_test_quiet ())
{
g_print ("color = { %x, %x, %x, %x }, expected = { 255, 0, 0, 127 }\n",
@ -335,7 +335,7 @@ color_from_string_valid (void)
g_test_bug ("662818");
g_assert (cogl_color_from_string (&color, "hsla(0,100%,50% , 0.5)"));
g_assert_true (cogl_color_from_string (&color, "hsla(0,100%,50% , 0.5)"));
}
static void

View file

@ -73,7 +73,7 @@ test_map_buffer_range (void)
COGL_BUFFER_ACCESS_WRITE,
COGL_BUFFER_MAP_HINT_DISCARD_RANGE,
NULL); /* don't catch errors */
g_assert (data != NULL);
g_assert_nonnull (data);
data->x = vertex_data[2].x;
data->y = vertex_data[2].y;

View file

@ -38,9 +38,9 @@ assert_region_color (int x,
{
uint8_t *pixel = &data[y * width * 4 + x * 4];
#if 1
g_assert (pixel[RED] == red &&
pixel[GREEN] == green &&
pixel[BLUE] == blue);
g_assert_true (pixel[RED] == red &&
pixel[GREEN] == green &&
pixel[BLUE] == blue);
#endif
}
g_free (data);

View file

@ -106,7 +106,7 @@ make_texture (void)
}
/* The texture should be sliced unless NPOTs are supported, which they are */
g_assert (!cogl_texture_is_sliced (tex));
g_assert_false (cogl_texture_is_sliced (tex));
return tex;
}

View file

@ -41,8 +41,8 @@ create_bitmap (void)
COGL_PIXEL_FORMAT_RGBA_8888);
buffer = cogl_bitmap_get_buffer (bitmap);
g_assert (COGL_IS_PIXEL_BUFFER (buffer));
g_assert (COGL_IS_BUFFER (buffer));
g_assert_true (COGL_IS_PIXEL_BUFFER (buffer));
g_assert_true (COGL_IS_BUFFER (buffer));
cogl_buffer_set_update_hint (COGL_BUFFER (buffer), COGL_BUFFER_UPDATE_HINT_DYNAMIC);
g_assert_cmpint (cogl_buffer_get_update_hint (COGL_BUFFER (buffer)),
@ -65,7 +65,7 @@ create_and_fill_bitmap (void)
map = cogl_buffer_map (COGL_BUFFER (buffer),
COGL_BUFFER_ACCESS_WRITE,
COGL_BUFFER_MAP_HINT_DISCARD);
g_assert (map);
g_assert_nonnull (map);
generate_bitmap_data (map, stride);
@ -81,7 +81,7 @@ create_texture_from_bitmap (CoglBitmap *bitmap)
texture = cogl_texture_2d_new_from_bitmap (bitmap);
g_assert (texture != NULL);
g_assert_nonnull (texture);
return texture;
}

View file

@ -54,8 +54,8 @@ do_test (gboolean check_orientation,
6, /* row stride */
tex_data,
&error);
g_assert (tex_2d != NULL);
g_assert (error == NULL);
g_assert_nonnull (tex_2d);
g_assert_null (error);
pipeline = cogl_pipeline_new (test_ctx);
cogl_pipeline_set_layer_texture (pipeline, 0, tex_2d);
@ -98,8 +98,8 @@ do_test (gboolean check_orientation,
/* enable */
TRUE,
&error);
g_assert (res == TRUE);
g_assert (error == NULL);
g_assert_true (res);
g_assert_null (error);
solid_pipeline = cogl_pipeline_copy (pipeline);
@ -111,8 +111,8 @@ do_test (gboolean check_orientation,
FALSE,
&error);
g_assert (res == TRUE);
g_assert (error == NULL);
g_assert_true (res);
g_assert_null (error);
}
prim = cogl_primitive_new_p2t2 (test_ctx,

View file

@ -54,8 +54,8 @@ do_test (gboolean check_orientation,
6, /* row stride */
tex_data,
&error);
g_assert (tex_2d != NULL);
g_assert (error == NULL);
g_assert_nonnull (tex_2d);
g_assert_null (error);
pipeline = cogl_pipeline_new (test_ctx);
cogl_pipeline_set_layer_texture (pipeline, 0, tex_2d);
@ -98,8 +98,8 @@ do_test (gboolean check_orientation,
/* enable */
TRUE,
&error);
g_assert (res == TRUE);
g_assert (error == NULL);
g_assert_true (res);
g_assert_null (error);
solid_pipeline = cogl_pipeline_copy (pipeline);
@ -111,8 +111,8 @@ do_test (gboolean check_orientation,
FALSE,
&error);
g_assert (res == TRUE);
g_assert (error == NULL);
g_assert_true (res);
g_assert_null (error);
}
prim = cogl_primitive_new_p2t2 (test_ctx,

View file

@ -219,8 +219,8 @@ validate_result (TestState *state)
for (y = 0; y < 10; y++)
for (x = 0; x < 10; x++)
{
g_assert (*(p++) == x + 40);
g_assert (*(p++) == y + 20);
g_assert_true (*(p++) == x + 40);
g_assert_true (*(p++) == y + 20);
p += 2;
}
g_free (texture_data);
@ -248,7 +248,7 @@ validate_result (TestState *state)
DIVISION_HEIGHT);
uint32_t reference = corner_colors[div_x + div_y * SOURCE_DIVISIONS_X] >> 8;
uint32_t color = GUINT32_FROM_BE (*((uint32_t *)p)) >> 8;
g_assert (color == reference);
g_assert_true (color == reference);
p += 4;
}
g_free (texture_data);
@ -281,17 +281,17 @@ validate_result (TestState *state)
/* If we're in the center quarter */
if (x >= 96 && x < 160 && y >= 96 && y < 160)
{
g_assert ((*p++) == 0);
g_assert ((*p++) == 0);
g_assert ((*p++) == x - 96);
g_assert ((*p++) == y - 96);
g_assert_cmpint ((*p++), ==, 0);
g_assert_cmpint ((*p++), ==, 0);
g_assert_true ((*p++) == x - 96);
g_assert_true ((*p++) == y - 96);
}
else
{
g_assert ((*p++) == x);
g_assert ((*p++) == y);
g_assert ((*p++) == 255);
g_assert ((*p++) == 255);
g_assert_true ((*p++) == x);
g_assert_true ((*p++) == y);
g_assert_true ((*p++) == 255);
g_assert_true ((*p++) == 255);
}
}
g_free (texture_data);

View file

@ -80,15 +80,15 @@ on_paint (ClutterActor *actor,
/* The first pixel should be just one of the colors from the
texture. It doesn't matter which one */
g_assert ((pixels[0] == 255 && pixels[1] == 0 && pixels[2] == 0) ||
(pixels[0] == 0 && pixels[1] == 255 && pixels[2] == 0) ||
(pixels[0] == 0 && pixels[1] == 0 && pixels[2] == 255));
g_assert_true ((pixels[0] == 255 && pixels[1] == 0 && pixels[2] == 0) ||
(pixels[0] == 0 && pixels[1] == 255 && pixels[2] == 0) ||
(pixels[0] == 0 && pixels[1] == 0 && pixels[2] == 255));
/* The second pixel should be more or less the average of all of the
pixels in the texture. Each component gets a third of the image
so each component should be approximately 255/3 */
g_assert (ABS (pixels[4] - 255 / 3) <= 3 &&
ABS (pixels[5] - 255 / 3) <= 3 &&
ABS (pixels[6] - 255 / 3) <= 3);
g_assert_true (ABS (pixels[4] - 255 / 3) <= 3 &&
ABS (pixels[5] - 255 / 3) <= 3 &&
ABS (pixels[6] - 255 / 3) <= 3);
/* Comment this out if you want visual feedback for what this test paints */
#if 1

View file

@ -111,8 +111,8 @@ check_paint (TestState *state, int x, int y, int scale)
else
g_assert_cmpint (p[0], ==, update_value);
g_assert (p[1] == update_value);
g_assert (p[2] == update_value);
g_assert_true (p[1] == update_value);
g_assert_true (p[2] == update_value);
p += 4;
}
else
@ -175,10 +175,10 @@ on_after_paint (ClutterActor *actor,
big_updated = check_paint (state, 0, 0, 1);
small_updated = check_paint (state, 0, PIXMAP_HEIGHT, 4);
g_assert (big_updated == small_updated);
g_assert_true (big_updated == small_updated);
if (state->frame_count < FRAME_COUNT_UPDATED)
g_assert (big_updated == FALSE);
g_assert_true (big_updated == FALSE);
else if (state->frame_count == FRAME_COUNT_UPDATED)
/* Change the pixmap and keep drawing until it updates */
update_pixmap (state);

View file

@ -47,7 +47,7 @@ test_texture_rg (void)
tex = make_texture ();
g_assert (cogl_texture_get_components (tex) == COGL_TEXTURE_COMPONENTS_RG);
g_assert_true (cogl_texture_get_components (tex) == COGL_TEXTURE_COMPONENTS_RG);
pipeline = cogl_pipeline_new (test_ctx);

View file

@ -34,10 +34,10 @@ assert_region_color (int x,
{
uint8_t *pixel = &data[y*width*4 + x*4];
#if 1
g_assert (pixel[RED] == red &&
pixel[GREEN] == green &&
pixel[BLUE] == blue &&
pixel[ALPHA] == alpha);
g_assert_true (pixel[RED] == red &&
pixel[GREEN] == green &&
pixel[BLUE] == blue &&
pixel[ALPHA] == alpha);
#endif
}
g_free (data);

View file

@ -50,15 +50,15 @@ test_pipeline_vertend_glsl_point_size_shader (void)
* the same shader unless there is no builtin uniform for the point
* size */
if (shader_states[0])
g_assert (shader_states[0] != shader_states[1]);
g_assert_true (shader_states[0] != shader_states[1]);
/* The second and third pipelines should always have the same shader
* state because only toggling between zero and non-zero should
* change the shader */
g_assert (shader_states[1] == shader_states[2]);
g_assert_true (shader_states[1] == shader_states[2]);
/* The fourth pipeline should be exactly the same as the first */
g_assert (shader_states[0] == shader_states[3]);
g_assert_true (shader_states[0] == shader_states[3]);
for (i = 0; i < G_N_ELEMENTS (pipelines); i++)
g_object_unref (pipelines[i]);

View file

@ -119,7 +119,7 @@ main (int argc, char **argv)
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NONE);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
system_profile_path = g_test_build_filename (G_TEST_DIST,
"tests",

View file

@ -465,7 +465,7 @@ meta_test_color_management_device_basic (void)
monitor);
g_assert_nonnull (color_device);
g_assert (meta_color_device_get_monitor (color_device) == monitor);
g_assert_true (meta_color_device_get_monitor (color_device) == monitor);
}
}
@ -509,7 +509,7 @@ meta_test_color_management_device_no_gamma (void)
color_device = meta_color_manager_get_color_device (color_manager, monitor);
g_assert_nonnull (color_device);
g_assert (meta_color_device_get_monitor (color_device) == monitor);
g_assert_true (meta_color_device_get_monitor (color_device) == monitor);
while (!meta_color_device_is_ready (color_device))
g_main_context_iteration (NULL, TRUE);
@ -1432,7 +1432,7 @@ main (int argc, char **argv)
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_TEST,
META_CONTEXT_TEST_FLAG_NONE);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -595,7 +595,7 @@ main (int argc,
context = test_context =
meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
init_tests ();

View file

@ -136,7 +136,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;
init_tests ();

View file

@ -278,7 +278,7 @@ run_tests_idle (gpointer user_data)
if (g_signal_has_handler_pending (context, signals[RUN_TESTS], 0, TRUE))
{
g_signal_emit (context, signals[RUN_TESTS], 0, &ret);
g_assert (ret == 1 || ret == 0);
g_assert_true (ret == 1 || ret == 0);
}
else
{

View file

@ -139,7 +139,7 @@ meta_monitor_manager_test_read_current (MetaMonitorManager *manager)
MetaBackendTest *backend_test = META_BACKEND_TEST (backend);
MetaGpu *gpu = meta_backend_test_get_gpu (backend_test);
g_assert (manager_test->test_setup);
g_assert_true (manager_test->test_setup);
meta_gpu_take_modes (gpu, manager_test->test_setup->modes);
meta_gpu_take_crtcs (gpu, manager_test->test_setup->crtcs);

View file

@ -129,7 +129,7 @@ check_monitor_mode (MetaMonitor *monitor,
output = output_from_winsys_id (backend,
data->expect_crtc_mode_iter->output);
g_assert (monitor_crtc_mode->output == output);
g_assert_true (monitor_crtc_mode->output == output);
expect_crtc_mode_index = data->expect_crtc_mode_iter->crtc_mode;
if (expect_crtc_mode_index == -1)
@ -143,7 +143,7 @@ check_monitor_mode (MetaMonitor *monitor,
crtc_mode = g_list_nth_data (meta_gpu_get_modes (gpu),
expect_crtc_mode_index);
}
g_assert (monitor_crtc_mode->crtc_mode == crtc_mode);
g_assert_true (monitor_crtc_mode->crtc_mode == crtc_mode);
if (crtc_mode)
{
@ -198,7 +198,7 @@ check_current_monitor_mode (MetaMonitor *monitor,
crtc_config = meta_crtc_get_config (crtc);
g_assert_nonnull (crtc_config);
g_assert (monitor_crtc_mode->crtc_mode == crtc_config->mode);
g_assert_true (monitor_crtc_mode->crtc_mode == crtc_config->mode);
logical_monitor = meta_monitor_get_logical_monitor (monitor);
g_assert_nonnull (logical_monitor);
@ -262,7 +262,7 @@ check_logical_monitor (MetaMonitorManager *monitor_manager,
test_logical_monitor->transform);
if (logical_monitor == monitor_manager->primary_logical_monitor)
g_assert (meta_logical_monitor_is_primary (logical_monitor));
g_assert_true (meta_logical_monitor_is_primary (logical_monitor));
primary_output = NULL;
monitors = meta_logical_monitor_get_monitors (logical_monitor);
@ -291,7 +291,7 @@ check_logical_monitor (MetaMonitorManager *monitor_manager,
MetaOutput *output = l_output->data;
MetaCrtc *crtc;
g_assert (meta_output_get_monitor (output) == monitor);
g_assert_true (meta_output_get_monitor (output) == monitor);
if (meta_output_is_primary (output))
{
@ -302,10 +302,10 @@ check_logical_monitor (MetaMonitorManager *monitor_manager,
crtc = meta_output_get_assigned_crtc (output);
if (crtc)
{
g_assert (meta_monitor_get_logical_monitor (monitor) ==
logical_monitor);
g_assert (g_list_find ((GList *) meta_crtc_get_outputs (crtc),
output));
g_assert_true (meta_monitor_get_logical_monitor (monitor) ==
logical_monitor);
g_assert_true (g_list_find ((GList *) meta_crtc_get_outputs (crtc),
output));
*all_crtcs = g_list_remove (*all_crtcs, crtc);
}
else
@ -394,7 +394,7 @@ meta_check_monitor_configuration (MetaContext *context,
unsigned int output_max_bpc;
MetaOutputRGBRange rgb_range = META_OUTPUT_RGB_RANGE_AUTO;
g_assert (output == output_from_winsys_id (backend, winsys_id));
g_assert_true (output == output_from_winsys_id (backend, winsys_id));
g_assert_cmpint (expect->monitors[i].is_underscanning,
==,
meta_output_is_underscanning (output));
@ -487,11 +487,11 @@ meta_check_monitor_configuration (MetaContext *context,
expected_current_mode = g_list_nth (modes,
expected_current_mode_index)->data;
g_assert (current_mode == expected_current_mode);
g_assert_true (current_mode == expected_current_mode);
if (current_mode)
g_assert (meta_monitor_is_active (monitor));
g_assert_true (meta_monitor_is_active (monitor));
else
g_assert (!meta_monitor_is_active (monitor));
g_assert_false (meta_monitor_is_active (monitor));
if (current_mode)
{
@ -509,7 +509,7 @@ meta_check_monitor_configuration (MetaContext *context,
}
meta_monitor_derive_current_mode (monitor);
g_assert (current_mode == meta_monitor_get_current_mode (monitor));
g_assert_true (current_mode == meta_monitor_get_current_mode (monitor));
}
n_logical_monitors =
@ -538,7 +538,7 @@ meta_check_monitor_configuration (MetaContext *context,
logical_monitor =
logical_monitor_from_layout (monitor_manager,
&test_logical_monitor->layout);
g_assert (logical_monitor == monitor_manager->primary_logical_monitor);
g_assert_true (logical_monitor == monitor_manager->primary_logical_monitor);
}
all_crtcs = NULL;
@ -597,7 +597,7 @@ meta_check_monitor_configuration (MetaContext *context,
g_debug ("Checking CRTC Output %d",
g_list_index ((GList *) outputs, output));
g_assert (meta_output_get_assigned_crtc (output) == crtc);
g_assert_true (meta_output_get_assigned_crtc (output) == crtc);
g_assert_null (g_list_find (l_output->next, output));
}
@ -606,7 +606,7 @@ meta_check_monitor_configuration (MetaContext *context,
expected_current_mode =
g_list_nth_data (meta_gpu_get_modes (gpu),
expect->crtcs[i].current_mode);
g_assert (crtc_config->mode == expected_current_mode);
g_assert_true (crtc_config->mode == expected_current_mode);
g_assert_cmpuint (crtc_config->transform,
==,

View file

@ -493,7 +493,7 @@ meta_ref_test_verify_view (ClutterStageView *view,
if (flags & META_REFTEST_FLAG_UPDATE_REF)
{
g_assert (ref_status == CAIRO_STATUS_FILE_NOT_FOUND ||
g_assert_true (ref_status == CAIRO_STATUS_FILE_NOT_FOUND ||
ref_status == CAIRO_STATUS_SUCCESS);
if (ref_status == CAIRO_STATUS_SUCCESS)

View file

@ -533,7 +533,7 @@ meta_test_shell_minimize (MetaPlugin *plugin,
data->actor = actor;
data->effect_data = g_new0 (double, 1);
clutter_actor_get_scale (actor, &scale_x, &scale_y);
g_assert (scale_x == scale_y);
g_assert_cmpfloat (scale_x, ==, scale_y);
*((double *) data->effect_data) = scale_x;
g_signal_connect (actor_priv->minimize_timeline, "stopped",
G_CALLBACK (on_minimize_effect_stopped),

View file

@ -210,7 +210,7 @@ meta_async_waiter_process_x11_event (MetaAsyncWaiter *waiter,
MetaX11Display *x11_display,
XSyncAlarmNotifyEvent *event)
{
g_assert (x11_display == waiter->x11_display);
g_assert_true (x11_display == waiter->x11_display);
if (event->alarm != waiter->alarm)
return FALSE;
@ -620,7 +620,7 @@ meta_test_client_new (MetaContext *context,
launcher = g_subprocess_launcher_new ((G_SUBPROCESS_FLAGS_STDIN_PIPE |
G_SUBPROCESS_FLAGS_STDOUT_PIPE));
g_assert (meta_is_wayland_compositor ());
g_assert_true (meta_is_wayland_compositor ());
compositor = meta_context_get_wayland_compositor (context);
wayland_display_name = meta_wayland_get_wayland_display_name (compositor);
#ifdef HAVE_XWAYLAND

View file

@ -154,7 +154,7 @@ sync_effects_completed (struct wl_client *client,
data->callback = wl_resource_create (client, &wl_callback_interface, 1, id);
stage_views = clutter_stage_peek_stage_views (CLUTTER_STAGE (stage));
g_assert (g_list_length (stage_views) > 0);
g_assert_cmpint (g_list_length (stage_views), >, 0);
g_signal_connect (CLUTTER_STAGE (stage), "after-update",
G_CALLBACK (check_for_pending_effects), data);
@ -237,7 +237,7 @@ verify_view (struct wl_client *client,
struct wl_resource *callback;
stage_views = clutter_stage_peek_stage_views (CLUTTER_STAGE (stage));
g_assert (g_list_length (stage_views) > 0);
g_assert_cmpint (g_list_length (stage_views), >, 0);
callback = wl_resource_create (client, &wl_callback_interface, 1, id);
g_signal_connect_after (CLUTTER_STAGE (stage), "after-paint",

View file

@ -195,7 +195,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_TEST,
META_CONTEXT_TEST_FLAG_TEST_CLIENT);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -133,7 +133,7 @@ check_monitor_store_configuration (MetaMonitorConfigStore *config_store,
config = meta_monitor_config_store_lookup (config_store, config_key);
g_assert_nonnull (config);
g_assert (meta_monitors_config_key_equal (config->key, config_key));
g_assert_true (meta_monitors_config_key_equal (config->key, config_key));
meta_monitors_config_key_free (config_key);
g_assert_cmpuint (g_list_length (config->logical_monitor_configs),
@ -146,8 +146,8 @@ check_monitor_store_configuration (MetaMonitorConfigStore *config_store,
GList *k;
int j;
g_assert (mtk_rectangle_equal (&logical_monitor_config->layout,
&config_expect->logical_monitors[i].layout));
g_assert_true (mtk_rectangle_equal (&logical_monitor_config->layout,
&config_expect->logical_monitors[i].layout));
g_assert_cmpfloat (logical_monitor_config->scale,
==,
config_expect->logical_monitors[i].scale);

View file

@ -329,10 +329,10 @@ meta_test_monitor_config_store_set_current_on_empty (void)
meta_monitor_config_manager_set_current (config_manager, linear_config);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
linear_config);
g_assert (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
linear_config);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_null (meta_monitor_config_manager_get_previous (config_manager));
g_assert_null (meta_monitor_config_manager_pop_previous (config_manager));
}
@ -363,25 +363,25 @@ meta_test_monitor_config_store_set_current_with_parent_on_empty (void)
meta_monitor_config_manager_set_current (config_manager, child_config1);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
child_config1);
g_assert (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
child_config1);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_null (meta_monitor_config_manager_get_previous (config_manager));
g_assert_null (meta_monitor_config_manager_pop_previous (config_manager));
child_config2 = meta_monitor_config_manager_create_linear (config_manager);
meta_monitors_config_set_parent_config (child_config2, parent_config);
g_assert (child_config2->parent_config == parent_config);
g_assert_true (child_config2->parent_config == parent_config);
old_current = meta_monitor_config_manager_get_current (config_manager);
g_assert_nonnull (old_current->parent_config);
meta_monitor_config_manager_set_current (config_manager, child_config2);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
child_config2);
g_assert (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
child_config2);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_null (meta_monitor_config_manager_get_previous (config_manager));
g_assert_null (meta_monitor_config_manager_pop_previous (config_manager));
@ -392,10 +392,10 @@ meta_test_monitor_config_store_set_current_with_parent_on_empty (void)
g_assert_nonnull (old_current->parent_config);
meta_monitor_config_manager_set_current (config_manager, child_config3);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
child_config3);
g_assert (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
child_config3);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_null (meta_monitor_config_manager_get_previous (config_manager));
g_assert_null (meta_monitor_config_manager_pop_previous (config_manager));
@ -406,12 +406,12 @@ meta_test_monitor_config_store_set_current_with_parent_on_empty (void)
g_assert_nonnull (old_current->parent_config);
meta_monitor_config_manager_set_current (config_manager, linear_config);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
linear_config);
g_assert (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert (meta_monitor_config_manager_get_previous (config_manager) ==
child_config3);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
linear_config);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_true (meta_monitor_config_manager_get_previous (config_manager) ==
child_config3);
fallback_config =
meta_monitor_config_manager_create_fallback (config_manager);
@ -421,19 +421,19 @@ meta_test_monitor_config_store_set_current_with_parent_on_empty (void)
g_assert_null (old_current->parent_config);
meta_monitor_config_manager_set_current (config_manager, fallback_config);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
fallback_config);
g_assert (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
fallback_config);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert (meta_monitor_config_manager_get_previous (config_manager) ==
linear_config);
g_assert (meta_monitor_config_manager_pop_previous (config_manager) ==
linear_config);
g_assert (meta_monitor_config_manager_get_previous (config_manager) ==
child_config3);
g_assert (meta_monitor_config_manager_pop_previous (config_manager) ==
child_config3);
g_assert_true (meta_monitor_config_manager_get_previous (config_manager) ==
linear_config);
g_assert_true (meta_monitor_config_manager_pop_previous (config_manager) ==
linear_config);
g_assert_true (meta_monitor_config_manager_get_previous (config_manager) ==
child_config3);
g_assert_true (meta_monitor_config_manager_pop_previous (config_manager) ==
child_config3);
g_assert_null (meta_monitor_config_manager_get_previous (config_manager));
g_assert_null (meta_monitor_config_manager_pop_previous (config_manager));
}
@ -457,20 +457,20 @@ meta_test_monitor_config_store_set_current (void)
g_assert_nonnull (fallback_config);
meta_monitor_config_manager_set_current (config_manager, fallback_config);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
fallback_config);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
fallback_config);
old_current = meta_monitor_config_manager_get_current (config_manager);
meta_monitor_config_manager_set_current (config_manager, linear_config);
g_assert (old_current != linear_config);
g_assert_true (old_current != linear_config);
g_assert_nonnull (old_current);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
linear_config);
g_assert (meta_monitor_config_manager_get_previous (config_manager) ==
old_current);
g_assert (meta_monitor_config_manager_pop_previous (config_manager) ==
old_current);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
linear_config);
g_assert_true (meta_monitor_config_manager_get_previous (config_manager) ==
old_current);
g_assert_true (meta_monitor_config_manager_pop_previous (config_manager) ==
old_current);
g_assert_null (meta_monitor_config_manager_get_previous (config_manager));
g_assert_null (meta_monitor_config_manager_pop_previous (config_manager));
@ -496,10 +496,10 @@ meta_test_monitor_config_store_set_current_with_parent (void)
g_assert_null (old_current);
meta_monitor_config_manager_set_current (config_manager, linear_config);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
linear_config);
g_assert (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
linear_config);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_null (meta_monitor_config_manager_get_previous (config_manager));
g_assert_null (meta_monitor_config_manager_pop_previous (config_manager));
@ -512,12 +512,12 @@ meta_test_monitor_config_store_set_current_with_parent (void)
g_assert_null (old_current->parent_config);
meta_monitor_config_manager_set_current (config_manager, fallback_config);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
fallback_config);
g_assert (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert (meta_monitor_config_manager_get_previous (config_manager) ==
old_current);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
fallback_config);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_true (meta_monitor_config_manager_get_previous (config_manager) ==
old_current);
child_config = meta_monitor_config_manager_create_linear (config_manager);
old_current = meta_monitor_config_manager_get_current (config_manager);
@ -525,34 +525,34 @@ meta_test_monitor_config_store_set_current_with_parent (void)
g_assert_nonnull (child_config);
g_assert_nonnull (old_current);
g_assert (old_current == fallback_config);
g_assert_true (old_current == fallback_config);
g_assert_null (old_current->parent_config);
meta_monitor_config_manager_set_current (config_manager, child_config);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
child_config);
g_assert (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert (meta_monitor_config_manager_get_previous (config_manager) ==
linear_config);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
child_config);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_true (meta_monitor_config_manager_get_previous (config_manager) ==
linear_config);
other_child = meta_monitor_config_manager_create_linear (config_manager);
meta_monitors_config_set_parent_config (other_child, old_current);
old_current = meta_monitor_config_manager_get_current (config_manager);
g_assert_nonnull (old_current->parent_config);
g_assert (old_current == child_config);
g_assert_true (old_current == child_config);
meta_monitor_config_manager_set_current (config_manager, other_child);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
other_child);
g_assert (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert (meta_monitor_config_manager_get_previous (config_manager) ==
linear_config);
g_assert (meta_monitor_config_manager_pop_previous (config_manager) ==
linear_config);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
other_child);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) !=
old_current);
g_assert_true (meta_monitor_config_manager_get_previous (config_manager) ==
linear_config);
g_assert_true (meta_monitor_config_manager_pop_previous (config_manager) ==
linear_config);
g_assert_null (meta_monitor_config_manager_get_previous (config_manager));
g_assert_null (meta_monitor_config_manager_pop_previous (config_manager));
@ -578,23 +578,23 @@ meta_test_monitor_config_store_set_current_max_size (void)
linear_config = meta_monitor_config_manager_create_linear (config_manager);
g_assert_nonnull (linear_config);
g_assert (!g_list_find (added, linear_config));
g_assert_false (g_list_find (added, linear_config));
if (i > 0)
{
g_assert (previous !=
meta_monitor_config_manager_get_current (config_manager));
g_assert_true (previous !=
meta_monitor_config_manager_get_current (config_manager));
}
previous = meta_monitor_config_manager_get_current (config_manager);
meta_monitor_config_manager_set_current (config_manager, linear_config);
added = g_list_prepend (added, g_object_ref (linear_config));
g_assert (meta_monitor_config_manager_get_current (config_manager)
== linear_config);
g_assert_true (meta_monitor_config_manager_get_current (config_manager)
== linear_config);
g_assert (meta_monitor_config_manager_get_previous (config_manager)
== previous);
g_assert_true (meta_monitor_config_manager_get_previous (config_manager)
== previous);
}
for (i = 0; i < config_history_max_size - 1; i++)
@ -611,21 +611,21 @@ meta_test_monitor_config_store_set_current_max_size (void)
g_assert_cmpuint (g_list_length (added), >, config_history_max_size);
config = meta_monitor_config_manager_get_current (config_manager);
g_assert (config == g_list_nth_data (added, 0));
g_assert_true (config == g_list_nth_data (added, 0));
for (i = 0; i < config_history_max_size; i++)
{
config = meta_monitor_config_manager_get_previous (config_manager);
g_assert_nonnull (config);
g_assert (meta_monitor_config_manager_pop_previous (config_manager)
== config);
g_assert (config == g_list_nth_data (added, i + 1));
g_assert_true (meta_monitor_config_manager_pop_previous (config_manager)
== config);
g_assert_true (config == g_list_nth_data (added, i + 1));
}
config = meta_monitor_config_manager_get_previous (config_manager);
g_assert_null (config);
g_assert_null (meta_monitor_config_manager_pop_previous (config_manager));
g_assert (config != g_list_nth_data (added, config_history_max_size));
g_assert_true (config != g_list_nth_data (added, config_history_max_size));
g_assert_nonnull (g_list_nth_data (added, config_history_max_size + 1));
}
@ -5221,8 +5221,8 @@ meta_test_monitor_orientation_changes (void)
previous = meta_monitor_config_manager_get_previous (config_manager);
g_assert_true (got_monitors_changed);
g_assert (previous == previous_config);
g_assert (current != initial_config);
g_assert_true (previous == previous_config);
g_assert_true (current != initial_config);
g_assert_true (meta_monitors_config_key_equal (current->key,
initial_config->key));
}
@ -5248,8 +5248,8 @@ meta_test_monitor_orientation_changes (void)
1024, 768));
g_assert_false (got_monitors_changed);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
initial_config);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
initial_config);
/* When no touch device is available, the orientation changes are ignored */
g_test_message ("Removing touch device");
@ -5275,8 +5275,8 @@ meta_test_monitor_orientation_changes (void)
current = meta_monitor_config_manager_get_current (config_manager);
previous = meta_monitor_config_manager_get_previous (config_manager);
g_assert (previous == previous_config);
g_assert (current == initial_config);
g_assert_true (previous == previous_config);
g_assert_true (current == initial_config);
g_assert_false (got_monitors_changed);
}
@ -5422,8 +5422,8 @@ meta_test_monitor_orientation_changes_for_transformed_panel (void)
previous = meta_monitor_config_manager_get_previous (config_manager);
g_assert_true (got_monitors_changed);
g_assert (previous == previous_config);
g_assert (current != initial_config);
g_assert_true (previous == previous_config);
g_assert_true (current != initial_config);
g_assert_true (meta_monitors_config_key_equal (current->key,
initial_config->key));
}
@ -5449,8 +5449,8 @@ meta_test_monitor_orientation_changes_for_transformed_panel (void)
1024, 768));
g_assert_false (got_monitors_changed);
g_assert (meta_monitor_config_manager_get_current (config_manager) ==
initial_config);
g_assert_true (meta_monitor_config_manager_get_current (config_manager) ==
initial_config);
/* When no touch device is available, the orientation changes are ignored */
g_test_message ("Removing touch device");
@ -5476,8 +5476,8 @@ meta_test_monitor_orientation_changes_for_transformed_panel (void)
current = meta_monitor_config_manager_get_current (config_manager);
previous = meta_monitor_config_manager_get_previous (config_manager);
g_assert (previous == previous_config);
g_assert (current == initial_config);
g_assert_true (previous == previous_config);
g_assert_true (current == initial_config);
g_assert_false (got_monitors_changed);
}
@ -8870,7 +8870,7 @@ meta_test_monitor_migrated_rotated (void)
g_assert_nonnull (expected_data);
g_assert_nonnull (migrated_data);
g_assert (strcmp (expected_data, migrated_data) == 0);
g_assert_cmpint (strcmp (expected_data, migrated_data), ==, 0);
migrated_file = g_file_new_for_path (migrated_path);
if (!g_file_delete (migrated_file, NULL, &error))
@ -9148,7 +9148,7 @@ meta_test_monitor_migrated_horizontal_strip (void)
g_assert_nonnull (expected_data);
g_assert_nonnull (migrated_data);
g_assert (strcmp (expected_data, migrated_data) == 0);
g_assert_cmpint (strcmp (expected_data, migrated_data), ==, 0);
migrated_file = g_file_new_for_path (migrated_path);
if (!g_file_delete (migrated_file, NULL, &error))
@ -10442,7 +10442,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_TEST,
META_CONTEXT_TEST_FLAG_TEST_CLIENT);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
path = g_test_build_filename (G_TEST_DIST,
"tests",

View file

@ -63,11 +63,11 @@ test_area (void)
for (i = 0; i < NUM_RANDOM_RUNS; i++)
{
get_random_rect (&temp);
g_assert (mtk_rectangle_area (&temp) == temp.width * temp.height);
g_assert_cmpint (mtk_rectangle_area (&temp), ==, temp.width * temp.height);
}
temp = MTK_RECTANGLE_INIT (0, 0, 5, 7);
g_assert (mtk_rectangle_area (&temp) == 35);
g_assert_cmpint (mtk_rectangle_area (&temp), ==, 35);
}
static void
@ -83,17 +83,17 @@ test_intersect (void)
mtk_rectangle_intersect (&a, &b, &temp);
temp2 = MTK_RECTANGLE_INIT (100, 200, 10, 2);
g_assert (mtk_rectangle_equal (&temp, &temp2));
g_assert (mtk_rectangle_area (&temp) == 20);
g_assert_true (mtk_rectangle_equal (&temp, &temp2));
g_assert_cmpint (mtk_rectangle_area (&temp), ==, 20);
mtk_rectangle_intersect (&a, &c, &temp);
g_assert (mtk_rectangle_area (&temp) == 0);
g_assert_cmpint (mtk_rectangle_area (&temp), ==, 0);
mtk_rectangle_intersect (&a, &d, &temp);
g_assert (mtk_rectangle_area (&temp) == 0);
g_assert_cmpint (mtk_rectangle_area (&temp), ==, 0);
mtk_rectangle_intersect (&b, &d, &b);
g_assert (mtk_rectangle_equal (&b, &b_intersect_d));
g_assert_true (mtk_rectangle_equal (&b, &b_intersect_d));
}
static void
@ -106,11 +106,11 @@ test_equal (void)
MtkRectangle e = {10, 62, 4, 18};
MtkRectangle f = {27, 12, 4, 18};
g_assert ( mtk_rectangle_equal (&a, &b));
g_assert (!mtk_rectangle_equal (&a, &c));
g_assert (!mtk_rectangle_equal (&a, &d));
g_assert (!mtk_rectangle_equal (&a, &e));
g_assert (!mtk_rectangle_equal (&a, &f));
g_assert_true (mtk_rectangle_equal (&a, &b));
g_assert_false (mtk_rectangle_equal (&a, &c));
g_assert_false (mtk_rectangle_equal (&a, &d));
g_assert_false (mtk_rectangle_equal (&a, &e));
g_assert_false (mtk_rectangle_equal (&a, &f));
}
static void
@ -122,16 +122,16 @@ test_overlap_funcs (void)
{
get_random_rect (&temp1);
get_random_rect (&temp2);
g_assert (mtk_rectangle_overlap (&temp1, &temp2) ==
(mtk_rectangle_horiz_overlap (&temp1, &temp2) &&
mtk_rectangle_vert_overlap (&temp1, &temp2)));
g_assert_true (mtk_rectangle_overlap (&temp1, &temp2) ==
(mtk_rectangle_horiz_overlap (&temp1, &temp2) &&
mtk_rectangle_vert_overlap (&temp1, &temp2)));
}
temp1 = MTK_RECTANGLE_INIT ( 0, 0, 10, 10);
temp2 = MTK_RECTANGLE_INIT (20, 0, 10, 5);
g_assert (!mtk_rectangle_overlap (&temp1, &temp2));
g_assert (!mtk_rectangle_horiz_overlap (&temp1, &temp2));
g_assert (mtk_rectangle_vert_overlap (&temp1, &temp2));
g_assert_false (mtk_rectangle_overlap (&temp1, &temp2));
g_assert_false (mtk_rectangle_horiz_overlap (&temp1, &temp2));
g_assert_true (mtk_rectangle_vert_overlap (&temp1, &temp2));
}
static void
@ -154,20 +154,20 @@ test_basic_fitting (void)
{
get_random_rect (&temp1);
get_random_rect (&temp2);
g_assert (mtk_rectangle_contains_rect (&temp1, &temp2) == FALSE ||
mtk_rectangle_could_fit_rect (&temp1, &temp2) == TRUE);
g_assert (mtk_rectangle_contains_rect (&temp2, &temp1) == FALSE ||
mtk_rectangle_could_fit_rect (&temp2, &temp1) == TRUE);
g_assert_true (mtk_rectangle_contains_rect (&temp1, &temp2) == FALSE ||
mtk_rectangle_could_fit_rect (&temp1, &temp2) == TRUE);
g_assert_true (mtk_rectangle_contains_rect (&temp2, &temp1) == FALSE ||
mtk_rectangle_could_fit_rect (&temp2, &temp1) == TRUE);
}
temp1 = MTK_RECTANGLE_INIT ( 0, 0, 10, 10);
temp2 = MTK_RECTANGLE_INIT ( 5, 5, 5, 5);
temp3 = MTK_RECTANGLE_INIT ( 8, 2, 3, 7);
g_assert ( mtk_rectangle_contains_rect (&temp1, &temp2));
g_assert (!mtk_rectangle_contains_rect (&temp2, &temp1));
g_assert (!mtk_rectangle_contains_rect (&temp1, &temp3));
g_assert ( mtk_rectangle_could_fit_rect (&temp1, &temp3));
g_assert (!mtk_rectangle_could_fit_rect (&temp3, &temp2));
g_assert_true (mtk_rectangle_contains_rect (&temp1, &temp2));
g_assert_false (mtk_rectangle_contains_rect (&temp2, &temp1));
g_assert_false (mtk_rectangle_contains_rect (&temp1, &temp3));
g_assert_true (mtk_rectangle_could_fit_rect (&temp1, &temp3));
g_assert_false (mtk_rectangle_could_fit_rect (&temp3, &temp2));
}
static void
@ -194,10 +194,10 @@ test_adjacent_to (void)
unsigned int i;
for (i = 0; i < G_N_ELEMENTS (adjacent); i++)
g_assert (mtk_rectangle_is_adjacent_to (&base, &adjacent[i]));
g_assert_true (mtk_rectangle_is_adjacent_to (&base, &adjacent[i]));
for (i = 0; i < G_N_ELEMENTS (not_adjacent); i++)
g_assert (!mtk_rectangle_is_adjacent_to (&base, &not_adjacent[i]));
g_assert_false (mtk_rectangle_is_adjacent_to (&base, &not_adjacent[i]));
}
static void
@ -205,9 +205,9 @@ test_contains_point (void)
{
MtkRectangle base = { .x = 0, .y = 0, .width = 10, .height = 10 };
g_assert (mtk_rectangle_contains_point (&base, 5, 5));
g_assert (!mtk_rectangle_contains_point (&base, -5, 5));
g_assert (!mtk_rectangle_contains_point (&base, 15, 2));
g_assert_true (mtk_rectangle_contains_point (&base, 5, 5));
g_assert_false (mtk_rectangle_contains_point (&base, -5, 5));
g_assert_false (mtk_rectangle_contains_point (&base, 15, 2));
}
int

View file

@ -28,8 +28,8 @@ test_contains_point (void)
r1 = mtk_region_create_rectangle (&MTK_RECTANGLE_INIT (0, 0, 100, 100));
g_assert (!mtk_region_contains_point (r1, 200, 200));
g_assert (mtk_region_contains_point (r1, 50, 50));
g_assert_false (mtk_region_contains_point (r1, 200, 200));
g_assert_true (mtk_region_contains_point (r1, 50, 50));
}
/* A re-implementation of a pixman translation test */
@ -45,12 +45,12 @@ test_translate (void)
r2 = mtk_region_create_rectangle (&rect);
g_assert_cmpint (mtk_region_num_rectangles (r2), ==, 1);
g_assert (mtk_region_equal (r1, r2));
g_assert_true (mtk_region_equal (r1, r2));
mtk_region_translate (r1, -LARGE, LARGE);
mtk_region_translate (r1, LARGE, -LARGE);
g_assert (mtk_region_equal (r1, r2));
g_assert_true (mtk_region_equal (r1, r2));
}
static void
@ -59,14 +59,14 @@ test_region (void)
g_autoptr (MtkRegion) r1 = NULL;
r1 = mtk_region_create ();
g_assert (mtk_region_is_empty (r1));
g_assert_true (mtk_region_is_empty (r1));
MtkRectangle rect = MTK_RECTANGLE_INIT (5, 5, 20, 20);
mtk_region_union_rectangle (r1, &rect);
g_assert (!mtk_region_is_empty (r1));
g_assert_false (mtk_region_is_empty (r1));
MtkRectangle extents = mtk_region_get_extents (r1);
g_assert (mtk_rectangle_equal (&extents, &rect));
g_assert_true (mtk_rectangle_equal (&extents, &rect));
mtk_region_translate (r1, 15, 20);
extents = mtk_region_get_extents (r1);

View file

@ -132,7 +132,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
init_tests ();

View file

@ -228,7 +228,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS,
META_CONTEXT_TEST_FLAG_NO_X11 |
META_CONTEXT_TEST_FLAG_TEST_CLIENT);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -59,20 +59,20 @@ meta_test_kms_device_sanity (void)
g_assert_cmpuint (g_list_length (devices), ==, 1);
device = META_KMS_DEVICE (devices->data);
g_assert (meta_kms_device_get_kms (device) == kms);
g_assert_true (meta_kms_device_get_kms (device) == kms);
g_assert_cmpstr (meta_kms_device_get_driver_name (device), ==, "vkms");
g_assert_true (meta_kms_device_uses_monotonic_clock (device));
connectors = meta_kms_device_get_connectors (device);
g_assert_cmpuint (g_list_length (connectors), ==, 1);
connector = META_KMS_CONNECTOR (connectors->data);
g_assert (meta_kms_connector_get_device (connector) == device);
g_assert_true (meta_kms_connector_get_device (connector) == device);
g_assert_nonnull (meta_kms_connector_get_preferred_mode (connector));
crtcs = meta_kms_device_get_crtcs (device);
g_assert_cmpuint (g_list_length (crtcs), ==, 1);
crtc = META_KMS_CRTC (crtcs->data);
g_assert (meta_kms_crtc_get_device (crtc) == device);
g_assert_true (meta_kms_crtc_get_device (crtc) == device);
planes = meta_kms_device_get_planes (device);
g_assert_cmpuint (g_list_length (planes), ==, 2);
@ -80,11 +80,11 @@ meta_test_kms_device_sanity (void)
g_assert_nonnull (primary_plane);
cursor_plane = meta_get_cursor_test_plane_for (device, crtc);
g_assert_nonnull (cursor_plane);
g_assert (cursor_plane != primary_plane);
g_assert_true (cursor_plane != primary_plane);
g_assert_nonnull (g_list_find (planes, primary_plane));
g_assert_nonnull (g_list_find (planes, cursor_plane));
g_assert (meta_kms_plane_get_device (primary_plane) == device);
g_assert (meta_kms_plane_get_device (cursor_plane) == device);
g_assert_true (meta_kms_plane_get_device (primary_plane) == device);
g_assert_true (meta_kms_plane_get_device (cursor_plane) == device);
g_assert_true (meta_kms_plane_is_usable_with (primary_plane, crtc));
g_assert_true (meta_kms_plane_is_usable_with (cursor_plane, crtc));
g_assert_cmpint (meta_kms_plane_get_plane_type (primary_plane),
@ -100,7 +100,7 @@ assert_crtc_state_equals (const MetaKmsCrtcState *crtc_state1,
const MetaKmsCrtcState *crtc_state2)
{
g_assert_cmpint (crtc_state1->is_active, ==, crtc_state2->is_active);
g_assert (mtk_rectangle_equal (&crtc_state1->rect, &crtc_state2->rect));
g_assert_true (mtk_rectangle_equal (&crtc_state1->rect, &crtc_state2->rect));
g_assert_cmpint (crtc_state1->is_drm_mode_valid,
==,
crtc_state2->is_drm_mode_valid);
@ -302,7 +302,7 @@ meta_test_kms_device_mode_set (void)
g_assert_true (crtc_state.is_active);
g_assert_true (crtc_state.is_drm_mode_valid);
mode_rect = meta_get_mode_rect (mode);
g_assert (mtk_rectangle_equal (&crtc_state.rect, &mode_rect));
g_assert_true (mtk_rectangle_equal (&crtc_state.rect, &mode_rect));
g_assert_nonnull (meta_kms_connector_get_current_state (connector));
connector_state =
@ -740,7 +740,7 @@ main (int argc,
context = test_context =
meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
init_tests ();

View file

@ -62,7 +62,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -65,7 +65,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -62,7 +62,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -65,7 +65,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -138,7 +138,7 @@ main (int argc, char *argv[])
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
init_tests ();

View file

@ -456,7 +456,7 @@ main (int argc, char *argv[])
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
init_tests ();

View file

@ -82,7 +82,7 @@ on_after_update (ClutterStage *stage,
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
MetaFrameNative *frame_native = meta_frame_native_from_frame (frame);
g_assert (meta_renderer_native_has_pending_mode_sets (renderer_native) ||
g_assert_true (meta_renderer_native_has_pending_mode_sets (renderer_native) ||
!meta_frame_native_has_kms_update (frame_native));
test->number_of_frames_left--;
@ -524,7 +524,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -89,7 +89,7 @@ meta_test_kms_update_sanity (void)
crtc = meta_get_test_kms_crtc (device);
update = meta_kms_update_new (device);
g_assert (meta_kms_update_get_device (update) == device);
g_assert_true (meta_kms_update_get_device (update) == device);
g_assert_null (meta_kms_update_get_primary_plane_assignment (update, crtc));
g_assert_null (meta_kms_update_get_plane_assignments (update));
g_assert_null (meta_kms_update_get_mode_sets (update));
@ -183,23 +183,23 @@ meta_test_kms_update_plane_assignments (void)
meta_kms_plane_assignment_set_cursor_hotspot (cursor_plane_assignment,
10, 11);
g_assert (meta_kms_update_get_primary_plane_assignment (update, crtc) ==
g_assert_true (meta_kms_update_get_primary_plane_assignment (update, crtc) ==
primary_plane_assignment);
g_assert (primary_plane_assignment->crtc == crtc);
g_assert (primary_plane_assignment->update == update);
g_assert (primary_plane_assignment->plane == primary_plane);
g_assert (primary_plane_assignment->buffer == primary_buffer);
g_assert_true (primary_plane_assignment->crtc == crtc);
g_assert_true (primary_plane_assignment->update == update);
g_assert_true (primary_plane_assignment->plane == primary_plane);
g_assert_true (primary_plane_assignment->buffer == primary_buffer);
g_assert_cmpuint (primary_plane_assignment->rotation, ==, 0);
g_assert_false (primary_plane_assignment->cursor_hotspot.is_valid);
g_assert (meta_kms_update_get_cursor_plane_assignment (update, crtc) ==
g_assert_true (meta_kms_update_get_cursor_plane_assignment (update, crtc) ==
cursor_plane_assignment);
g_assert (cursor_plane_assignment->crtc == crtc);
g_assert (cursor_plane_assignment->update == update);
g_assert (cursor_plane_assignment->plane == cursor_plane);
g_assert (cursor_plane_assignment->buffer == cursor_buffer);
g_assert_true (cursor_plane_assignment->crtc == crtc);
g_assert_true (cursor_plane_assignment->update == update);
g_assert_true (cursor_plane_assignment->plane == cursor_plane);
g_assert_true (cursor_plane_assignment->buffer == cursor_buffer);
g_assert_cmpuint (cursor_plane_assignment->rotation, ==, 0);
g_assert_true (cursor_plane_assignment->cursor_hotspot.is_valid);
g_assert_cmpint (cursor_plane_assignment->cursor_hotspot.x, ==, 10);
@ -256,10 +256,10 @@ meta_test_kms_update_mode_sets (void)
g_assert_cmpuint (g_list_length (mode_sets), ==, 1);
mode_set = mode_sets->data;
g_assert (mode_set->crtc == crtc);
g_assert_true (mode_set->crtc == crtc);
g_assert_cmpuint (g_list_length (mode_set->connectors), ==, 1);
g_assert (mode_set->connectors->data == connector);
g_assert (mode_set->mode == mode);
g_assert_true (mode_set->connectors->data == connector);
g_assert_true (mode_set->mode == mode);
meta_kms_update_free (update);
}
@ -288,7 +288,7 @@ page_flip_feedback_flipped (MetaKmsCrtc *kms_crtc,
{
PageFlipData *data = user_data;
g_assert (data->thread == g_thread_self ());
g_assert_true (data->thread == g_thread_self ());
g_assert_cmpint (data->state, ==, INIT);
data->state = PAGE_FLIPPED;
}
@ -327,7 +327,7 @@ page_flip_data_destroy (gpointer user_data)
{
PageFlipData *data = user_data;
g_assert (data->thread == g_thread_self ());
g_assert_true (data->thread == g_thread_self ());
g_assert_cmpint (data->state, ==, PAGE_FLIPPED);
data->state = DESTROYED;
@ -540,20 +540,20 @@ meta_test_kms_update_merge (void)
mode_sets = meta_kms_update_get_mode_sets (update1);
g_assert_cmpuint (g_list_length (mode_sets), ==, 1);
mode_set = mode_sets->data;
g_assert (mode_set->crtc == crtc);
g_assert (mode_set->mode == mode);
g_assert_true (mode_set->crtc == crtc);
g_assert_true (mode_set->mode == mode);
g_assert_cmpuint (g_list_length (mode_set->connectors), ==, 1);
g_assert (mode_set->connectors->data == connector);
g_assert_true (mode_set->connectors->data == connector);
plane_assignments = meta_kms_update_get_plane_assignments (update1);
g_assert_cmpuint (g_list_length (plane_assignments), ==, 2);
plane_assignment = meta_kms_update_get_primary_plane_assignment (update1,
crtc);
g_assert_nonnull (plane_assignment);
g_assert (plane_assignment->update == update1);
g_assert (plane_assignment->crtc == crtc);
g_assert (plane_assignment->plane == primary_plane);
g_assert (plane_assignment->buffer == primary_buffer1);
g_assert_true (plane_assignment->update == update1);
g_assert_true (plane_assignment->crtc == crtc);
g_assert_true (plane_assignment->plane == primary_plane);
g_assert_true (plane_assignment->buffer == primary_buffer1);
g_assert_false (plane_assignment->cursor_hotspot.is_valid);
g_assert_cmpint (plane_assignment->src_rect.x, ==, 0);
g_assert_cmpint (plane_assignment->src_rect.y, ==, 0);
@ -571,10 +571,10 @@ meta_test_kms_update_merge (void)
plane_assignment = meta_kms_update_get_cursor_plane_assignment (update1,
crtc);
g_assert_nonnull (plane_assignment);
g_assert (plane_assignment->update == update1);
g_assert (plane_assignment->crtc == crtc);
g_assert (plane_assignment->plane == cursor_plane);
g_assert (plane_assignment->buffer == META_DRM_BUFFER (cursor_buffer2));
g_assert_true (plane_assignment->update == update1);
g_assert_true (plane_assignment->crtc == crtc);
g_assert_true (plane_assignment->plane == cursor_plane);
g_assert_true (plane_assignment->buffer == META_DRM_BUFFER (cursor_buffer2));
g_assert_true (plane_assignment->cursor_hotspot.is_valid);
g_assert_cmpint (plane_assignment->cursor_hotspot.x, ==, 9);
g_assert_cmpint (plane_assignment->cursor_hotspot.y, ==, 7);
@ -765,7 +765,7 @@ off_thread_callback_thread_func (gpointer user_data)
g_cond_signal (&data->init_cond);
g_mutex_unlock (&data->init_mutex);
g_assert (data->thread == g_thread_self ());
g_assert_true (data->thread == g_thread_self ());
g_main_loop_run (data->thread_loop);
g_main_loop_unref (data->thread_loop);
@ -880,7 +880,7 @@ main (int argc,
context = test_context =
meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
init_tests ();

View file

@ -32,7 +32,7 @@ assert_not_thread (MetaThreadImpl *thread_impl,
{
GThread **thread_to_check = user_data;
g_assert (g_steal_pointer (thread_to_check) != g_thread_self ());
g_assert_true (g_steal_pointer (thread_to_check) != g_thread_self ());
return NULL;
}
@ -44,7 +44,7 @@ assert_thread (MetaThreadImpl *thread_impl,
{
GThread **thread_to_check = user_data;
g_assert (g_steal_pointer (thread_to_check) == g_thread_self ());
g_assert_true (g_steal_pointer (thread_to_check) == g_thread_self ());
return NULL;
}
@ -99,7 +99,7 @@ main (int argc,
context = test_context =
meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
init_tests ();

View file

@ -55,7 +55,7 @@ wait_for_paint (gpointer user_data)
g_assert_cmpint (g_list_length (logical_monitors), ==, 1);
logical_monitor = logical_monitors->data;
g_assert (meta_logical_monitor_get_monitors (logical_monitor)->data ==
g_assert_true (meta_logical_monitor_get_monitors (logical_monitor)->data ==
monitors->data);
layout = meta_logical_monitor_get_layout (logical_monitor);
@ -88,16 +88,16 @@ main (int argc,
g_autoptr (GError) error = NULL;
context = meta_create_context ("Persistent virtual monitor test");
g_assert (meta_context_configure (context, &fake_argc, &fake_argv, &error));
g_assert_true (meta_context_configure (context, &fake_argc, &fake_argv, &error));
meta_context_set_plugin_gtype (context, META_TYPE_TEST_SHELL);
g_assert (meta_context_setup (context, &error));
g_assert (meta_context_start (context, &error));
g_assert_true (meta_context_setup (context, &error));
g_assert_true (meta_context_start (context, &error));
g_idle_add (wait_for_paint, context);
test_context = context;
g_assert (meta_context_run_main_loop (context, &error));
g_assert_true (meta_context_run_main_loop (context, &error));
return EXIT_SUCCESS;
}

View file

@ -133,7 +133,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11 |
META_CONTEXT_TEST_FLAG_TEST_CLIENT);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -96,7 +96,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
init_tests ();

View file

@ -540,7 +540,7 @@ non_default_thread_callback_func (MetaThread *thread,
{
CallbackData *callback_data = user_data;
g_assert (g_thread_self () == callback_data->gthread);
g_assert_true (g_thread_self () == callback_data->gthread);
g_assert_cmpint (callback_data->state, ==, 3);
callback_data->state = 4;
@ -551,7 +551,7 @@ callback_destroy_cb (gpointer user_data)
{
CallbackData *callback_data = user_data;
g_assert (g_thread_self () == callback_data->gthread);
g_assert_true (g_thread_self () == callback_data->gthread);
g_assert_cmpint (callback_data->state, ==, 4);
callback_data->state = 5;
@ -585,7 +585,7 @@ non_default_thread_feedback_func (gpointer retval,
{
CallbackData *callback_data = user_data;
g_assert (g_thread_self () == callback_data->gthread);
g_assert_true (g_thread_self () == callback_data->gthread);
g_assert_cmpint (callback_data->state, ==, 5);
callback_data->state = 6;
@ -860,7 +860,7 @@ meta_test_thread_user_common (void)
g_object_add_weak_pointer (G_OBJECT (thread), (gpointer *) &thread);
g_assert_nonnull (thread);
g_assert_null (error);
g_assert (meta_thread_get_backend (thread) == backend);
g_assert_true (meta_thread_get_backend (thread) == backend);
g_assert_cmpstr (meta_thread_get_name (thread), ==, "test user thread");
test_thread = thread;
@ -887,7 +887,7 @@ meta_test_thread_kernel_common (void)
g_object_add_weak_pointer (G_OBJECT (thread), (gpointer *) &thread);
g_assert_nonnull (thread);
g_assert_null (error);
g_assert (meta_thread_get_backend (thread) == backend);
g_assert_true (meta_thread_get_backend (thread) == backend);
g_assert_cmpstr (meta_thread_get_name (thread), ==, "test kernel thread");
test_thread = thread;
@ -967,7 +967,7 @@ run_task_off_thread_in_impl (MetaThreadImpl *thread_impl,
{
RunTaskOffThreadData *data = user_data;
g_assert (data->gthread != g_thread_self ());
g_assert_true (data->gthread != g_thread_self ());
g_assert_false (data->done);
data->done = TRUE;
@ -984,7 +984,7 @@ run_task_off_thread_thread_func (gpointer user_data)
g_mutex_lock (&data->init_mutex);
g_mutex_unlock (&data->init_mutex);
g_assert (data->gthread == g_thread_self ());
g_assert_true (data->gthread == g_thread_self ());
result = meta_thread_run_impl_task_sync (data->thread,
run_task_off_thread_in_impl,
@ -1023,7 +1023,7 @@ meta_test_thread_run_task_off_thread_common (MetaThreadType thread_type)
data.gthread = g_thread_new ("run task off thread test",
run_task_off_thread_thread_func,
&data);
g_assert (data.main_thread != data.gthread);
g_assert_true (data.main_thread != data.gthread);
g_mutex_unlock (&data.init_mutex);
@ -1056,7 +1056,7 @@ assert_not_thread (MetaThreadImpl *thread_impl,
{
GThread **thread_to_check = user_data;
g_assert (g_steal_pointer (thread_to_check) != g_thread_self ());
g_assert_true (g_steal_pointer (thread_to_check) != g_thread_self ());
return NULL;
}
@ -1068,7 +1068,7 @@ assert_thread (MetaThreadImpl *thread_impl,
{
GThread **thread_to_check = user_data;
g_assert (g_steal_pointer (thread_to_check) == g_thread_self ());
g_assert_true (g_steal_pointer (thread_to_check) == g_thread_self ());
return NULL;
}
@ -1268,7 +1268,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
init_tests ();

View file

@ -71,7 +71,7 @@ meta_test_virtual_monitor_create (void)
g_assert_cmpstr (meta_monitor_get_vendor (monitor), ==, "MetaTestVendor");
g_assert_cmpstr (meta_monitor_get_product (monitor), ==, "MetaVirtualMonitor");
g_assert_cmpstr (meta_monitor_get_serial (monitor), ==, "0x1234");
g_assert (meta_monitor_get_main_output (monitor) ==
g_assert_true (meta_monitor_get_main_output (monitor) ==
meta_virtual_monitor_get_output (virtual_monitor));
monitors_config = meta_monitor_manager_ensure_configured (monitor_manager);
@ -90,7 +90,7 @@ meta_test_virtual_monitor_create (void)
logical_monitor_monitors =
meta_logical_monitor_get_monitors (logical_monitors->data);
g_assert_cmpint (g_list_length (logical_monitor_monitors), ==, 1);
g_assert (logical_monitor_monitors->data == monitor);
g_assert_true (logical_monitor_monitors->data == monitor);
views = meta_renderer_get_views (renderer);
g_assert_cmpint (g_list_length (views), ==, 1);
@ -143,7 +143,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
init_tests (context);

View file

@ -137,7 +137,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
init_ref_test_sanity_tests ();

View file

@ -307,7 +307,7 @@ sanity_check_memfd (struct spa_buffer *buffer)
size = buffer->datas[0].maxsize + buffer->datas[0].mapoffset;
g_assert_cmpint (size, >, 0);
map = mmap (NULL, size, PROT_READ, MAP_PRIVATE, buffer->datas[0].fd, 0);
g_assert (map != MAP_FAILED);
g_assert_true (map != MAP_FAILED);
munmap (map, size);
}

View file

@ -96,7 +96,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -149,7 +149,7 @@ is_on_stage_views (ClutterActor *actor,
}
va_end (valist);
g_assert (g_list_length (stage_views) == n_views);
g_assert_true (g_list_length (stage_views) == n_views);
}
static void
@ -191,8 +191,8 @@ meta_test_actor_stage_views (void)
is_on_stage_views (test_actor, 1, stage_views->data);
/* The signal was emitted for the initial change */
g_assert (stage_views_changed_container);
g_assert (stage_views_changed_test_actor);
g_assert_true (stage_views_changed_container);
g_assert_true (stage_views_changed_test_actor);
stage_views_changed_container = FALSE;
stage_views_changed_test_actor = FALSE;
@ -205,8 +205,8 @@ meta_test_actor_stage_views (void)
is_on_stage_views (test_actor, 1, stage_views->next->data);
/* The signal was emitted again */
g_assert (stage_views_changed_container);
g_assert (stage_views_changed_test_actor);
g_assert_true (stage_views_changed_container);
g_assert_true (stage_views_changed_test_actor);
stage_views_changed_container = FALSE;
stage_views_changed_test_actor = FALSE;
@ -221,8 +221,8 @@ meta_test_actor_stage_views (void)
is_on_stage_views (test_actor, 1, stage_views->data);
/* The signal was emitted again */
g_assert (stage_views_changed_container);
g_assert (stage_views_changed_test_actor);
g_assert_true (stage_views_changed_container);
g_assert_true (stage_views_changed_test_actor);
g_signal_handlers_disconnect_by_func (container, on_stage_views_changed,
stage_views_changed_container_ptr);
@ -317,8 +317,8 @@ meta_test_actor_stage_views_reparent (void)
is_on_stage_views (test_actor, 2, stage_views->data, stage_views->next->data);
/* The signal was emitted for both actors */
g_assert (stage_views_changed_container);
g_assert (stage_views_changed_test_actor);
g_assert_true (stage_views_changed_container);
g_assert_true (stage_views_changed_test_actor);
stage_views_changed_container = FALSE;
stage_views_changed_test_actor = FALSE;
@ -330,8 +330,8 @@ meta_test_actor_stage_views_reparent (void)
is_on_stage_views (test_actor, 0);
/* When the test_actor left the stage, the signal was emitted */
g_assert (!stage_views_changed_container);
g_assert (stage_views_changed_test_actor);
g_assert_false (stage_views_changed_container);
g_assert_true (stage_views_changed_test_actor);
stage_views_changed_test_actor = FALSE;
/* Add the test_actor again as a child of the stage */
@ -347,8 +347,8 @@ meta_test_actor_stage_views_reparent (void)
is_on_stage_views (test_actor, 1, stage_views->data);
/* The signal was emitted for the test_actor again */
g_assert (!stage_views_changed_container);
g_assert (stage_views_changed_test_actor);
g_assert_false (stage_views_changed_container);
g_assert_true (stage_views_changed_test_actor);
stage_views_changed_test_actor = FALSE;
/* Move the container out of the stage... */
@ -357,8 +357,8 @@ meta_test_actor_stage_views_reparent (void)
clutter_actor_remove_child (stage, test_actor);
/* When the test_actor left the stage, the signal was emitted */
g_assert (!stage_views_changed_container);
g_assert (stage_views_changed_test_actor);
g_assert_false (stage_views_changed_container);
g_assert_true (stage_views_changed_test_actor);
stage_views_changed_test_actor = FALSE;
/* ...and reparent the test_actor to the container again */
@ -374,8 +374,8 @@ meta_test_actor_stage_views_reparent (void)
/* The signal was emitted only for the container, the test_actor already
* has no stage-views.
*/
g_assert (stage_views_changed_container);
g_assert (!stage_views_changed_test_actor);
g_assert_true (stage_views_changed_container);
g_assert_false (stage_views_changed_test_actor);
g_signal_handlers_disconnect_by_func (container, on_stage_views_changed,
stage_views_changed_container_ptr);
@ -434,9 +434,9 @@ meta_test_actor_stage_views_hide_parent (void)
is_on_stage_views (test_actor, 1, stage_views->data);
/* The signal was emitted for all three */
g_assert (stage_views_changed_outer_container);
g_assert (stage_views_changed_inner_container);
g_assert (stage_views_changed_test_actor);
g_assert_true (stage_views_changed_outer_container);
g_assert_true (stage_views_changed_inner_container);
g_assert_true (stage_views_changed_test_actor);
stage_views_changed_outer_container = FALSE;
stage_views_changed_inner_container = FALSE;
stage_views_changed_test_actor = FALSE;
@ -458,9 +458,9 @@ meta_test_actor_stage_views_hide_parent (void)
is_on_stage_views (test_actor, 1, stage_views->data);
/* The signal was emitted for the outer_container */
g_assert (stage_views_changed_outer_container);
g_assert (!stage_views_changed_inner_container);
g_assert (!stage_views_changed_test_actor);
g_assert_true (stage_views_changed_outer_container);
g_assert_false (stage_views_changed_inner_container);
g_assert_false (stage_views_changed_test_actor);
stage_views_changed_outer_container = FALSE;
/* Show the inner_container again */
@ -477,9 +477,9 @@ meta_test_actor_stage_views_hide_parent (void)
stage_views->data, stage_views->next->data);
/* The signal was emitted for the inner_container and test_actor */
g_assert (!stage_views_changed_outer_container);
g_assert (stage_views_changed_inner_container);
g_assert (stage_views_changed_test_actor);
g_assert_false (stage_views_changed_outer_container);
g_assert_true (stage_views_changed_inner_container);
g_assert_true (stage_views_changed_test_actor);
g_signal_handlers_disconnect_by_func (outer_container, on_stage_views_changed,
stage_views_changed_outer_container_ptr);
@ -565,10 +565,10 @@ meta_test_actor_stage_views_hot_plug (void)
stage_views = clutter_stage_peek_stage_views (CLUTTER_STAGE (stage));
g_assert (stage_views != prev_stage_views);
g_assert_true (stage_views != prev_stage_views);
g_assert_cmpint (g_list_length (stage_views), ==, 2);
g_assert (prev_stage_views->data != stage_views->data);
g_assert (prev_stage_views->next->data != stage_views->next->data);
g_assert_true (prev_stage_views->data != stage_views->data);
g_assert_true (prev_stage_views->next->data != stage_views->next->data);
assert_is_stage_view (stage_views->data, 0, 0, 1024, 768);
assert_is_stage_view (stage_views->next->data, 1024, 0, 1024, 768);
@ -699,13 +699,13 @@ on_transition_new_frame (ClutterTransition *transition,
if (test->phase == 1)
{
g_assert (clutter_timeline_get_frame_clock (timeline) ==
g_assert_true (clutter_timeline_get_frame_clock (timeline) ==
test->frame_clock_1);
test->frame_counter[0]++;
}
else if (test->phase == 2)
{
g_assert (clutter_timeline_get_frame_clock (timeline) ==
g_assert_true (clutter_timeline_get_frame_clock (timeline) ==
test->frame_clock_2);
test->frame_counter[1]++;
}
@ -723,7 +723,7 @@ on_transition_frame_clock_changed (ClutterTimeline *timeline,
ClutterFrameClock *frame_clock;
frame_clock = clutter_timeline_get_frame_clock (timeline);
g_assert (frame_clock == test->frame_clock_2);
g_assert_true (frame_clock == test->frame_clock_2);
g_assert_cmpint (test->phase, ==, 1);
test->phase = 2;
@ -785,7 +785,7 @@ meta_test_actor_stage_views_timeline (void)
transition = clutter_actor_get_transition (actor, "position");
g_assert_nonnull (transition);
g_assert (clutter_timeline_get_frame_clock (CLUTTER_TIMELINE (transition)) ==
g_assert_true (clutter_timeline_get_frame_clock (CLUTTER_TIMELINE (transition)) ==
test.frame_clock_1);
test.main_loop = g_main_loop_new (NULL, FALSE);
@ -865,7 +865,7 @@ meta_test_actor_stage_views_parent_views_rebuilt (void)
view_frame_clock = clutter_stage_view_get_frame_clock (stage_views->data);
g_assert_nonnull (timeline_frame_clock);
g_assert_nonnull (view_frame_clock);
g_assert (timeline_frame_clock == view_frame_clock);
g_assert_true (timeline_frame_clock == view_frame_clock);
/* Keep the stage view alive so it can be used to compare with later. */
old_stage_view = g_object_ref (stage_views->data);
@ -881,14 +881,14 @@ meta_test_actor_stage_views_parent_views_rebuilt (void)
stage_views = clutter_stage_peek_stage_views (CLUTTER_STAGE (stage));
g_assert_cmpint (g_list_length (stage_views), ==, 1);
g_assert (stage_views->data != old_stage_view);
g_assert_true (stage_views->data != old_stage_view);
view_frame_clock = clutter_stage_view_get_frame_clock (stage_views->data);
g_assert_nonnull (view_frame_clock);
g_assert (view_frame_clock != old_frame_clock);
g_assert_true (view_frame_clock != old_frame_clock);
timeline_frame_clock = clutter_timeline_get_frame_clock (timeline);
g_assert_nonnull (timeline_frame_clock);
g_assert (timeline_frame_clock == view_frame_clock);
g_assert_true (timeline_frame_clock == view_frame_clock);
g_object_unref (old_stage_view);
g_object_unref (old_frame_clock);
@ -960,14 +960,14 @@ meta_test_actor_stage_views_parent_views_changed (void)
timeline_frame_clock = clutter_timeline_get_frame_clock (timeline);
g_assert_nonnull (timeline_frame_clock);
g_assert (timeline_frame_clock == first_view_frame_clock);
g_assert_true (timeline_frame_clock == first_view_frame_clock);
clutter_actor_set_x (container, 1200);
wait_for_paint (stage);
timeline_frame_clock = clutter_timeline_get_frame_clock (timeline);
g_assert_nonnull (timeline_frame_clock);
g_assert (timeline_frame_clock == second_view_frame_clock);
g_assert_true (timeline_frame_clock == second_view_frame_clock);
g_object_unref (timeline);
clutter_actor_destroy (test_actor);
@ -1043,7 +1043,7 @@ meta_test_actor_stage_views_and_frame_clocks_freed (void)
timeline_frame_clock = clutter_timeline_get_frame_clock (timeline);
g_assert_nonnull (timeline_frame_clock);
g_assert (timeline_frame_clock == first_view_frame_clock);
g_assert_true (timeline_frame_clock == first_view_frame_clock);
/* Now set the timeline actor to actor_2 and make sure the timeline is
* using the second frame clock.
@ -1053,7 +1053,7 @@ meta_test_actor_stage_views_and_frame_clocks_freed (void)
timeline_frame_clock = clutter_timeline_get_frame_clock (timeline);
g_assert_nonnull (timeline_frame_clock);
g_assert (timeline_frame_clock == second_view_frame_clock);
g_assert_true (timeline_frame_clock == second_view_frame_clock);
/* Trigger a hotplug and remove both monitors, after that the timeline
* should have no frame clock set and both stage views and their
@ -1367,7 +1367,7 @@ main (int argc, char *argv[])
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_TEST,
META_CONTEXT_TEST_FLAG_TEST_CLIENT);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -2392,7 +2392,7 @@ main (int argc, char **argv)
meta_context_add_option_entries (context, options, NULL);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
tests = g_ptr_array_new_with_free_func (g_free);
if (all_tests)

View file

@ -171,7 +171,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -174,7 +174,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -153,7 +153,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -240,7 +240,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
#endif
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -138,8 +138,8 @@ handle_xdg_toplevel_configure (void *user_data,
struct wl_array *states)
{
WaylandDisplay *display;
g_assert (width > 0 || prev_width > 0);
g_assert (height > 0 || prev_width > 0);
g_assert_true (width > 0 || prev_width > 0);
g_assert_true (height > 0 || prev_width > 0);
display = user_data;
if (width > 0 && height > 0)
@ -214,7 +214,7 @@ static void
on_sync_event (WaylandDisplay *display,
uint32_t serial)
{
g_assert (serial == 0);
g_assert_cmpint (serial, ==, 0);
running = FALSE;
}

View file

@ -101,7 +101,7 @@ event_queue_assert_event (GQueue *event_queue,
DrmLeaseEventType expected)
{
DrmLeaseEventType actual = GPOINTER_TO_UINT (g_queue_pop_head (event_queue));
g_assert (expected == actual);
g_assert_cmpint (expected, ==, actual);
}
static void

View file

@ -71,7 +71,7 @@ static void
on_sync_event (WaylandDisplay *display,
uint32_t serial)
{
g_assert (serial == 0);
g_assert_cmpint (serial, ==, 0);
running = FALSE;
}

View file

@ -96,7 +96,7 @@ static void
handle_buffer_release (void *data,
struct wl_buffer *callback_buffer)
{
g_assert (callback_buffer == buffer);
g_assert_true (callback_buffer == buffer);
g_clear_pointer (&buffer, wl_buffer_destroy);
}

View file

@ -246,7 +246,7 @@ static void
on_sync_event (WaylandDisplay *display,
uint32_t serial)
{
g_assert (serial == 0);
g_assert_cmpint (serial, ==, 0);
/* Sync event 0 is sent when the popup window actor is destroyed;
* prepare for opening a popup for the same wl_surface.

View file

@ -1101,7 +1101,7 @@ wayland_buffer_shm_mmap_plane (WaylandBuffer *buffer,
size_t *stride_out)
{
WaylandBufferShm *shm = WAYLAND_BUFFER_SHM (buffer);
g_assert (plane < shm->n_planes);
g_assert_true (plane < shm->n_planes);
if (stride_out)
*stride_out = shm->stride[plane];
@ -1398,7 +1398,7 @@ wayland_buffer_dmabuf_mmap_plane (WaylandBuffer *buffer,
size_t *stride_out)
{
WaylandBufferDmabuf *dmabuf = WAYLAND_BUFFER_DMABUF (buffer);
g_assert (plane < dmabuf->n_planes);
g_assert_true (plane < dmabuf->n_planes);
if (stride_out)
*stride_out = dmabuf->map_stride[plane];

View file

@ -120,8 +120,8 @@ handle_xdg_surface_configure (void *data,
case STATE_INIT:
g_assert_not_reached ();
case STATE_WAIT_FOR_CONFIGURE_1:
g_assert (pending_bounds_width > 0);
g_assert (pending_bounds_height > 0);
g_assert_true (pending_bounds_width > 0);
g_assert_true (pending_bounds_height > 0);
draw_main (display,
pending_bounds_width - 10,
@ -147,7 +147,7 @@ static void
on_sync_event (WaylandDisplay *display,
uint32_t serial)
{
g_assert (serial == 0);
g_assert_cmpint (serial, ==, 0);
exit (EXIT_SUCCESS);
}

View file

@ -1099,7 +1099,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);
#endif
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -278,7 +278,7 @@ main (int argc,
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_TEST_CLIENT);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;

View file

@ -272,7 +272,7 @@ meta_test_xwayland_compositor_selection (void)
g_assert_null (meta_display_get_x11_display (display));
g_assert (meta_is_wayland_compositor ());
g_assert_true (meta_is_wayland_compositor ());
compositor = meta_context_get_wayland_compositor (test_context);
x11_display_name = meta_wayland_get_public_xwayland_display_name (compositor);
g_assert_nonnull (x11_display_name);
@ -322,7 +322,7 @@ main (int argc,
context = test_context =
meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_TEST_CLIENT);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
g_assert_true (meta_context_configure (context, &argc, &argv, NULL));
init_tests ();