![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "testdb.h"#include "common/image.h"#include "system/mem_alloc.h"#include <glib/gstdio.h>#include <sqlite3.h>#include "win/main_wrapper.h"Go to the source code of this file.
Macros | |
| #define | TEST_FLAG 2048 |
Functions | |
| static void | test_flag_among_multi_image (void **state) |
| static void | test_set_flags_masked_leaves_other_bits (void **state) |
| static void | test_full_paths (void **state) |
| static void | test_id_range (void **state) |
| static void | test_write_timestamp_is_64bit (void **state) |
| static void | test_group_member_rows (void **state) |
| static void | test_count_distinct_fields (void **state) |
| static gboolean | _count_two_rows (const int32_t imgid, const int64_t write_timestamp, const int version, const char *image_path, const int flags, void *user_data) |
| static void | test_foreach_with_path_stops_when_asked (void **state) |
| static void | test_load_marks_an_absent_image_invalid (void **state __attribute__((unused))) |
| static int | _file_setup (void **state __attribute__((unused))) |
| static int | _file_teardown (void **state) |
| static void | test_load_failure_leaves_the_image_untouched (void **state __attribute__((unused))) |
| int | main (int argc, char *argv[]) |
Variables | |
| static gchar * | _dir = NULL |
| static gchar * | _library = NULL |
| #define TEST_FLAG 2048 |
Contracts of database/image_repository.h that the migration promised to keep.
The first test is a regression test for a real bug: the callers this repository absorbed used to bind a comma-joined id string to a single IN (?) parameter, which SQLite reads as ONE value – it matched a lone id and matched NOTHING for two or more. The repository builds the set into the statement as integers; these tests hold it there.
Definition at line 40 of file test_image_repository.c.
Referenced by test_flag_among_multi_image(), and test_set_flags_masked_leaves_other_bits().
|
static |
Definition at line 221 of file test_image_repository.c.
Referenced by test_foreach_with_path_stops_when_asked().
Definition at line 275 of file test_image_repository.c.
References _dir, _library, dt_database_open(), DT_DATABASE_OPEN_OK, FALSE, IS_NULL_PTR, params, and state.
Referenced by main().
|
static |
Definition at line 288 of file test_image_repository.c.
References _dir, _library, d, dt_free, IS_NULL_PTR, name, state, and testdb_teardown().
Referenced by main().
| int main | ( | int | argc, |
| char * | argv[] ) |
Definition at line 342 of file test_image_repository.c.
References _file_setup(), _file_teardown(), test_count_distinct_fields(), test_flag_among_multi_image(), test_foreach_with_path_stops_when_asked(), test_full_paths(), test_group_member_rows(), test_id_range(), test_load_failure_leaves_the_image_untouched(), test_load_marks_an_absent_image_invalid(), test_set_flags_masked_leaves_other_bits(), test_write_timestamp_is_64bit(), testdb_setup(), and testdb_teardown().
Definition at line 197 of file test_image_repository.c.
References DT_IMAGE_FIELD_FILENAME, DT_IMAGE_FIELD_FILM_ROLL, DT_IMAGE_FIELD_IMGID, DT_IMAGE_FIELD_VERSION, dt_image_repository_count_distinct_fields(), state, testdb_make_film(), testdb_make_image(), and void().
Referenced by main().
Definition at line 42 of file test_image_repository.c.
References dt_image_repository_get_ids_with_flag_among(), dt_image_repository_set_flag_among(), state, TEST_FLAG, testdb_make_film(), testdb_make_image(), and void().
Referenced by main().
Definition at line 237 of file test_image_repository.c.
References _count_two_rows(), dt_image_repository_foreach_with_path(), state, testdb_make_film(), testdb_make_image(), and void().
Referenced by main().
Definition at line 126 of file test_image_repository.c.
References dt_free, dt_image_repository_get_full_paths(), g_free(), state, testdb_make_film(), testdb_make_image(), and void().
Referenced by main().
Definition at line 176 of file test_image_repository.c.
References dt_image_group_member_free(), dt_image_repository_get_group_member_rows(), dt_image_repository_set_group(), dt_image_group_member_t::filename, dt_image_group_member_t::imgid, state, testdb_make_film(), testdb_make_image(), and void().
Referenced by main().
Definition at line 148 of file test_image_repository.c.
References dt_image_repository_count_in_id_range(), state, testdb_make_film(), testdb_make_image(), and void().
Referenced by main().
Definition at line 316 of file test_image_repository.c.
References _library, dt_image_init(), dt_image_repository_load(), dt_image_t::id, state, testdb_make_film(), testdb_make_image(), and dt_image_t::width.
Referenced by main().
Definition at line 255 of file test_image_repository.c.
References dt_image_init(), dt_image_repository_load(), dt_image_t::id, state, testdb_make_film(), testdb_make_image(), and UNKNOWN_IMAGE.
Referenced by main().
Definition at line 85 of file test_image_repository.c.
References dt_image_repository_get_ids_with_flag_among(), dt_image_repository_set_flag_among(), dt_image_repository_set_flags_masked(), state, TEST_FLAG, testdb_make_film(), testdb_make_image(), and void().
Referenced by main().
Definition at line 162 of file test_image_repository.c.
References dt_image_repository_get_write_timestamp(), dt_image_repository_set_write_timestamp(), state, testdb_make_film(), testdb_make_image(), and void().
Referenced by main().
|
static |
Definition at line 272 of file test_image_repository.c.
|
static |
Definition at line 273 of file test_image_repository.c.