Skip to content

Commit

Permalink
Add persistence test for arrays of strings
Browse files Browse the repository at this point in the history
After exposing nasty macro bug this just works!
  • Loading branch information
Araneidae committed Jul 1, 2024
1 parent 18f0a1a commit 19fe03d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/example_ioc/Db/example_ioc.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@

longOut('ADD_ONE', DESC = 'Adds one to the written value')

WaveformOut('STRINGS', 4, 'STRING')

WriteRecords(sys.argv[1])
8 changes: 8 additions & 0 deletions examples/example_ioc/src/example_pvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ static double scaling = 0.1;
static int trigger_count = 0;
static int trigger_waveform[WF_LENGTH];

static EPICS_STRING strings[4] = {
{ "1" }, { "2" }, { "3" }, { "4" }
};
static unsigned int strings_len = 4;


static void update_waveform(void)
{
Expand Down Expand Up @@ -149,6 +154,9 @@ error__t initialise_example_pvs(void)

PUBLISH(longout, "ADD_ONE", add_one);

PUBLISH_WF_WRITE_VAR_LEN_P(
EPICS_STRING, "STRINGS", 4, strings_len, strings);

pthread_t thread_id;
return TEST_PTHREAD(pthread_create(&thread_id, NULL, event_thread, NULL));
}

0 comments on commit 19fe03d

Please sign in to comment.