]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: test-file-cache - Add asserts for initial return value of file_cache_get
authorAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 28 Oct 2020 10:45:09 +0000 (12:45 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 28 Oct 2020 10:45:09 +0000 (12:45 +0200)
src/lib/test-file-cache.c

index aa25a9cc6163ea9eb10811818b120eca2f36e557..e686af1bba62dbc8d2359342d1f267ba31067cf8 100644 (file)
@@ -32,6 +32,7 @@ static void test_file_cache_read(void)
        size_t size;
        const char *map = file_cache_get_map(cache, &size);
        test_assert(size == 0);
+       test_assert(map == NULL);
 
        test_assert(file_cache_read(cache, 0, 13) == 13);
        map = file_cache_get_map(cache, &size);
@@ -63,6 +64,7 @@ static void test_file_cache_write_read(void)
        size_t size;
        const char *map = file_cache_get_map(cache, &size);
        test_assert(size == 0);
+       test_assert(map == NULL);
        test_assert(file_cache_read(cache, 0, 13) == 13);
        file_cache_write(cache, "updated data\n", 13, 0);
        map = file_cache_get_map(cache, &size);