[libosinfo PATCH] tests: get the curl response code every time

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

 



This failed on FreeBSD with following error:

../../tests/test-mediauris.c:47:13: error: variable 'response_code' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 tests/test-mediauris.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/test-mediauris.c b/tests/test-mediauris.c
index 5ac2c8e..a079f46 100644
--- a/tests/test-mediauris.c
+++ b/tests/test-mediauris.c
@@ -44,9 +44,7 @@ static void test_media(OsinfoMediaList *medialist, GError **error, CURL *curl)
         g_test_message("%s", url);
         curl_easy_setopt(curl, CURLOPT_URL, url);
         res = curl_easy_perform(curl);
-        if (res != CURLE_OK) {
-            curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
-        }
+        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
 
         g_test_message("res=%d, %s; code=%ld", res, curl_easy_strerror(res), response_code);
         g_assert_cmpint(res, ==, CURLE_OK);
-- 
2.13.6

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux