[glib: 2/7] tests: Drop pointless assignments



commit c25e8ec1f2f556bd76aa1b14a7d4f650ae374343
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Oct 30 15:12:17 2019 +0000

    tests: Drop pointless assignments
    
    Or turn them into proper error checks. This shuts up some `scan-build`
    warnings.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 gio/tests/live-g-file.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gio/tests/live-g-file.c b/gio/tests/live-g-file.c
index df56e9f17..7638ee5be 100644
--- a/gio/tests/live-g-file.c
+++ b/gio/tests/live-g-file.c
@@ -202,8 +202,8 @@ test_create_structure (gconstpointer test_data)
   g_assert (root != NULL);
 
   /*  create root directory  */
-  res = g_file_make_directory (root, NULL, NULL);
-  /*  don't care about errors here  */
+  g_file_make_directory (root, NULL, &error);
+  g_assert_no_error (error);
 
   /*  create any other items  */
   for (i = 0; i < G_N_ELEMENTS (sample_struct); i++)
@@ -285,11 +285,11 @@ test_create_structure (gconstpointer test_data)
   g_assert (outds != NULL);
   for (i = 0; i < PATTERN_FILE_SIZE; i++)
     {
-      res = g_data_output_stream_put_byte (outds, i % 256, NULL, &error);
+      g_data_output_stream_put_byte (outds, i % 256, NULL, &error);
       g_assert_no_error (error);
     }
 
-  res = g_output_stream_close (G_OUTPUT_STREAM (outs), NULL, &error);
+  g_output_stream_close (G_OUTPUT_STREAM (outs), NULL, &error);
   g_assert_no_error (error);
   g_object_unref (outds);
   g_object_unref (outs);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]