Commit 4d1075a0 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

testsuite: Reduce the use of g_assert

Stop using g_assert() in the gsk tests.
parent 442f4855
......@@ -104,9 +104,11 @@ save_image (cairo_surface_t *surface,
const char *extension)
{
char *filename = get_output_file (test_name, ".node", extension);
int status;
g_print ("Storing test result image at %s\n", filename);
g_assert (cairo_surface_write_to_png (surface, filename) == CAIRO_STATUS_SUCCESS);
status = cairo_surface_write_to_png (surface, filename);
g_assert_true (status == CAIRO_STATUS_SUCCESS);
g_free (filename);
}
......@@ -207,12 +209,12 @@ main (int argc, char **argv)
g_bytes_unref (bytes);
g_assert_no_error (error);
g_assert (node != NULL);
g_assert_nonnull (node);
}
/* Render the .node file and download to cairo surface */
texture = gsk_renderer_render_texture (renderer, node, NULL);
g_assert (texture != NULL);
g_assert_nonnull (texture);
rendered_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
gdk_texture_get_width (texture),
......
......@@ -173,7 +173,7 @@ parse_node_file (GFile *file, gboolean generate)
g_clear_error (&error);
return FALSE;
}
g_assert (bytes != NULL);
g_assert_nonnull (bytes);
errors = g_string_new ("");
......
......@@ -266,7 +266,7 @@ test_invert (void)
transform = apply_test_transform (transform, j);
transform = apply_test_transform (transform, k);
inverse = gsk_transform_invert (gsk_transform_ref (transform));
g_assert (inverse != NULL || transform == NULL);
g_assert_true (inverse != NULL || transform == NULL);
identity = gsk_transform_transform (gsk_transform_ref (transform), inverse);
graphene_assert_fuzzy_transform_equal (identity, NULL, EPSILON);
......@@ -372,6 +372,7 @@ test_print_parse (void)
GskTransform *transform, *parsed;
guint i, j, k;
char *str1, *str2;
gboolean ret;
for (i = 0; i < G_N_ELEMENTS (test_transforms); i++)
{
......@@ -384,14 +385,15 @@ test_print_parse (void)
transform = apply_test_transform (transform, k);
str1 = gsk_transform_to_string (transform);
g_assert (str1);
g_assert (strlen (str1) > 0);
g_assert_nonnull (str1);
g_assert_true (strlen (str1) > 0);
str2 = gsk_transform_to_string (transform);
g_assert_cmpstr (str1, ==, str2);
g_free (str2);
g_assert (gsk_transform_parse (str1, &parsed));
ret = gsk_transform_parse (str1, &parsed);
g_assert_true (ret);
graphene_assert_fuzzy_transform_equal (parsed, transform, EPSILON);
str2 = gsk_transform_to_string (parsed);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment