"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "t/metadata_pointers_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).

metadata_pointers_t.c  (libmaxminddb-1.5.0):metadata_pointers_t.c  (libmaxminddb-1.5.2)
#include "maxminddb_test_helper.h" #include "maxminddb_test_helper.h"
void run_tests(int mode, const char *mode_desc) void run_tests(int mode, const char *mode_desc) {
const char *filename = "MaxMind-DB-test-metadata-pointers.mmdb"; const char *filename = "MaxMind-DB-test-metadata-pointers.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);
char *repeated_string = "Lots of pointers in metadata"; char *repeated_string = "Lots of pointers in metadata";
is(mmdb->metadata.database_type, repeated_string, is(mmdb->metadata.database_type,
"decoded pointer database_type"); "decoded pointer database_type");
for (uint16_t i = 0; i < mmdb->metadata.description.count; i++) { for (uint16_t i = 0; i < mmdb->metadata.description.count; i++) {
const char *language = const char *language =
mmdb->metadata.description.descriptions[i]->language; mmdb->metadata.description.descriptions[i]->language;
const char *description = const char *description =
mmdb->metadata.description.descriptions[i]->description; mmdb->metadata.description.descriptions[i]->description;
is(description, repeated_string, "%s description", language); is(description, repeated_string, "%s description", language);
} }
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. 3 change blocks. 
5 lines changed or deleted 4 lines changed or added

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