tests: Add some return value checking to pacify Coverity
authorColin Walters <walters@verbum.org>
Mon, 31 Jul 2017 13:27:56 +0000 (09:27 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 2 Aug 2017 15:34:16 +0000 (15:34 +0000)
No real problems here, but Coverity likes to see consistent checking of return
values, and I agree with it.

Coverity CID: 1452213
Coverity CID: 1452211

Closes: #1037
Approved by: jlebon

src/ostree/ostree-trivial-httpd.c
tests/test-bsdiff.c
tests/test-mutable-tree.c

index 176f5ec769bd6752cd3cbde19d243db6e8ce77e1..de04e9a496af6321ab56fec2a6dcb23fb59b370d 100644 (file)
@@ -94,7 +94,7 @@ httpd_log (OtTrivialHttpd *httpd, const gchar *format, ...)
   g_string_append_vprintf (str, format, args);
   va_end (args);
 
-  g_output_stream_write_all (httpd->log, str->str, str->len, &written, NULL, NULL);
+  (void)g_output_stream_write_all (httpd->log, str->str, str->len, &written, NULL, NULL);
 }
 
 static int
index 24772a1e1e864ab20bbd56bc8c90f44c61c81b2e..0bf500da0ad04805ccd9a677600c5daf76cf6c71 100644 (file)
@@ -86,7 +86,7 @@ test_bsdiff (void)
   bsdiff_stream.opaque = out;
   g_assert_cmpint (bsdiff (old, OLD_SIZE, new, NEW_SIZE, &bsdiff_stream), ==, 0);
 
-  g_output_stream_close (out, NULL, NULL);
+  g_assert (g_output_stream_close (out, NULL, NULL));
 
   /* Now generate NEW_GENERATED from OLD and OUT.  */
   { g_autoptr(GBytes) bytes = g_memory_output_stream_steal_as_bytes (G_MEMORY_OUTPUT_STREAM (out));
index 9df36ac626a5ef31ab7e70b2bbcca4a2b622e886..f878f116859ed5ff00d5aec486a0e07f6a6f4f00 100644 (file)
@@ -72,8 +72,10 @@ test_mutable_tree_walk (void)
     glnx_unref_object OstreeMutableTree *subdir = NULL;
     glnx_unref_object OstreeMutableTree *a = NULL;
     g_autofree char *source_checksum = NULL;
-    ostree_mutable_tree_lookup (tree, "a", &source_checksum, &a, &error);
+    g_assert (ostree_mutable_tree_lookup (tree, "a", &source_checksum, &a, &error));
+    g_assert_no_error (error);
     g_assert (ostree_mutable_tree_walk (a, split_path, 1, &subdir, &error));
+    g_assert_no_error (error);
     g_assert (subdir);
   }
 }