[libgdata] tests: Use correct invalid TLD rather than localhost



commit 7d9cec6bab94a7de67fcaf72987df4349296191a
Author: Philip Withnall <philip tecnocode co uk>
Date:   Wed Aug 3 00:56:10 2016 +0100

    tests: Use correct invalid TLD rather than localhost
    
    RFC 6761 specifies an entire top-level domain which is guaranteed to
    never resolve with a DNS query: invalid. Use that instead of localhost,
    to eliminate the chance that the domain name we thought should never
    resolve, actually resolves.
    
    https://tools.ietf.org/html/rfc6761#section-6.4
    
    This might fix bug #768282.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768282

 gdata/tests/general.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdata/tests/general.c b/gdata/tests/general.c
index 1e30888..070d34c 100644
--- a/gdata/tests/general.c
+++ b/gdata/tests/general.c
@@ -1425,7 +1425,7 @@ test_service_network_error (void)
        service = g_object_new (GDATA_TYPE_SERVICE, NULL);
 
        /* Try a query which should always fail due to errors resolving the hostname */
-       g_assert (gdata_service_query (service, NULL, "http://thisshouldnotexist.localhost";, NULL, 
GDATA_TYPE_ENTRY,
+       g_assert (gdata_service_query (service, NULL, "http://thisshouldnotexist.invalid";, NULL, 
GDATA_TYPE_ENTRY,
                                       NULL, NULL, NULL, &error) == NULL);
        g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_NETWORK_ERROR);
        g_clear_error (&error);
@@ -1434,7 +1434,7 @@ test_service_network_error (void)
         * Filed as bgo#632354. */
 #if 0
        /* Try one with a bad proxy set */
-       proxy_uri = soup_uri_new ("http://thisshouldalsonotexist.localhost/proxy";);
+       proxy_uri = soup_uri_new ("http://thisshouldalsonotexist.invalid/proxy";);
        gdata_service_set_proxy_uri (service, proxy_uri);
        soup_uri_free (proxy_uri);
 


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