diff options
author | Juan A. Suarez Romero <jasuarez@igalia.com> | 2014-03-05 19:40:46 +0100 |
---|---|---|
committer | Juan A. Suarez Romero <jasuarez@igalia.com> | 2014-03-05 21:23:40 +0000 |
commit | 6eea596179a834ef0e0a3b5103554e9d2a4ce705 (patch) | |
tree | e3bded5a2d6a448d8b43a1ffc7bd67c44e2cfca3 /tests | |
parent | 72cd172512703463935a49a19fffc1b882676742 (diff) | |
download | grilo-plugins-6eea596179a834ef0e0a3b5103554e9d2a4ce705.tar.gz |
all: Use g_clear_pointer/object when possible
Reduces the number of lines and makes the code more readable.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tmdb/test_tmdb_fast_resolution.c | 7 | ||||
-rw-r--r-- | tests/tmdb/test_tmdb_fast_resolution_by_id.c | 7 | ||||
-rw-r--r-- | tests/tmdb/test_tmdb_full_resolution.c | 7 | ||||
-rw-r--r-- | tests/tmdb/test_tmdb_missing_configuration.c | 11 | ||||
-rw-r--r-- | tests/tmdb/test_tmdb_preconditions.c | 7 |
5 files changed, 11 insertions, 28 deletions
diff --git a/tests/tmdb/test_tmdb_fast_resolution.c b/tests/tmdb/test_tmdb_fast_resolution.c index 2202898..f8e9105 100644 --- a/tests/tmdb/test_tmdb_fast_resolution.c +++ b/tests/tmdb/test_tmdb_fast_resolution.c @@ -85,11 +85,8 @@ test_fast_resolution (void) g_assert (grl_media_get_publication_date (media) == NULL); - g_object_unref (media); - media = NULL; - - g_object_unref (options); - options = NULL; + g_clear_object (&media); + g_clear_object (&options); test_shutdown_tmdb (); } diff --git a/tests/tmdb/test_tmdb_fast_resolution_by_id.c b/tests/tmdb/test_tmdb_fast_resolution_by_id.c index e177beb..22ab50b 100644 --- a/tests/tmdb/test_tmdb_fast_resolution_by_id.c +++ b/tests/tmdb/test_tmdb_fast_resolution_by_id.c @@ -87,11 +87,8 @@ test_fast_resolution_by_id (void) g_assert (grl_media_get_publication_date (media) == NULL); - g_object_unref (media); - media = NULL; - - g_object_unref (options); - options = NULL; + g_clear_object (&media); + g_clear_object (&options); test_shutdown_tmdb (); } diff --git a/tests/tmdb/test_tmdb_full_resolution.c b/tests/tmdb/test_tmdb_full_resolution.c index b9676c0..dd8ce97 100644 --- a/tests/tmdb/test_tmdb_full_resolution.c +++ b/tests/tmdb/test_tmdb_full_resolution.c @@ -144,11 +144,8 @@ test_full_resolution (void) test_region_certificate (media, "DK", "15"); test_region_certificate (media, "US", "PG-13"); - g_object_unref (media); - media = NULL; - - g_object_unref (options); - options = NULL; + g_clear_object (&media); + g_clear_object (&options); test_shutdown_tmdb (); } diff --git a/tests/tmdb/test_tmdb_missing_configuration.c b/tests/tmdb/test_tmdb_missing_configuration.c index 74fbef4..cd56c7e 100644 --- a/tests/tmdb/test_tmdb_missing_configuration.c +++ b/tests/tmdb/test_tmdb_missing_configuration.c @@ -55,14 +55,9 @@ test_missing_configuration (void) * file would have resulted in an error */ g_assert (error != NULL); - g_object_unref (media); - media = NULL; - - g_object_unref (options); - options = NULL; - - g_error_free (error); - error = NULL; + g_clear_object (&media); + g_clear_object (&options); + g_clear_error (&error); test_shutdown_tmdb (); } diff --git a/tests/tmdb/test_tmdb_preconditions.c b/tests/tmdb/test_tmdb_preconditions.c index 2d6f866..73f0de7 100644 --- a/tests/tmdb/test_tmdb_preconditions.c +++ b/tests/tmdb/test_tmdb_preconditions.c @@ -78,11 +78,8 @@ test_preconditions (void) &error); g_assert_no_error (error); - g_object_unref (media); - media = NULL; - - g_object_unref (options); - options = NULL; + g_clear_object (&media); + g_clear_object (&options); test_shutdown_tmdb (); } |