mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-05 08:56:16 +01:00
Improve GError test coverage
This commit is contained in:
parent
e181234fe5
commit
6e1d205ad3
@ -61,6 +61,23 @@ test_literal (void)
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
static void
|
||||
test_copy (void)
|
||||
{
|
||||
GError *error;
|
||||
GError *copy;
|
||||
|
||||
error = NULL;
|
||||
g_set_error_literal (&error, G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY, "%s %d %x");
|
||||
copy = g_error_copy (error);
|
||||
|
||||
g_assert_error (copy, G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY);
|
||||
g_assert_cmpstr (copy->message, ==, "%s %d %x");
|
||||
|
||||
g_error_free (error);
|
||||
g_error_free (copy);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
@ -69,6 +86,7 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/error/overwrite", test_overwrite);
|
||||
g_test_add_func ("/error/prefix", test_prefix);
|
||||
g_test_add_func ("/error/literal", test_literal);
|
||||
g_test_add_func ("/error/copy", test_copy);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user