![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "develop/develop.h"#include "develop/dev_history.h"#include "develop/pixelpipe_hb.h"#include "system/atomic.h"#include "system/dtpthread.h"#include <glib.h>#include <stdarg.h>#include <stddef.h>#include <stdlib.h>#include <setjmp.h>#include <stdint.h>#include <cmocka.h>
Include dependency graph for test_history_snapshot.c:Go to the source code of this file.
Data Structures | |
| struct | _fixture_t |
Typedefs | |
| typedef struct _fixture_t | _fixture_t |
Functions | |
| static int | _setup (void **state) |
| static int | _teardown (void **state) |
| static int | _refs (const dt_dev_history_item_t *item) |
| static dt_dev_history_item_t * | _append (dt_develop_t *dev, const uint64_t hash) |
| static void | _a_snapshot_references_every_item_and_releases_them (void **state) |
| static void | _history_end_is_clamped_to_the_list_at_snapshot_time (void **state) |
| static void | _cow_touch_leaves_an_exclusively_owned_item_alone (void **state) |
| static void | _cow_touch_clones_an_item_a_snapshot_is_holding (void **state) |
| static void | _cow_touch_repoints_the_pipe_marker_and_balances_every_reference (void **state) |
| static void | _cow_touch_ignores_a_marker_naming_a_different_item (void **state) |
| static void | _transient_params_serial_advances_with_every_publication (void **state) |
| A transient publication must be distinguishable from the one before it. | |
| int | main (void) |
Definition at line 98 of file test_history_snapshot.c.
References _append(), _refs(), dt_dev_history_snapshot_release(), dt_dev_history_snapshot_take(), dt_dev_set_history_hash(), dt_pthread_rwlock_rdlock(), dt_pthread_rwlock_unlock(), f, dt_dev_history_snapshot_t::history_end, dt_dev_history_snapshot_t::history_hash, dt_dev_history_snapshot_t::items, L, and state.
Referenced by main().
|
static |
Definition at line 88 of file test_history_snapshot.c.
References dt_dev_history_item_create(), dt_dev_history_item_t::hash, hash, dt_develop_t::history, L, and dt_dev_history_item_t::num.
Referenced by _a_snapshot_references_every_item_and_releases_them(), _cow_touch_clones_an_item_a_snapshot_is_holding(), _cow_touch_ignores_a_marker_naming_a_different_item(), _cow_touch_leaves_an_exclusively_owned_item_alone(), _cow_touch_repoints_the_pipe_marker_and_balances_every_reference(), and _history_end_is_clamped_to_the_list_at_snapshot_time().
Definition at line 162 of file test_history_snapshot.c.
References _append(), _refs(), dt_dev_history_cow_touch(), dt_dev_history_snapshot_release(), dt_dev_history_snapshot_take(), dt_pthread_rwlock_rdlock(), dt_pthread_rwlock_unlock(), f, FALSE, dt_dev_history_snapshot_t::items, L, state, and TRUE.
Referenced by main().
Definition at line 233 of file test_history_snapshot.c.
References _append(), _refs(), dt_atomic_get_ptr(), dt_atomic_set_ptr(), dt_dev_history_cow_touch(), dt_dev_history_item_ref(), dt_dev_history_snapshot_release(), dt_dev_history_snapshot_take(), dt_pthread_rwlock_rdlock(), dt_pthread_rwlock_unlock(), f, L, and state.
Referenced by main().
Definition at line 148 of file test_history_snapshot.c.
References _append(), _refs(), dt_dev_history_cow_touch(), f, L, and state.
Referenced by main().
|
static |
Definition at line 198 of file test_history_snapshot.c.
References _append(), _refs(), dt_atomic_exch_ptr(), dt_atomic_get_ptr(), dt_atomic_set_ptr(), dt_dev_free_history_item(), dt_dev_history_cow_touch(), dt_dev_history_item_ref(), dt_dev_history_snapshot_release(), dt_dev_history_snapshot_take(), dt_pthread_rwlock_rdlock(), dt_pthread_rwlock_unlock(), f, L, and state.
Referenced by main().
Definition at line 132 of file test_history_snapshot.c.
References _append(), dt_dev_history_snapshot_release(), dt_dev_history_snapshot_take(), dt_pthread_rwlock_rdlock(), dt_pthread_rwlock_unlock(), f, dt_dev_history_snapshot_t::history_end, L, and state.
Referenced by main().
|
static |
Definition at line 83 of file test_history_snapshot.c.
References dt_atomic_get_int().
Referenced by _a_snapshot_references_every_item_and_releases_them(), _cow_touch_clones_an_item_a_snapshot_is_holding(), _cow_touch_ignores_a_marker_naming_a_different_item(), _cow_touch_leaves_an_exclusively_owned_item_alone(), and _cow_touch_repoints_the_pipe_marker_and_balances_every_reference().
Definition at line 55 of file test_history_snapshot.c.
References dt_pthread_mutex_init(), dt_pthread_rwlock_init(), f, L, and state.
Referenced by main().
Definition at line 67 of file test_history_snapshot.c.
References dt_atomic_exch_ptr(), dt_dev_free_history_item(), dt_free, dt_pthread_mutex_destroy(), dt_pthread_rwlock_destroy(), f, L, and state.
Referenced by main().
A transient publication must be distinguishable from the one before it.
This pins the invariant a realtime module's whole feedback loop rests on, and it is pinned here because nothing else can see it. dt_iop_commit_params() hands the params it is given to module->commit_params() but derives the piece's cache identity from dt_iop_compute_module_hash(), which hashes module->params instead – so a transient edit changes the pixels a recompute would produce WITHOUT changing the hash that decides whether to recompute at all. _sync_focused_in_place() closes that by folding this serial into piece->hash, which only works if the serial actually advances per publication and arrives with the blob it describes.
When this broke, a drawn stroke appeared only after the brush was lifted, every unit test passed, three build configurations were clean, and the log said nothing: the pipe reported success 122 times while exact-hitting the cache. The cost of not having this test was a user-visible regression that only a drawing session could catch.
Definition at line 277 of file test_history_snapshot.c.
References dt_iop_module_t::dev, dt_dev_transient_params_get(), dt_dev_transient_params_set(), f, L, out, params, and state.
Referenced by main().
| int main | ( | void | ) |
Definition at line 316 of file test_history_snapshot.c.
References _a_snapshot_references_every_item_and_releases_them(), _cow_touch_clones_an_item_a_snapshot_is_holding(), _cow_touch_ignores_a_marker_naming_a_different_item(), _cow_touch_leaves_an_exclusively_owned_item_alone(), _cow_touch_repoints_the_pipe_marker_and_balances_every_reference(), _history_end_is_clamped_to_the_list_at_snapshot_time(), _setup(), _teardown(), _transient_params_serial_advances_with_every_publication(), and L.