parseJSON() assign union with scalar value

This commit is contained in:
Michael Davidsaver
2017-09-06 18:11:42 -05:00
parent 1cb490039f
commit db6ebfe71b
5 changed files with 118 additions and 15 deletions

View File

@@ -130,6 +130,11 @@ testFieldEqual(const std::tr1::shared_ptr<epics::pvData::PVStructure>& val, cons
return ::detail::testPassx(false)<<" null structure pointer";
}
typename PVD::shared_pointer fval(val->getSubField<PVD>(name));
if(!fval) {
epics::pvData::PVUnionPtr uval(val->getSubField<epics::pvData::PVUnion>(name));
if(uval)
fval = uval->get<PVD>();
}
if(!fval) {
return ::detail::testPassx(false)<<" field '"<<name<<"' with type "<<typeid(PVD).name()<<" does not exist";
} else {