From: Michael Tremer Date: Wed, 31 Jan 2018 00:31:41 +0000 (+0000) Subject: test: Fix network test for non-existant address X-Git-Tag: 0.9.0~81 X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Flibloc.git;a=commitdiff_plain;h=e477e813fb9a1d4046c0cc4e3ad295f34a686092 test: Fix network test for non-existant address Signed-off-by: Michael Tremer --- diff --git a/src/test-network.c b/src/test-network.c index b7b5120..a9f2f63 100644 --- a/src/test-network.c +++ b/src/test-network.c @@ -155,18 +155,18 @@ int main(int argc, char** argv) { exit(EXIT_FAILURE); } - // Lookup an exact match + // Lookup an address in the subnet err = loc_database_lookup_from_string(db, "2001:db8::", &network1); if (err) { - fprintf(stderr, "Could not look up the given IP address\n"); + fprintf(stderr, "Could not look up 2001:db8::\n"); exit(EXIT_FAILURE); } loc_network_unref(network1); - // Lookup a non-exact match + // Lookup an address outside the subnet err = loc_database_lookup_from_string(db, "2001:db8:fffe:1::", &network1); - if (err) { - fprintf(stderr, "Could not look up the given IP address\n"); + if (err == 0) { + fprintf(stderr, "Could look up 2001:db8:fffe:1::, but I shouldn't\n"); exit(EXIT_FAILURE); } loc_network_unref(network1);