fix issue 118; add put/get equal tests for pvScalar
This commit is contained in:
@@ -392,7 +392,7 @@ Status DbdToPv::getFromDBD(
|
||||
copy_DBRScalarArray<dbr_short_t,PVShortArray>(value,count,pvValue);
|
||||
break;
|
||||
case DBR_LONG:
|
||||
copy_DBRScalarArray<dbr_int_t,PVIntArray>(value,count,pvValue);
|
||||
copy_DBRScalarArray<dbr_long_t,PVIntArray>(value,count,pvValue);
|
||||
break;
|
||||
case DBR_FLOAT:
|
||||
copy_DBRScalarArray<dbr_float_t,PVFloatArray>(value,count,pvValue);
|
||||
@@ -430,7 +430,7 @@ Status DbdToPv::getFromDBD(
|
||||
case DBR_STRING: copy_DBRScalar<dbr_string_t,PVString>(value,pvValue); break;
|
||||
case DBR_CHAR: copy_DBRScalar<dbr_char_t,PVByte>(value,pvValue); break;
|
||||
case DBR_SHORT: copy_DBRScalar<dbr_short_t,PVShort>(value,pvValue); break;
|
||||
case DBR_LONG: copy_DBRScalar<dbr_int_t,PVInt>(value,pvValue); break;
|
||||
case DBR_LONG: copy_DBRScalar<dbr_long_t,PVInt>(value,pvValue); break;
|
||||
case DBR_FLOAT: copy_DBRScalar<dbr_float_t,PVFloat>(value,pvValue); break;
|
||||
case DBR_DOUBLE: copy_DBRScalar<dbr_double_t,PVDouble>(value,pvValue); break;
|
||||
default:
|
||||
|
||||
@@ -573,6 +573,7 @@ private:
|
||||
TestClient(string const &channelName,PVStructurePtr const & pvRequest);
|
||||
string channelName;
|
||||
PVStructurePtr pvRequest;
|
||||
string putValue;
|
||||
TestChannelPtr testChannel;
|
||||
TestChannelGetPtr testChannelGet;
|
||||
TestChannelPutPtr testChannelPut;
|
||||
@@ -611,8 +612,14 @@ void TestClient::getDone(
|
||||
testOk(pvStructure->getSubField("timeStamp").get() != 0,"timeStamp not null");
|
||||
testOk(pvStructure->getSubField("alarm").get() != 0,"alarm not null");
|
||||
if (DEBUG) std::cout << testChannel->getChannelName() + " TestClient::getDone"
|
||||
<< " putValue " << putValue
|
||||
<< " bitSet " << *bitSet
|
||||
<< " pvStructure\n" << pvStructure << "\n";
|
||||
PVScalarPtr pvScalar = pvStructure->getSubField<PVScalar>("value");
|
||||
if(pvScalar) {
|
||||
string getValue = getConvert()->toString(pvScalar);
|
||||
testOk(getValue.compare(putValue)==0,"getValue==putValue");
|
||||
}
|
||||
waitForGet.signal();
|
||||
}
|
||||
|
||||
@@ -649,6 +656,7 @@ void TestClient::put(string const & value)
|
||||
{
|
||||
testDiag("TestClient::put %s := %s",
|
||||
testChannel->getChannelName().c_str(), value.c_str());
|
||||
putValue = value;
|
||||
testChannelPut->put(value);
|
||||
waitPut(OPERATION_TIMEOUT);
|
||||
}
|
||||
@@ -756,7 +764,7 @@ void checkClient(const string &channelName, const string &putValue)
|
||||
|
||||
MAIN(testCaProvider)
|
||||
{
|
||||
testPlan(84 + EXIT_TESTS);
|
||||
testPlan(87 + EXIT_TESTS);
|
||||
|
||||
TestIocPtr testIoc(new TestIoc());
|
||||
testIoc->start();
|
||||
@@ -766,10 +774,8 @@ MAIN(testCaProvider)
|
||||
ChannelProviderRegistry::shared_pointer reg(ChannelProviderRegistry::clients());
|
||||
try {
|
||||
ChannelProvider::shared_pointer channelProvider(reg->getProvider("ca"));
|
||||
if (!channelProvider)
|
||||
testAbort("Channel provider 'ca' not registered");
|
||||
|
||||
checkClient("DBRlongout", "5");
|
||||
if (!channelProvider) testAbort("Channel provider 'ca' not registered");
|
||||
checkClient("DBRlongout", "32768");
|
||||
checkClient("DBRdoubleout", "1.5");
|
||||
checkClient("DBRstringout", "test");
|
||||
checkClient("DBRbyteArray", "1 2 3");
|
||||
|
||||
Reference in New Issue
Block a user