diff options
author | Emmanuele Bassi <ebassi@gmail.com> | 2022-10-11 09:57:12 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2022-10-11 09:57:12 +0000 |
commit | 3054c85cb86d3c13128b496c8b116a4a40f0764d (patch) | |
tree | d520bc9f7d1bbaf6b6810d6253b728532bfe14a2 /json-glib/tests/invalid.c | |
parent | aaee26ac0be80bf952b4cd9ffd72218f24f83bed (diff) | |
parent | cc83006f66d00c78efc2fdbe109eab1724dc0958 (diff) | |
download | json-glib-1-6.tar.gz |
Merge branch 'feature/drop_raw_g_assert' into 'master'json-glib-1-6
Drop usage of raw g_assert in reader test in favor of g_assert_*()
See merge request GNOME/json-glib!54
Diffstat (limited to 'json-glib/tests/invalid.c')
-rw-r--r-- | json-glib/tests/invalid.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/json-glib/tests/invalid.c b/json-glib/tests/invalid.c index cb5f818..5197e9f 100644 --- a/json-glib/tests/invalid.c +++ b/json-glib/tests/invalid.c @@ -16,14 +16,14 @@ test_invalid_bareword (gconstpointer user_data) gboolean res; parser = json_parser_new (); - g_assert (JSON_IS_PARSER (parser)); + g_assert_true (JSON_IS_PARSER (parser)); if (g_test_verbose ()) g_print ("invalid data: '%s'...", json); res = json_parser_load_from_data (parser, json, -1, &error); - g_assert (!res); + g_assert_false (res); g_assert_error (error, JSON_PARSER_ERROR, JSON_PARSER_ERROR_INVALID_BAREWORD); if (g_test_verbose ()) @@ -43,15 +43,15 @@ test_invalid_assignment (gconstpointer user_data) gboolean res; parser = json_parser_new (); - g_assert (JSON_IS_PARSER (parser)); + g_assert_true (JSON_IS_PARSER (parser)); if (g_test_verbose ()) g_print ("invalid data: '%s'...", json); res = json_parser_load_from_data (parser, json, -1, &error); - g_assert (!res); - g_assert (error != NULL); + g_assert_false (res); + g_assert_nonnull (error); if (g_test_verbose ()) g_print ("expected error: %s\n", error->message); @@ -70,15 +70,15 @@ test_invalid_value (gconstpointer user_data) gboolean res; parser = json_parser_new (); - g_assert (JSON_IS_PARSER (parser)); + g_assert_true (JSON_IS_PARSER (parser)); if (g_test_verbose ()) g_print ("invalid data: '%s'...", json); res = json_parser_load_from_data (parser, json, -1, &error); - g_assert (!res); - g_assert (error != NULL); + g_assert_false (res); + g_assert_nonnull (error); if (g_test_verbose ()) g_print ("expected error: %s\n", error->message); @@ -97,15 +97,15 @@ test_invalid_array (gconstpointer user_data) gboolean res; parser = json_parser_new (); - g_assert (JSON_IS_PARSER (parser)); + g_assert_true (JSON_IS_PARSER (parser)); if (g_test_verbose ()) g_print ("invalid data: '%s'...", json); res = json_parser_load_from_data (parser, json, -1, &error); - g_assert (!res); - g_assert (error != NULL); + g_assert_false (res); + g_assert_nonnull (error); if (g_test_verbose ()) g_print ("expected error: %s\n", error->message); @@ -124,15 +124,15 @@ test_invalid_object (gconstpointer user_data) gboolean res; parser = json_parser_new (); - g_assert (JSON_IS_PARSER (parser)); + g_assert_true (JSON_IS_PARSER (parser)); if (g_test_verbose ()) g_print ("invalid data: '%s'...", json); res = json_parser_load_from_data (parser, json, -1, &error); - g_assert (!res); - g_assert (error != NULL); + g_assert_false (res); + g_assert_nonnull (error); if (g_test_verbose ()) g_print ("expected error: %s\n", error->message); @@ -151,14 +151,14 @@ test_missing_comma (gconstpointer user_data) gboolean res; parser = json_parser_new (); - g_assert (JSON_IS_PARSER (parser)); + g_assert_true (JSON_IS_PARSER (parser)); if (g_test_verbose ()) g_print ("invalid data: '%s'...", json); res = json_parser_load_from_data (parser, json, -1, &error); - g_assert (!res); + g_assert_false (res); g_assert_error (error, JSON_PARSER_ERROR, JSON_PARSER_ERROR_MISSING_COMMA); if (g_test_verbose ()) @@ -178,14 +178,14 @@ test_trailing_comma (gconstpointer user_data) gboolean res; parser = json_parser_new (); - g_assert (JSON_IS_PARSER (parser)); + g_assert_true (JSON_IS_PARSER (parser)); if (g_test_verbose ()) g_print ("invalid data: '%s'...", json); res = json_parser_load_from_data (parser, json, -1, &error); - g_assert (!res); + g_assert_false (res); g_assert_error (error, JSON_PARSER_ERROR, JSON_PARSER_ERROR_TRAILING_COMMA); if (g_test_verbose ()) |