48#include <glib/gstdio.h>
59#define TEST_KEY "plugins/test/conf_value_lifetime"
68 _rcfile = g_build_filename(g_get_tmp_dir(),
"ansel_test_conf_lifetime.rc", NULL);
94 assert_string_equal(borrowed,
"first");
101 assert_string_equal(borrowed,
"first");
113 for(
int i = 0;
i < 8;
i++)
115 char *
value = g_strdup_printf(
"value-%d",
i);
122 for(
int i = 0;
i < 8;
i++)
124 char *expected = g_strdup_printf(
"value-%d",
i);
125 assert_string_equal(held[
i], expected);
145 assert_string_equal(before,
"unchanged");
154 assert_string_equal(borrowed,
"11");
158 assert_string_equal(borrowed,
"11");
164 const struct CMUnitTest tests[] = {
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
void dt_conf_cleanup(dt_conf_t *cf)
Free everything cf owns. No dt_conf_*() call is valid afterwards.
void dt_conf_init(dt_conf_t *cf, const char *filename, GSList *override_entries)
Populate cf from filename and from the generated defaults.
int dt_conf_get_int_fast(const char *name)
Stored integer for name, NOT clamped to its declared bounds.
void dt_conf_set_int(const char *name, int val)
void dt_conf_set_string(const char *name, const char *val)
const char * dt_conf_get_string_const(const char *name)
Borrow the stored string for name without copying it.
static const dt_aligned_pixel_simd_t value
const float uint32_t state[4]
The whole configuration state. One instance lives at darktable.conf.
static int _setup(void **state)
static int _teardown(void **state)
static void _borrowed_value_survives_being_replaced(void **state)
static void _every_displaced_value_stays_readable(void **state)
static void _typed_setters_retire_too(void **state)
static void _rewriting_the_same_value_retires_nothing(void **state)