]> git.ipfire.org Git - location/libloc.git/blobdiff - src/test-stringpool.c
Add a dictionary with countries to the database
[location/libloc.git] / src / test-stringpool.c
index 11653fea6232b31b0fa9c2a9398a854d6778a546..85bbf68f07b0a897d1cabdc46a31652a3f641dd7 100644 (file)
@@ -59,6 +59,13 @@ int main(int argc, char** argv) {
        if (err < 0)
                exit(EXIT_FAILURE);
 
+       // Try reading some invalid string
+       const char* s = loc_stringpool_get(pool, 100);
+       if (s != NULL) {
+               fprintf(stderr, "An unexpected string was returned: %s\n", s);
+               exit(EXIT_FAILURE);
+       }
+
        // Append a string
        off_t pos = loc_stringpool_add(pool, "ABC");
        if (pos < 0) {