Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
test_preset_repository.c File Reference
#include "testdb.h"
#include "win/main_wrapper.h"
Include dependency graph for test_preset_repository.c:

Go to the source code of this file.

Functions

static void test_set_module_version_leaves_params_alone (void **state)
static void test_list_for_upgrade_returns_all_versions (void **state)
static void test_list_editable_excludes_shipped (void **state)
static void test_list_all_carries_the_tree_row (void **state)
int main (int argc, char *argv[])

Variables

static const unsigned char params_a [] = { 0x01, 0x02, 0x03, 0x04, 0x05 }
static const unsigned char params_b [] = { 0x0a, 0x0b, 0x0c }

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )
Todo
: test if file with replaced ext exists
Todo
: add a callback to set the bpp without going through the config
Todo
: have a parameter in command line to get the export presets

Definition at line 142 of file test_preset_repository.c.

References test_list_all_carries_the_tree_row(), test_list_editable_excludes_shipped(), test_list_for_upgrade_returns_all_versions(), test_set_module_version_leaves_params_alone(), testdb_setup(), and testdb_teardown().

◆ test_list_all_carries_the_tree_row()

◆ test_list_editable_excludes_shipped()

◆ test_list_for_upgrade_returns_all_versions()

void test_list_for_upgrade_returns_all_versions ( void ** state)
static

◆ test_set_module_version_leaves_params_alone()

Variable Documentation

◆ params_a

const unsigned char params_a[] = { 0x01, 0x02, 0x03, 0x04, 0x05 }
static

Contracts of database/preset_repository.h.

The central one is the data-loss trap the migration had to step around: data.presets is UNIQUE on (name, operation, op_version), so an (operation, name) predicate is legitimately multi-row, and the version-only setter must not touch op_params – a setter that wrote both would stamp one preset's blob onto every other version of the same name. dt_preset_repository_set_module_version() exists precisely so dt_preset_repository_update_module_params() is never used for that.

Definition at line 36 of file test_preset_repository.c.

◆ params_b

const unsigned char params_b[] = { 0x0a, 0x0b, 0x0c }
static

Definition at line 37 of file test_preset_repository.c.