40 assert_true(a > 0 && b > a && c > b);
55 assert_int_equal(g_list_length(all), 3);
56 assert_int_equal(GPOINTER_TO_INT(all->data), a);
57 assert_int_equal(GPOINTER_TO_INT(all->next->data), b);
58 assert_int_equal(GPOINTER_TO_INT(all->next->next->data), c);
72 assert_true(a > 0 && b > 0);
73 GList *both = g_list_append(g_list_append(NULL, GINT_TO_POINTER(a)), GINT_TO_POINTER(b));
78 assert_true(shared > 0 && only_a > 0 && category > 0);
88 gboolean same_tags =
FALSE, same_categories =
FALSE;
90 assert_false(same_tags);
91 assert_true(same_categories);
96 assert_true(same_tags);
97 assert_true(same_categories);
103 assert_true(same_tags);
104 assert_true(same_categories);
108 assert_true(same_tags);
109 assert_true(same_categories);
125 if(keyid == 0 && !g_strcmp0(
value,
"same-creator")) c->shared_key_count = (int)count;
126 if(keyid == 2) c->split_key_rows++;
135 assert_true(a > 0 && b > 0);
138 { .imgid = a, .keyid = 0, .value =
"same-creator" },
139 { .imgid = b, .keyid = 0, .value =
"same-creator" },
140 { .imgid = a, .keyid = 2, .value =
"title-a" },
141 { .imgid = b, .keyid = 2, .value =
"title-b" },
151 assert_int_equal(c.rows, 3);
152 assert_int_equal(c.shared_key_count, 2);
153 assert_int_equal(c.split_key_rows, 2);
158int main(
int argc,
char *argv[])
160 const struct CMUnitTest tests[] = {
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
void dt_selection_repository_select(const int32_t imgid)
Add imgid to the selection. Selecting an already-selected image does nothing.
void dt_selection_repository_clear(void)
Empty the selection.
void dt_selection_repository_deselect(const int32_t imgid)
Remove imgid from the selection.
GList * dt_selection_repository_get_all(void)
Every selected image id, GINT_TO_POINTER, ASCENDING. Free with g_list_free().
int32_t dt_selection_repository_get_lowest_id(void)
The lowest selected image id, or UNKNOWN_IMAGE when nothing is selected.
const float uint32_t state[4]
gboolean dt_tag_repository_attach(const guint tagid, const int32_t imgid)
Attach tagid to imgid, at the end of the tag order.
void dt_tag_repository_get_agreement(GList *imgids, gboolean *same_tags, gboolean *same_categories)
Do all of imgids carry exactly the same tags? The same categories?
void dt_tag_repository_set_flags(const guint tagid, const gint flags)
Replace the flags word of tagid.
guint dt_tag_repository_insert(const char *name)
Insert a tag named name and return its new id, or 0 on failure.
Shared fixture for the src/database repository tests.
static int testdb_setup(void **state)
static int32_t testdb_make_film(const char *folder)
static int testdb_teardown(void **state)
static int32_t testdb_make_image(const int32_t film_id, const char *filename)