]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/test-stringpool.c
Add a dictionary with countries to the database
[people/ms/libloc.git] / src / test-stringpool.c
index 1b219f38a99a002aa176a5cdfaa84dfe574b2d44..85bbf68f07b0a897d1cabdc46a31652a3f641dd7 100644 (file)
@@ -25,7 +25,7 @@
 #include <time.h>
 
 #include <loc/libloc.h>
-#include "stringpool.h"
+#include <loc/stringpool.h>
 
 static const char* characters = "012345789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
 
@@ -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) {