"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "t/ipv4_start_cache_t.c" between
libmaxminddb-1.5.0.tar.gz and libmaxminddb-1.5.2.tar.gz

About: libmaxminddb is a library that provides functions for working with MaxMind DB files (free GeoLite 2 or commercial GeoIP2).

ipv4_start_cache_t.c  (libmaxminddb-1.5.0):ipv4_start_cache_t.c  (libmaxminddb-1.5.2)
#include "maxminddb_test_helper.h" #include "maxminddb_test_helper.h"
void test_one_ip(MMDB_s *mmdb, const char *ip, const char *filename, void test_one_ip(MMDB_s *mmdb,
const char *mode_desc) const char *ip,
{ const char *filename,
const char *mode_desc) {
MMDB_lookup_result_s result = MMDB_lookup_result_s result =
lookup_string_ok(mmdb, ip, filename, mode_desc); lookup_string_ok(mmdb, ip, filename, mode_desc);
ok( ok(result.found_entry,
result.found_entry, "got a result for an IPv4 address included in a larger-than-IPv4 subnet "
"got a result for an IPv4 address included in a larger-than-IPv4 subnet "- %s - %s",
- %s - %s", ip,
ip, mode_desc); mode_desc);
data_ok(&result, MMDB_DATA_TYPE_UTF8_STRING, "string value for IP", NULL); data_ok(&result, MMDB_DATA_TYPE_UTF8_STRING, "string value for IP", NULL);
} }
void run_tests(int mode, const char *mode_desc) void run_tests(int mode, const char *mode_desc) {
{
const char *filename = "MaxMind-DB-no-ipv4-search-tree.mmdb"; const char *filename = "MaxMind-DB-no-ipv4-search-tree.mmdb";
const char *path = test_database_path(filename); const char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc); MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path); free((void *)path);
test_one_ip(mmdb, "1.1.1.1", filename, mode_desc); test_one_ip(mmdb, "1.1.1.1", filename, mode_desc);
test_one_ip(mmdb, "255.255.255.255", filename, mode_desc); test_one_ip(mmdb, "255.255.255.255", filename, mode_desc);
MMDB_close(mmdb); MMDB_close(mmdb);
free(mmdb); free(mmdb);
} }
int main(void) int main(void) {
{
plan(NO_PLAN); plan(NO_PLAN);
for_all_modes(&run_tests); for_all_modes(&run_tests);
done_testing(); done_testing();
} }
 End of changes. 4 change blocks. 
12 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)