![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "testdb.h"#include "caches/image_cache.h"#include "common/conf.h"#include "common/grouping.h"#include "common/image.h"#include "darktable.h"#include <glib/gstdio.h>#include <math.h>#include <stdlib.h>#include "win/main_wrapper.h"
Include dependency graph for test_image_cache_unreadable.c:Go to the source code of this file.
Functions | |
| static int | _setup (void **state __attribute__((unused))) |
| static void | _remove_tree (const gchar *dir) |
| static int | _teardown (void **state) |
| static void | _make_unreadable (const int32_t imgid) |
| static gboolean | _group_is (const int32_t group_id, const int32_t *members, const int count) |
| static void | _group_of_three (const char *folder, int32_t *a, int32_t *b, int32_t *c) |
| static void | test_change_representative_moves_an_unreadable_member (void **state __attribute__((unused))) |
| static void | test_remove_from_group_names_the_group_after_a_readable_member (void **state __attribute__((unused))) |
| static void | test_setters_leave_an_unreadable_image_alone (void **state __attribute__((unused))) |
| static void | test_rename_leaves_an_unreadable_duplicate_behind (void **state __attribute__((unused))) |
| int | main (int argc, char *argv[]) |
Variables | |
| static gchar * | _dir = NULL |
| static gchar * | _library = NULL |
| static gchar * | _rcfile = NULL |
|
static |
Definition at line 127 of file test_image_cache_unreadable.c.
References dt_image_repository_get_group_members(), IS_NULL_PTR, and k.
Referenced by test_change_representative_moves_an_unreadable_member(), test_remove_from_group_names_the_group_after_a_readable_member(), and test_setters_leave_an_unreadable_image_alone().
|
static |
Definition at line 138 of file test_image_cache_unreadable.c.
References _make_unreadable(), dt_image_repository_set_group(), folder, testdb_make_film(), and testdb_make_image().
Referenced by test_change_representative_moves_an_unreadable_member(), and test_remove_from_group_names_the_group_after_a_readable_member().
|
static |
Ask for imgid while another connection holds the library: the read fails, and the cache keeps answering NULL for it once the lock is gone. Call it before anything else of the test reads an image.
Definition at line 113 of file test_image_cache_unreadable.c.
References _library, and dt_image_cache_get().
Referenced by _group_of_three(), test_rename_leaves_an_unreadable_duplicate_behind(), and test_setters_leave_an_unreadable_image_alone().
|
static |
Definition at line 76 of file test_image_cache_unreadable.c.
References _remove_tree(), d, dt_free, IS_NULL_PTR, and name.
Referenced by _remove_tree(), and _teardown().
Definition at line 52 of file test_image_cache_unreadable.c.
References _dir, _library, _rcfile, darktable_t::conf, darktable, dt_conf_init(), dt_conf_set_string(), dt_database_open(), DT_DATABASE_OPEN_OK, dt_image_cache_init(), dt_image_xmp_mode_refresh_from_conf(), FALSE, IS_NULL_PTR, and params.
Referenced by main().
|
static |
Definition at line 96 of file test_image_cache_unreadable.c.
References _dir, _library, _rcfile, _remove_tree(), darktable_t::conf, darktable, dt_conf_cleanup(), dt_free, dt_image_cache_cleanup(), state, and testdb_teardown().
Referenced by main().
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 250 of file test_image_cache_unreadable.c.
References _setup(), _teardown(), test_change_representative_moves_an_unreadable_member(), test_remove_from_group_names_the_group_after_a_readable_member(), test_rename_leaves_an_unreadable_duplicate_behind(), and test_setters_leave_an_unreadable_image_alone().
|
static |
Definition at line 154 of file test_image_cache_unreadable.c.
References _group_is(), _group_of_three(), and dt_grouping_change_representative().
Referenced by main().
|
static |
Definition at line 173 of file test_image_cache_unreadable.c.
References _group_is(), _group_of_three(), and dt_grouping_remove_from_group().
Referenced by main().
|
static |
Definition at line 218 of file test_image_cache_unreadable.c.
References _dir, _make_unreadable(), dt_free, dt_image_move(), dt_image_repository_duplicate(), dt_image_repository_find_by_film_and_filename(), dt_image_repository_set_group(), testdb_make_film(), and testdb_make_image().
Referenced by main().
|
static |
Definition at line 187 of file test_image_cache_unreadable.c.
References _group_is(), _make_unreadable(), dt_grouping_add_to_group(), dt_image_get_location(), DT_IMAGE_MONOCHROME_PREVIEW, dt_image_repository_get_ids_with_flag_among(), dt_image_repository_set_group(), dt_image_set_datetime(), dt_image_set_location(), dt_image_set_monochrome_flag(), dt_image_geoloc_t::elevation, FALSE, dt_image_geoloc_t::latitude, dt_image_geoloc_t::longitude, testdb_make_film(), testdb_make_image(), and TRUE.
Referenced by main().
|
static |
What the callers of dt_image_cache_get() do with an image they cannot read.
The cache answers NULL for an image whose first database read failed, for as long as the entry stays cached, although the row is there and other queries list it: group members, duplicates. That is the state these tests put one image in, the way another program does – a second connection holds the library's EXCLUSIVE lock while the image is asked for. Each caller below dereferenced that NULL.
Definition at line 44 of file test_image_cache_unreadable.c.
Referenced by _setup(), _teardown(), and test_rename_leaves_an_unreadable_duplicate_behind().
|
static |
Definition at line 45 of file test_image_cache_unreadable.c.
Referenced by _make_unreadable(), _setup(), and _teardown().
|
static |
Definition at line 46 of file test_image_cache_unreadable.c.
Referenced by _setup(), and _teardown().