![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Shared fixture for the src/database repository tests. More...
#include <stdarg.h>#include <stddef.h>#include <setjmp.h>#include <stdint.h>#include <cmocka.h>#include "database/collection_query.h"#include "database/colorlabel_repository.h"#include "database/database.h"#include "database/film_repository.h"#include "database/history_repository.h"#include "database/image_repository.h"#include "database/metadata_repository.h"#include "database/preset_repository.h"#include "database/selection_repository.h"#include "database/style_repository.h"#include "database/tag_repository.h"
Include dependency graph for testdb.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| static int | testdb_setup (void **state) |
| static int | testdb_teardown (void **state) |
| static int32_t | testdb_make_film (const char *folder) |
| static int32_t | testdb_make_image (const int32_t film_id, const char *filename) |
Shared fixture for the src/database repository tests.
Opens the one connection on ":memory:" (dt_database_open() then puts data and memory on ":memory:" too, and skips the lock files), and closes it again after finalising every repository's cached statements – the same discipline the application follows at shutdown, and the reason dt_database_close() can be called at all.
Everything a test writes goes through the repository APIs. That is not a convenience: tools/check_module_boundaries.sh holds the module's raw-connection accessor at ZERO call sites outside src/database, and these tests live outside src/database. A test that cannot set up its rows through the public API has found a hole in the API.
Definition in file testdb.h.
A film roll to hang images on, created through the API and returned by id.
Definition at line 85 of file testdb.h.
References dt_film_repository_find_by_folder(), and dt_film_repository_insert().
Referenced by test_count_distinct_fields(), test_find_version_for_params(), test_flag_among_multi_image(), test_foreach_active_module(), test_full_paths(), test_group_member_rows(), test_history_item_cycle(), test_id_range(), test_metadata_foreach_selected(), test_module_order_absent_vs_zero(), test_selection_lowest_id(), test_tag_agreement(), and test_write_timestamp_is_64bit().
One imported image row, by id. Everything but the identity is at its default.
Definition at line 92 of file testdb.h.
References dt_image_repository_find_by_film_and_filename(), and dt_image_repository_insert_import().
Referenced by test_count_distinct_fields(), test_find_version_for_params(), test_flag_among_multi_image(), test_foreach_active_module(), test_full_paths(), test_group_member_rows(), test_history_item_cycle(), test_id_range(), test_metadata_foreach_selected(), test_module_order_absent_vs_zero(), test_selection_lowest_id(), test_tag_agreement(), and test_write_timestamp_is_64bit().
Definition at line 55 of file testdb.h.
References dt_database_open(), DT_DATABASE_OPEN_OK, FALSE, L, state, and void().
Referenced by main().
Definition at line 66 of file testdb.h.
References dt_collection_query_cleanup(), dt_colorlabel_repository_cleanup(), dt_database_close(), dt_history_repository_cleanup(), dt_image_repository_cleanup(), dt_metadata_repository_cleanup(), dt_preset_repository_cleanup(), dt_selection_repository_cleanup(), dt_style_repository_cleanup(), dt_tag_repository_cleanup(), state, and void().
Referenced by main().