From: Michael Tremer Date: Thu, 17 Oct 2019 15:45:06 +0000 (+0000) Subject: test: Add another country for test X-Git-Tag: 0.9.0~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8bbddd9aed73d4cbb3385d4d325a1736939a3669;p=location%2Flibloc.git test: Add another country for test Signed-off-by: Michael Tremer --- diff --git a/src/test-country.c b/src/test-country.c index 99516bb..2f2bd98 100644 --- a/src/test-country.c +++ b/src/test-country.c @@ -67,6 +67,14 @@ int main(int argc, char** argv) { // Free country loc_country_unref(country); + // Add another country + err = loc_writer_add_country(writer, &country, "YY"); + if (err) { + fprintf(stderr, "Could not create country: YY\n"); + exit(EXIT_FAILURE); + } + loc_country_unref(country); + FILE* f = fopen("test.db", "w"); if (!f) { fprintf(stderr, "Could not open file for writing: %s\n", strerror(errno)); @@ -97,9 +105,9 @@ int main(int argc, char** argv) { } // Lookup an address in the subnet - err = loc_database_get_country(db, &country, "XX"); + err = loc_database_get_country(db, &country, "YY"); if (err) { - fprintf(stderr, "Could not find country XX\n"); + fprintf(stderr, "Could not find country: YY\n"); exit(EXIT_FAILURE); } loc_country_unref(country);