Merge 3.16 branch into 7.0
This commit is contained in:
@@ -114,6 +114,7 @@ TESTPROD_HOST += regressTest
|
||||
regressTest_SRCS += regressTest.c
|
||||
regressTest_SRCS += regressTest_registerRecordDeviceDriver.cpp
|
||||
TESTFILES += $(COMMON_DIR)/regressTest.dbd ../regressArray1.db ../regressHex.db ../regressLinkMS.db
|
||||
TESTFILES += ../badCaLink.db
|
||||
TESTS += regressTest
|
||||
|
||||
TARGETS += $(COMMON_DIR)/simmTest.dbd
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
record(ai, "ai:disconn") {
|
||||
field(INP , "invalid CA")
|
||||
field(UDF , "0")
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <testMain.h>
|
||||
#include <dbAccess.h>
|
||||
#include <errlog.h>
|
||||
#include <alarm.h>
|
||||
|
||||
#include <calcoutRecord.h>
|
||||
#include <waveformRecord.h>
|
||||
@@ -123,12 +124,26 @@ void testLinkMS(void)
|
||||
testdbCleanup();
|
||||
}
|
||||
|
||||
/* lp:1798855 disconnected CA link must alarm */
|
||||
static
|
||||
void testCADisconn(void)
|
||||
{
|
||||
testDiag("In testCADisconn()");
|
||||
|
||||
startRegressTestIoc("badCaLink.db");
|
||||
|
||||
testdbPutFieldOk("ai:disconn.PROC", DBF_LONG, 1);
|
||||
testdbGetFieldEqual("ai:disconn.SEVR", DBF_LONG, INVALID_ALARM);
|
||||
testdbGetFieldEqual("ai:disconn.STAT", DBF_LONG, LINK_ALARM);
|
||||
}
|
||||
|
||||
|
||||
MAIN(regressTest)
|
||||
{
|
||||
testPlan(31);
|
||||
testPlan(34);
|
||||
testArrayLength1();
|
||||
testHexConstantLinks();
|
||||
testLinkMS();
|
||||
testCADisconn();
|
||||
return testDone();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use lib '@TOP@/lib/perl';
|
||||
|
||||
use Test::More tests => 17;
|
||||
use Test::More tests => 23;
|
||||
|
||||
use DBD::Recordtype;
|
||||
use DBD::Recfield;
|
||||
@@ -13,6 +13,11 @@ isa_ok $rtyp, 'DBD::Recordtype';
|
||||
is $rtyp->name, 'test', 'Record name';
|
||||
is $rtyp->fields, 0, 'No fields yet';
|
||||
|
||||
is $rtyp->equals($rtyp), 1, 'A declaration == itself';
|
||||
|
||||
my $rt2 = DBD::Recordtype->new('test');
|
||||
is $rtyp->equals($rt2), 1, 'A declaration == a different declaration';
|
||||
|
||||
my $fld1 = DBD::Recfield->new('NAME', 'DBF_STRING');
|
||||
$fld1->add_attribute("size", "41");
|
||||
$fld1->check_valid;
|
||||
@@ -26,6 +31,18 @@ is $rtyp->fields, 1, 'First field added';
|
||||
$rtyp->add_field($fld2);
|
||||
is $rtyp->fields, 2, 'Second field added';
|
||||
|
||||
is $rtyp->equals($rtyp), 1, 'A definition == itself';
|
||||
is $rt2->equals($rtyp), 1, 'A declaration == a definition';
|
||||
|
||||
$rt2->add_field($fld1);
|
||||
my $fld3 = DBD::Recfield->new('DTYP', 'DBF_DEVICE');
|
||||
$fld3->check_valid;
|
||||
$rt2->add_field($fld3);
|
||||
is $rt2->equals($rtyp), 1, 'Identical definitions are equal';
|
||||
|
||||
$fld3->add_attribute("pp", "TRUE");
|
||||
is $rt2->equals($rtyp), 0, 'Different definitions are not equal';
|
||||
|
||||
my @fields = $rtyp->fields;
|
||||
is_deeply \@fields, [$fld1, $fld2], 'Field list';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user