Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
test_metadata_notify.c File Reference
#include "metadata/notify.h"
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <stdint.h>
#include <cmocka.h>
#include <string.h>
#include <glib.h>
#include "win/main_wrapper.h"
Include dependency graph for test_metadata_notify.c:

Go to the source code of this file.

Data Structures

struct  _seen_t

Typedefs

typedef struct _seen_t _seen_t

Functions

static void _record (const dt_metadata_notice_t kind, const char *message)
static void _record_tag_change (void)
static int _setup (void **state)
static int _teardown (void **state)
static void test_no_handler_is_silent (void **state)
static void test_kinds_stay_distinct (void **state)
static void test_handler_can_be_removed (void **state)
static void test_tags_changed_fires_each_time (void **state)
static void test_channels_are_independent (void **state)
int main (int argc, char *argv[])

Variables

static _seen_t _seen

Typedef Documentation

◆ _seen_t

typedef struct _seen_t _seen_t

The inversion that makes src/metadata a closed module: it states what happened, and whoever is running it decides what that looks like.

These tests exist because the no-handler case is the one nothing else exercises – every interactive run installs a handler in dt_init(), so a crash or a swallowed message there would only ever show up under ansel-cli or in a test binary. Which is to say: here.

Function Documentation

◆ _record()

void _record ( const dt_metadata_notice_t kind,
const char * message )
static

◆ _record_tag_change()

void _record_tag_change ( void )
static

Definition at line 67 of file test_metadata_notify.c.

References _seen.

Referenced by test_channels_are_independent(), and test_tags_changed_fires_each_time().

◆ _setup()

int _setup ( void ** state)
static

Definition at line 72 of file test_metadata_notify.c.

References _seen, state, and void().

◆ _teardown()

int _teardown ( void ** state)
static

◆ 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 172 of file test_metadata_notify.c.

References _setup(), _teardown(), test_channels_are_independent(), test_handler_can_be_removed(), test_kinds_stay_distinct(), test_no_handler_is_silent(), and test_tags_changed_fires_each_time().

◆ test_channels_are_independent()

◆ test_handler_can_be_removed()

void test_handler_can_be_removed ( void ** state)
static

◆ test_kinds_stay_distinct()

void test_kinds_stay_distinct ( void ** state)
static

◆ test_no_handler_is_silent()

◆ test_tags_changed_fires_each_time()

void test_tags_changed_fires_each_time ( void ** state)
static

Variable Documentation

◆ _seen