Add tests for is_a and isCompatible for PVStructures
This commit is contained in:
@ -66,6 +66,9 @@ void test_ntaggregate()
|
||||
create();
|
||||
testOk1(ntAggregate.get() != 0);
|
||||
|
||||
testOk1(NTAggregate::is_a(ntAggregate->getPVStructure()));
|
||||
testOk1(NTAggregate::isCompatible(ntAggregate->getPVStructure()));
|
||||
|
||||
testOk1(ntAggregate->getPVStructure().get() != 0);
|
||||
testOk1(ntAggregate->getValue().get() != 0);
|
||||
testOk1(ntAggregate->getDescriptor().get() != 0);
|
||||
@ -165,7 +168,7 @@ void test_wrap()
|
||||
}
|
||||
|
||||
MAIN(testNTAggregate) {
|
||||
testPlan(28);
|
||||
testPlan(30);
|
||||
test_builder();
|
||||
test_ntaggregate();
|
||||
test_wrap();
|
||||
|
@ -76,6 +76,9 @@ void test_ntattribute()
|
||||
create();
|
||||
testOk1(ntAttribute.get() != 0);
|
||||
|
||||
testOk1(NTAttribute::is_a(ntAttribute->getPVStructure()));
|
||||
testOk1(NTAttribute::isCompatible(ntAttribute->getPVStructure()));
|
||||
|
||||
testOk1(ntAttribute->getPVStructure().get() != 0);
|
||||
testOk1(ntAttribute->getName().get() != 0);
|
||||
testOk1(ntAttribute->getValue().get() != 0);
|
||||
@ -166,7 +169,7 @@ void test_wrap()
|
||||
}
|
||||
|
||||
MAIN(testNTAttribute) {
|
||||
testPlan(33);
|
||||
testPlan(35);
|
||||
test_builder();
|
||||
test_ntattribute();
|
||||
test_wrap();
|
||||
|
@ -72,6 +72,9 @@ void test_ntcontinuum()
|
||||
create();
|
||||
testOk1(ntContinuum.get() != 0);
|
||||
|
||||
testOk1(NTContinuum::is_a(ntContinuum->getPVStructure()));
|
||||
testOk1(NTContinuum::isCompatible(ntContinuum->getPVStructure()));
|
||||
|
||||
testOk1(ntContinuum->getPVStructure().get() != 0);
|
||||
testOk1(ntContinuum->getDescriptor().get() != 0);
|
||||
testOk1(ntContinuum->getAlarm().get() != 0);
|
||||
@ -265,7 +268,7 @@ void test_extra()
|
||||
|
||||
|
||||
MAIN(testNTContinuum) {
|
||||
testPlan(59);
|
||||
testPlan(61);
|
||||
test_builder();
|
||||
test_ntcontinuum();
|
||||
test_wrap();
|
||||
|
@ -67,6 +67,9 @@ void test_ntenum()
|
||||
create();
|
||||
testOk1(ntEnum.get() != 0);
|
||||
|
||||
testOk1(NTEnum::is_a(ntEnum->getPVStructure()));
|
||||
testOk1(NTEnum::isCompatible(ntEnum->getPVStructure()));
|
||||
|
||||
testOk1(ntEnum->getPVStructure().get() != 0);
|
||||
testOk1(ntEnum->getValue().get() != 0);
|
||||
testOk1(ntEnum->getDescriptor().get() != 0);
|
||||
@ -178,7 +181,7 @@ void test_wrap()
|
||||
}
|
||||
|
||||
MAIN(testNTEnum) {
|
||||
testPlan(30);
|
||||
testPlan(32);
|
||||
test_builder();
|
||||
test_ntenum();
|
||||
test_wrap();
|
||||
|
@ -84,6 +84,9 @@ void test_nthistogram()
|
||||
create();
|
||||
testOk1(ntHistogram.get() != 0);
|
||||
|
||||
testOk1(NTHistogram::is_a(ntHistogram->getPVStructure()));
|
||||
testOk1(NTHistogram::isCompatible(ntHistogram->getPVStructure()));
|
||||
|
||||
testOk1(ntHistogram->getPVStructure().get() != 0);
|
||||
testOk1(ntHistogram->getDescriptor().get() != 0);
|
||||
testOk1(ntHistogram->getAlarm().get() != 0);
|
||||
@ -250,7 +253,7 @@ void test_extra()
|
||||
|
||||
|
||||
MAIN(testNTHistogram) {
|
||||
testPlan(50);
|
||||
testPlan(52);
|
||||
test_builder();
|
||||
test_nthistogram();
|
||||
test_wrap();
|
||||
|
@ -69,6 +69,8 @@ void test_ntmatrix()
|
||||
create();
|
||||
testOk1(ntMatrix.get() != 0);
|
||||
|
||||
testOk1(NTMatrix::is_a(ntMatrix->getPVStructure()));
|
||||
testOk1(NTMatrix::isCompatible(ntMatrix->getPVStructure()));
|
||||
|
||||
testOk1(ntMatrix->getPVStructure().get() != 0);
|
||||
testOk1(ntMatrix->getValue().get() != 0);
|
||||
@ -202,7 +204,7 @@ void test_wrap()
|
||||
}
|
||||
|
||||
MAIN(testNTMatrix) {
|
||||
testPlan(36);
|
||||
testPlan(38);
|
||||
test_builder();
|
||||
test_ntmatrix();
|
||||
test_wrap();
|
||||
|
@ -54,6 +54,9 @@ static void test()
|
||||
create();
|
||||
testOk1(multiChannel.get() != 0);
|
||||
|
||||
testOk1(NTMultiChannel::is_a(multiChannel->getPVStructure()));
|
||||
testOk1(NTMultiChannel::isCompatible(multiChannel->getPVStructure()));
|
||||
|
||||
PVStructurePtr pvStructure = multiChannel->getPVStructure();
|
||||
testOk1(pvStructure.get()!=NULL);
|
||||
testOk1(NTMultiChannel::is_a(pvStructure->getStructure()));
|
||||
@ -186,7 +189,7 @@ void test_wrap()
|
||||
|
||||
MAIN(testCreateRequest)
|
||||
{
|
||||
testPlan(25);
|
||||
testPlan(27);
|
||||
test();
|
||||
test_wrap();
|
||||
return testDone();
|
||||
|
@ -81,6 +81,9 @@ void test_ntnameValue()
|
||||
create();
|
||||
testOk1(ntNameValue.get() != 0);
|
||||
|
||||
testOk1(NTNameValue::is_a(ntNameValue->getPVStructure()));
|
||||
testOk1(NTNameValue::isCompatible(ntNameValue->getPVStructure()));
|
||||
|
||||
testOk1(ntNameValue->getPVStructure().get() != 0);
|
||||
testOk1(ntNameValue->getDescriptor().get() != 0);
|
||||
testOk1(ntNameValue->getAlarm().get() != 0);
|
||||
@ -245,7 +248,7 @@ void test_extra()
|
||||
|
||||
|
||||
MAIN(testNTNameValue) {
|
||||
testPlan(48);
|
||||
testPlan(50);
|
||||
test_builder();
|
||||
test_ntnameValue();
|
||||
test_wrap();
|
||||
|
@ -76,6 +76,9 @@ void test_ntndarrayAttribute()
|
||||
create();
|
||||
testOk1(ntNDArrayAttribute.get() != 0);
|
||||
|
||||
testOk1(NTNDArrayAttribute::is_a(ntNDArrayAttribute->getPVStructure()));
|
||||
testOk1(NTNDArrayAttribute::isCompatible(ntNDArrayAttribute->getPVStructure()));
|
||||
|
||||
testOk1(ntNDArrayAttribute->getPVStructure().get() != 0);
|
||||
testOk1(ntNDArrayAttribute->getName().get() != 0);
|
||||
testOk1(ntNDArrayAttribute->getValue().get() != 0);
|
||||
@ -168,7 +171,7 @@ void test_wrap()
|
||||
}
|
||||
|
||||
MAIN(testNTNDArrayAttribute) {
|
||||
testPlan(37);
|
||||
testPlan(39);
|
||||
test_builder();
|
||||
test_ntndarrayAttribute();
|
||||
test_wrap();
|
||||
|
@ -75,7 +75,7 @@ void test_all()
|
||||
add("extra1",fieldCreate->createScalar(pvString)) ->
|
||||
add("extra2",fieldCreate->createScalarArray(pvString)) ->
|
||||
createPVStructure();
|
||||
std::cout << *pvStructure << std::endl;
|
||||
testOk1(NTNDArray::is_a(pvStructure)==true);
|
||||
testOk1(NTNDArray::isCompatible(pvStructure)==true);
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ void test_wrap()
|
||||
}
|
||||
|
||||
MAIN(testNTNDArray) {
|
||||
testPlan(59);
|
||||
testPlan(60);
|
||||
test_builder(true);
|
||||
test_builder(false);
|
||||
test_builder(false); // called twice to test caching
|
||||
|
@ -84,6 +84,9 @@ void test_ntscalarArray()
|
||||
create();
|
||||
testOk1(ntScalarArray.get() != 0);
|
||||
|
||||
testOk1(NTScalarArray::is_a(ntScalarArray->getPVStructure()));
|
||||
testOk1(NTScalarArray::isCompatible(ntScalarArray->getPVStructure()));
|
||||
|
||||
testOk1(ntScalarArray->getPVStructure().get() != 0);
|
||||
testOk1(ntScalarArray->getValue().get() != 0);
|
||||
testOk1(ntScalarArray->getDescriptor().get() != 0);
|
||||
@ -235,7 +238,7 @@ void test_wrap()
|
||||
}
|
||||
|
||||
MAIN(testNTScalarArray) {
|
||||
testPlan(38);
|
||||
testPlan(40);
|
||||
test_builder();
|
||||
test_ntscalarArray();
|
||||
test_wrap();
|
||||
|
@ -54,6 +54,9 @@ static void test()
|
||||
create();
|
||||
testOk1(multiChannel.get() != 0);
|
||||
|
||||
testOk1(NTScalarMultiChannel::is_a(multiChannel->getPVStructure()));
|
||||
testOk1(NTScalarMultiChannel::isCompatible(multiChannel->getPVStructure()));
|
||||
|
||||
PVStructurePtr pvStructure = multiChannel->getPVStructure();
|
||||
testOk1(pvStructure.get()!=NULL);
|
||||
testOk1(NTScalarMultiChannel::is_a(pvStructure->getStructure()));
|
||||
@ -173,7 +176,7 @@ void test_wrap()
|
||||
|
||||
MAIN(testCreateRequest)
|
||||
{
|
||||
testPlan(25);
|
||||
testPlan(27);
|
||||
test();
|
||||
test_wrap();
|
||||
return testDone();
|
||||
|
@ -86,6 +86,9 @@ void test_ntscalar()
|
||||
create();
|
||||
testOk1(ntScalar.get() != 0);
|
||||
|
||||
testOk1(NTScalar::is_a(ntScalar->getPVStructure()));
|
||||
testOk1(NTScalar::isCompatible(ntScalar->getPVStructure()));
|
||||
|
||||
testOk1(ntScalar->getPVStructure().get() != 0);
|
||||
testOk1(ntScalar->getValue().get() != 0);
|
||||
testOk1(ntScalar->getDescriptor().get() != 0);
|
||||
@ -226,7 +229,7 @@ void test_wrap()
|
||||
}
|
||||
|
||||
MAIN(testNTScalar) {
|
||||
testPlan(35);
|
||||
testPlan(37);
|
||||
test_builder();
|
||||
test_ntscalar();
|
||||
test_wrap();
|
||||
|
@ -119,6 +119,9 @@ void test_nttable()
|
||||
create();
|
||||
testOk1(ntTable.get() != 0);
|
||||
|
||||
testOk1(NTTable::is_a(ntTable->getPVStructure()));
|
||||
testOk1(NTTable::isCompatible(ntTable->getPVStructure()));
|
||||
|
||||
testOk1(ntTable->getPVStructure().get() != 0);
|
||||
testOk1(ntTable->getDescriptor().get() != 0);
|
||||
testOk1(ntTable->getAlarm().get() != 0);
|
||||
@ -236,7 +239,7 @@ void test_wrap()
|
||||
}
|
||||
|
||||
MAIN(testNTTable) {
|
||||
testPlan(48);
|
||||
testPlan(50);
|
||||
test_builder();
|
||||
test_labels();
|
||||
test_nttable();
|
||||
|
@ -65,6 +65,9 @@ void test_ntunion()
|
||||
create();
|
||||
testOk1(ntUnion.get() != 0);
|
||||
|
||||
testOk1(NTUnion::is_a(ntUnion->getPVStructure()));
|
||||
testOk1(NTUnion::isCompatible(ntUnion->getPVStructure()));
|
||||
|
||||
testOk1(ntUnion->getPVStructure().get() != 0);
|
||||
testOk1(ntUnion->getValue().get() != 0);
|
||||
testOk1(ntUnion->getDescriptor().get() != 0);
|
||||
@ -157,7 +160,7 @@ void test_wrap()
|
||||
}
|
||||
|
||||
MAIN(testNTUnion) {
|
||||
testPlan(27);
|
||||
testPlan(29);
|
||||
test_builder();
|
||||
test_ntunion();
|
||||
test_wrap();
|
||||
|
Reference in New Issue
Block a user