* 3.15: (28 commits) update RELEASE_NOTES add option EPICS_NO_CALLBACK replace CALLBACK -> epicsCallback Update dbTest.c Remove links to wiki-ext Add POD annotations from Wiki to subArrayRecord and menuAlarmStat Rename subArrayRecord.dbd and menuAlarmStat.dbd to .pod Add POD annotations to longoutRecord from Wiki Rename longoutRecord.dbd longoutRecord.dbd.pod Add POD annotations to longinRecord from Wiki Rename longinRecord.dbd longinRecord.dbd.pod Add POD annotations to subRecord from Wiki Rename subRecord.dbd subRecord.dbd.pod Add POD annotations to selRecord from Wiki Rename selRecord.dbd selRecord.dbd.pod Add POD annotations to seqRecord from Wiki Rename seqRecord.dbd seqRecord.dbd.pod Fix menu declaration test too Add redefinition guard to menu-generated typedefs Updates to existing .dbd.pod texts, add event and fanout from wiki ... # Conflicts: # documentation/README.1st # documentation/README.html # modules/database/src/ioc/db/callback.h # modules/database/src/ioc/db/dbNotify.c # modules/database/src/ioc/db/menuAlarmStat.dbd # modules/database/src/ioc/db/menuFtype.dbd # modules/database/src/std/rec/compressRecord.dbd.pod # modules/database/src/std/rec/eventRecord.dbd # modules/database/src/std/rec/fanoutRecord.dbd # modules/database/src/std/rec/longinRecord.dbd # modules/database/src/std/rec/longoutRecord.dbd # modules/database/src/std/rec/selRecord.dbd # modules/database/src/std/rec/seqRecord.dbd # modules/database/src/std/rec/subArrayRecord.dbd # modules/database/src/std/rec/subRecord.dbd # modules/libcom/src/iocsh/menuAlarmStat.dbd.pod # modules/libcom/src/iocsh/menuFtype.dbd.pod # src/ioc/db/menuAlarmStat.dbd # src/ioc/db/menuFtype.dbd Manually fix some move+rename Make additional CALLBACK -> epicsCallback preserve INT64 in menuFtype preserve OLDSIM et al
35 lines
1.3 KiB
Prolog
35 lines
1.3 KiB
Prolog
#!/usr/bin/env perl
|
|
|
|
use lib '@TOP@/lib/perl';
|
|
|
|
use Test::More tests => 14;
|
|
|
|
use DBD::Menu;
|
|
|
|
my $menu = DBD::Menu->new('test');
|
|
isa_ok $menu, 'DBD::Menu';
|
|
is $menu->name, 'test', 'Menu name';
|
|
is $menu->choices, 0, 'Choices == zero';
|
|
$menu->add_choice('ch1', 'Choice 1');
|
|
is $menu->choices, 1, 'First choice added';
|
|
ok $menu->legal_choice('Choice 1'), 'First choice legal';
|
|
is_deeply $menu->choice(0), ['ch1', 'Choice 1'], 'First choice found';
|
|
$menu->add_choice('ch2', 'Choice 2');
|
|
is $menu->choices, 2, 'Second choice added';
|
|
ok $menu->legal_choice('Choice 1'), 'First choice still legal';
|
|
is_deeply $menu->choice(0), ['ch1', 'Choice 1'], 'First choice still found';
|
|
ok $menu->legal_choice('Choice 2'), 'Second choice legal';
|
|
is_deeply $menu->choice(1), ['ch2', 'Choice 2'], 'Second choice found';
|
|
ok !$menu->legal_choice('Choice 3'), 'Third choice not legal';
|
|
is_deeply $menu->choice(2), undef, 'Third choice undefined';
|
|
|
|
like $menu->toDeclaration, qr/ ^
|
|
\s* \# \s* ifndef \s+ test_NUM_CHOICES \s* \n
|
|
\s* typedef \s+ enum \s+ \{ \s* \n
|
|
\s* ch1 \s+ \/\* [^*]* \*\/, \s* \n
|
|
\s* ch2 \s+ \/\* [^*]* \*\/ \s* \n
|
|
\s* \} \s* test \s* ; \s* \n
|
|
\s* \# \s* define \s+ test_NUM_CHOICES \s+ 2 \s* \n
|
|
\s* \# \s* endif \s* \n
|
|
\s* $ /x, 'C declaration';
|