removed spaces at end of line
This commit is contained in:
@@ -30,7 +30,7 @@ static FieldCreatePtr fieldCreate = getFieldCreate();
|
||||
|
||||
struct CreateRequestImpl {
|
||||
|
||||
struct Node
|
||||
struct Node
|
||||
{
|
||||
string name;
|
||||
vector<Node> nodes;
|
||||
@@ -55,7 +55,7 @@ struct CreateRequestImpl {
|
||||
|
||||
|
||||
CreateRequestImpl() {}
|
||||
|
||||
|
||||
|
||||
void removeBlanks(string& str)
|
||||
{
|
||||
|
||||
@@ -268,7 +268,7 @@ bool compareField(const PVUnion* left, const PVUnion* right)
|
||||
|
||||
if(*ls!=*right->getUnion())
|
||||
return false;
|
||||
|
||||
|
||||
if (ls->isVariant())
|
||||
{
|
||||
const PVField::const_shared_pointer& lval = left->get();
|
||||
|
||||
@@ -24,7 +24,7 @@ using std::tr1::static_pointer_cast;
|
||||
using std::size_t;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
|
||||
static std::vector<string> split(string commaSeparatedList) {
|
||||
@@ -60,7 +60,7 @@ void Convert::getString(string *buf,PVField const *pvField,int /*indentLevel*/)
|
||||
size_t Convert::fromString(PVStructurePtr const &pvStructure, StringArray const & from, size_t fromStartIndex)
|
||||
{
|
||||
size_t processed = 0;
|
||||
|
||||
|
||||
PVFieldPtrArray const & fieldsData = pvStructure->getPVFields();
|
||||
if (fieldsData.size() != 0) {
|
||||
size_t length = pvStructure->getStructure()->getNumberFields();
|
||||
@@ -93,7 +93,7 @@ size_t Convert::fromString(PVStructurePtr const &pvStructure, StringArray const
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return processed;
|
||||
}
|
||||
|
||||
|
||||
@@ -1001,7 +1001,7 @@ FieldBuilderPtr FieldBuilder::begin(StructureConstPtr S)
|
||||
FieldBuilderPtr FieldBuilder::setId(string const & id)
|
||||
{
|
||||
this->id = id;
|
||||
idSet = true;
|
||||
idSet = true;
|
||||
return shared_from_this();
|
||||
}
|
||||
|
||||
@@ -1065,7 +1065,7 @@ FieldBuilderPtr FieldBuilder::addArray(string const & name, FieldConstPtr const
|
||||
msg << element->getType();
|
||||
THROW_EXCEPTION2(std::invalid_argument, msg.str());
|
||||
}
|
||||
|
||||
|
||||
return add(name, fld);
|
||||
}
|
||||
|
||||
@@ -1100,7 +1100,7 @@ StructureConstPtr FieldBuilder::createStructure()
|
||||
{
|
||||
if (parentBuilder.get())
|
||||
THROW_EXCEPTION2(std::runtime_error, "createStructure() called in nested FieldBuilder");
|
||||
|
||||
|
||||
StructureConstPtr field(static_pointer_cast<const Structure>(createFieldInternal(structure)));
|
||||
reset();
|
||||
return field;
|
||||
@@ -1110,7 +1110,7 @@ UnionConstPtr FieldBuilder::createUnion()
|
||||
{
|
||||
if (parentBuilder.get())
|
||||
THROW_EXCEPTION2(std::runtime_error, "createUnion() called in nested FieldBuilder");
|
||||
|
||||
|
||||
UnionConstPtr field(static_pointer_cast<const Union>(createFieldInternal(union_)));
|
||||
reset();
|
||||
return field;
|
||||
@@ -1178,7 +1178,7 @@ FieldBuilderPtr FieldBuilder::endNested()
|
||||
{
|
||||
if (!parentBuilder)
|
||||
THROW_EXCEPTION2(std::runtime_error, "FieldBuilder::endNested() can only be called to create nested fields");
|
||||
|
||||
|
||||
FieldConstPtr nestedField = createFieldInternal(nestedClassToBuild);
|
||||
|
||||
if(createNested) {
|
||||
@@ -1246,7 +1246,7 @@ ScalarArrayConstPtr FieldCreate::createScalarArray(ScalarType elementType) const
|
||||
strm << elementType;
|
||||
THROW_EXCEPTION2(std::invalid_argument, strm.str());
|
||||
}
|
||||
|
||||
|
||||
return scalarArrays[elementType];
|
||||
}
|
||||
|
||||
@@ -1448,7 +1448,7 @@ static int decodeScalar(int8 code)
|
||||
pvUInt, // unsigned 32-bits
|
||||
pvULong // unsigned 64-bits
|
||||
};
|
||||
|
||||
|
||||
static const int floatLUT[] =
|
||||
{
|
||||
-1, // reserved
|
||||
|
||||
@@ -28,7 +28,7 @@ PVArray::PVArray(FieldConstPtr const & field)
|
||||
{
|
||||
capacityMutable = false;
|
||||
PVField::setImmutable();
|
||||
}
|
||||
}
|
||||
|
||||
bool PVArray::isCapacityMutable() const
|
||||
{
|
||||
|
||||
@@ -169,7 +169,7 @@ void PVString::serialize(ByteBuffer *pbuffer,
|
||||
const size_t maxCount = length - offset;
|
||||
if (count > maxCount)
|
||||
count = maxCount;
|
||||
|
||||
|
||||
// write
|
||||
SerializeHelper::serializeSubstring(storage.value, offset, count, pbuffer, pflusher);
|
||||
}
|
||||
@@ -191,7 +191,7 @@ template<typename T>
|
||||
PVValueArray<T>::PVValueArray(ScalarArrayConstPtr const & scalarArray)
|
||||
:base_t(scalarArray)
|
||||
,value()
|
||||
|
||||
|
||||
{}
|
||||
|
||||
PVValueArray<PVStructurePtr>::PVValueArray(StructureArrayConstPtr const & structureArray)
|
||||
@@ -627,7 +627,7 @@ PVScalarArrayPtr PVDataCreate::createPVScalarArray(
|
||||
return PVScalarArrayPtr(new PVStringArray(scalarArray));
|
||||
}
|
||||
throw std::logic_error("PVDataCreate::createPVScalarArray should never get here");
|
||||
|
||||
|
||||
}
|
||||
|
||||
PVScalarArrayPtr PVDataCreate::createPVScalarArray(
|
||||
|
||||
@@ -62,7 +62,7 @@ size_t PVField::getNumberFields() const
|
||||
|
||||
void PVField::setImmutable() {immutable = true;}
|
||||
|
||||
void PVField::postPut()
|
||||
void PVField::postPut()
|
||||
{
|
||||
if(postHandler) postHandler->postPut();
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ PVFieldPtr PVStructure::getSubFieldImpl(const char *name, bool throws) const
|
||||
std::stringstream ss;
|
||||
ss << "Failed to get field: " << fullName << " ("
|
||||
<< std::string(fullName, sep) << " not found)";
|
||||
throw std::runtime_error(ss.str());
|
||||
throw std::runtime_error(ss.str());
|
||||
}
|
||||
else
|
||||
return PVFieldPtr();
|
||||
@@ -184,7 +184,7 @@ PVFieldPtr PVStructure::getSubFieldImpl(const char *name, bool throws) const
|
||||
std::stringstream ss;
|
||||
ss << "Failed to get field: " << fullName
|
||||
<< " (" << std::string(fullName, sep)
|
||||
<< " is not a structure)";
|
||||
<< " is not a structure)";
|
||||
throw std::runtime_error(ss.str());
|
||||
}
|
||||
else
|
||||
|
||||
@@ -23,7 +23,7 @@ using std::size_t;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
|
||||
#define PVUNION_UNDEFINED_INDEX -1
|
||||
const int32 PVUnion::UNDEFINED_INDEX = PVUNION_UNDEFINED_INDEX;
|
||||
|
||||
@@ -75,7 +75,7 @@ PVFieldPtr PVUnion::select(int32 index)
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
PVFieldPtr PVUnion::select(string const & fieldName)
|
||||
{
|
||||
int32 index = variant ? -1 : static_cast<int32>(unionPtr->getFieldIndex(fieldName));
|
||||
@@ -136,7 +136,7 @@ void PVUnion::serialize(ByteBuffer *pbuffer, SerializableControl *pflusher) cons
|
||||
// write selector value
|
||||
SerializeHelper::writeSize(selector, pbuffer, pflusher);
|
||||
// write value, no value for UNDEFINED_INDEX
|
||||
if (selector != UNDEFINED_INDEX)
|
||||
if (selector != UNDEFINED_INDEX)
|
||||
value->serialize(pbuffer, pflusher);
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ std::ostream& PVUnion::dumpValue(std::ostream& o) const
|
||||
o << format::indent() << fieldField->getField()->getID() << ' ' << fieldField->getFieldName() << ' ' << *(fieldField.get()) << std::endl;
|
||||
else
|
||||
o << *(fieldField.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
return o;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
static
|
||||
StructureConstPtr buildValueAlarm(ScalarType vtype)
|
||||
@@ -157,7 +157,7 @@ StructureConstPtr StandardField::createProperties(string id,FieldConstPtr field,
|
||||
if(first->getType()==epics::pvData::scalar
|
||||
&& second->getType()==epics::pvData::scalarArray) {
|
||||
ScalarConstPtr scalarFirst = static_pointer_cast<const Scalar>(first);
|
||||
ScalarArrayConstPtr scalarArraySecond =
|
||||
ScalarArrayConstPtr scalarArraySecond =
|
||||
static_pointer_cast<const ScalarArray>(second);
|
||||
if(scalarFirst->getScalarType()==pvInt
|
||||
&& scalarArraySecond->getElementType()==pvString) {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
StandardPVField::StandardPVField()
|
||||
: standardField(getStandardField()),
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace ScalarTypeFunc {
|
||||
if(type>=pvBoolean && type<=pvDouble) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static const char* names[] = {
|
||||
"boolean",
|
||||
"byte", "short", "int", "long",
|
||||
|
||||
@@ -17,7 +17,7 @@ using std::cout;
|
||||
using std::endl;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
template<typename T>
|
||||
void copy(
|
||||
|
||||
@@ -42,12 +42,12 @@
|
||||
#define CHECK_POST() assert(words.empty() || words.back()!=0)
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
|
||||
BitSet::shared_pointer BitSet::create(uint32 nbits)
|
||||
{
|
||||
return BitSet::shared_pointer(new BitSet(nbits));
|
||||
}
|
||||
|
||||
|
||||
BitSet::BitSet() {}
|
||||
|
||||
BitSet::BitSet(uint32 nbits)
|
||||
@@ -327,7 +327,7 @@ namespace epics { namespace pvData {
|
||||
SerializeHelper::writeSize(len, buffer, flusher);
|
||||
flusher->ensureBuffer(len);
|
||||
|
||||
n = len / 8;
|
||||
n = len / 8;
|
||||
for (uint32 i = 0; i < n; i++)
|
||||
buffer->putLong(words[i]);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
|
||||
Event::~Event() {
|
||||
|
||||
@@ -32,7 +32,7 @@ Status::Status(StatusType type, string const & message, string const & stackDump
|
||||
if (type == STATUSTYPE_OK)
|
||||
throw std::invalid_argument("type == STATUSTYPE_OK");
|
||||
}
|
||||
|
||||
|
||||
void Status::maximize(const Status& o)
|
||||
{
|
||||
if(m_statusType < o.m_statusType) {
|
||||
@@ -57,7 +57,7 @@ void Status::serialize(ByteBuffer *buffer, SerializableControl *flusher) const
|
||||
SerializeHelper::serializeString(m_stackDump, buffer, flusher);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Status::deserialize(ByteBuffer *buffer, DeserializableControl *flusher)
|
||||
{
|
||||
flusher->ensureData(1);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
TimerCallback::TimerCallback()
|
||||
: period(0.0),
|
||||
|
||||
@@ -30,9 +30,9 @@ static void castVTyped(size_t count, void *draw, const void *sraw)
|
||||
{
|
||||
TO *dest=(TO*)draw;
|
||||
const FROM *src=(FROM*)sraw;
|
||||
|
||||
|
||||
//std::transform(src, src+count, dest, castUnsafe<TO,FROM>);
|
||||
|
||||
|
||||
try {
|
||||
for(size_t i=0; i<count; i++) {
|
||||
dest[i] = castUnsafe<TO,FROM>(src[i]);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
AlarmSeverity AlarmSeverityFunc::getSeverity(int value)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
string PVAlarm::noAlarmFound("No alarm structure found");
|
||||
string PVAlarm::notAttached("Not attached to an alarm structure");
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <pv/pvData.h>
|
||||
#include <pv/pvControl.h>
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::string;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
string PVDisplay::noDisplayFound("No display structure found");
|
||||
string PVDisplay::notAttached("Not attached to an display structure");
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
string PVEnumerated::notFound("No enumerated structure found");
|
||||
string PVEnumerated::notAttached("Not attached to an enumerated structure");
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
string PVTimeStamp::noTimeStamp("No timeStamp structure found");
|
||||
string PVTimeStamp::notAttached("Not attached to a timeStamp structure");
|
||||
@@ -93,5 +93,5 @@ bool PVTimeStamp::set(TimeStamp const & timeStamp)
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
}}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <pv/pvType.h>
|
||||
#include <pv/timeStamp.h>
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
const int32 milliSecPerSec = 1000;
|
||||
const int32 microSecPerSec = 1000000;
|
||||
|
||||
@@ -72,7 +72,7 @@ static bool checkBitSetPVField(
|
||||
|
||||
bool BitSetUtil::compress(BitSetPtr const &bitSet,PVStructurePtr const &pvStructure)
|
||||
{
|
||||
return checkBitSetPVField(pvStructure,bitSet,0);
|
||||
return checkBitSetPVField(pvStructure,bitSet,0);
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
@@ -152,7 +152,7 @@ static void testOperators()
|
||||
b2.set(256);
|
||||
b1 ^= b2;
|
||||
testOk1((b1.cardinality() == 2 && b1.get(1) == true && b1.get(256) == true));
|
||||
|
||||
|
||||
|
||||
testDiag("assign");
|
||||
testOk1(b1 != b2);
|
||||
|
||||
@@ -47,4 +47,4 @@ MAIN(testEvent)
|
||||
testBasicEvent();
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ void test()
|
||||
testOk1(userOverrunBitSet->get(secondsOffset));
|
||||
testOk1(userOverrunBitSet->get(nanosecondsOffset));
|
||||
testOk1(userOverrunBitSet->get(userTagOffset));
|
||||
|
||||
|
||||
BitSetUtil::compress(userChangeBitSet,pvStructure);
|
||||
BitSetUtil::compress(userOverrunBitSet,pvStructure);
|
||||
testOk1(userChangeBitSet->cardinality()==4);
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
virtual void alignBuffer(std::size_t alignment) {
|
||||
buffer->align(alignment);
|
||||
}
|
||||
|
||||
|
||||
virtual bool directSerialize(ByteBuffer* /*existingBuffer*/, const char* /*toSerialize*/,
|
||||
std::size_t /*elementCount*/, std::size_t /*elementSize*/)
|
||||
{
|
||||
@@ -169,25 +169,25 @@ void testEquals() {
|
||||
PVStructureArrayPtr structureArray1 = factory->createPVStructureArray(getFieldCreate()->createStructureArray(structure1->getStructure()));
|
||||
PVStructureArrayPtr structureArray2 = factory->createPVStructureArray(getFieldCreate()->createStructureArray(structure2->getStructure()));
|
||||
testOk1((*structureArray1)==(*structureArray2));
|
||||
|
||||
|
||||
// variant union
|
||||
PVUnionPtr variantUnion1 = factory->createPVVariantUnion();
|
||||
PVUnionPtr variantUnion2 = factory->createPVVariantUnion();
|
||||
testOk1((*variantUnion1)==(*variantUnion2));
|
||||
|
||||
|
||||
variantUnion1->set(structure1);
|
||||
variantUnion2->set(structure1);
|
||||
testOk1((*variantUnion1)==(*variantUnion2));
|
||||
|
||||
variantUnion2->set(structureArray1);
|
||||
testOk1((*variantUnion1)!=(*variantUnion2));
|
||||
|
||||
|
||||
// variant union array
|
||||
PVUnionArrayPtr variantUnionArray1 = factory->createPVVariantUnionArray();
|
||||
PVUnionArrayPtr variantUnionArray2 = factory->createPVVariantUnionArray();
|
||||
testOk1((*variantUnionArray1)==(*variantUnionArray2));
|
||||
|
||||
// union
|
||||
// union
|
||||
UnionConstPtr punion = getFieldCreate()->createFieldBuilder()->
|
||||
add("double", pvDouble)->
|
||||
add("double2", pvDouble)->
|
||||
@@ -201,11 +201,11 @@ void testEquals() {
|
||||
PVUnionPtr union1 = factory->createPVUnion(punion);
|
||||
PVUnionPtr union2 = factory->createPVUnion(punion);
|
||||
testOk1((*union1)==(*union2));
|
||||
|
||||
|
||||
union1->select<PVDouble>("double")->put(1.2);
|
||||
union2->select<PVDouble>("double")->put(1.2);
|
||||
testOk1((*union1)==(*union2));
|
||||
|
||||
|
||||
union2->select<PVDouble>("double")->put(2.2);
|
||||
testOk1((*union1)!=(*union2));
|
||||
|
||||
@@ -216,7 +216,7 @@ void testEquals() {
|
||||
testOk1((*union1)!=(*union2));
|
||||
|
||||
testOk1((*union1)!=(*variantUnion2));
|
||||
|
||||
|
||||
PVUnionArrayPtr unionArray1 = factory->createPVUnionArray(getFieldCreate()->createUnionArray(punion));
|
||||
PVUnionArrayPtr unionArray2 = factory->createPVUnionArray(getFieldCreate()->createUnionArray(punion));
|
||||
testOk1((*unionArray1)==(*unionArray2));
|
||||
@@ -439,17 +439,17 @@ void testUnion() {
|
||||
|
||||
PVUnionArrayPtr variantArray = factory->createPVVariantUnionArray();
|
||||
testOk1(variantArray.get()!=NULL);
|
||||
|
||||
|
||||
variantArray->setLength(6);
|
||||
PVUnionArray::svector data;
|
||||
|
||||
PVUnionPtr u = factory->createPVVariantUnion();
|
||||
data.push_back(u);
|
||||
|
||||
|
||||
u = factory->createPVVariantUnion();
|
||||
u->set(factory->createPVStructure(getStandardField()->timeStamp()));
|
||||
data.push_back(u);
|
||||
|
||||
|
||||
u = factory->createPVVariantUnion();
|
||||
u->set(factory->createPVStructure(getStandardField()->control()));
|
||||
data.push_back(u);
|
||||
@@ -458,16 +458,16 @@ void testUnion() {
|
||||
|
||||
variantArray->replace(freeze(data));
|
||||
serializationTest(variantArray);
|
||||
|
||||
|
||||
testDiag("\tVariant union test");
|
||||
|
||||
|
||||
UnionConstPtr punion = getFieldCreate()->createFieldBuilder()->
|
||||
add("doubleValue", pvDouble)->
|
||||
add("intValue", pvInt)->
|
||||
createUnion();
|
||||
|
||||
|
||||
u = factory->createPVUnion(punion);
|
||||
testOk1(NULL!=u.get());
|
||||
testOk1(NULL!=u.get());
|
||||
|
||||
// null union test
|
||||
testOk1(NULL==u->get().get());
|
||||
@@ -480,13 +480,13 @@ void testUnion() {
|
||||
testOk1(0 == u->getSelectedIndex());
|
||||
testOk1("doubleValue" == u->getSelectedFieldName());
|
||||
serializationTest(u);
|
||||
|
||||
|
||||
u->select<PVInt>("intValue")->put(543);
|
||||
testOk1(543 == u->get<PVInt>()->get());
|
||||
testOk1(1 == u->getSelectedIndex());
|
||||
testOk1("intValue" == u->getSelectedFieldName());
|
||||
serializationTest(u);
|
||||
|
||||
|
||||
u->select<PVInt>(1)->put(5432);
|
||||
testOk1(5432 == u->get<PVInt>()->get());
|
||||
serializationTest(u);
|
||||
@@ -496,12 +496,12 @@ void testUnion() {
|
||||
testOk1(PVUnion::UNDEFINED_INDEX == u->getSelectedIndex());
|
||||
testOk1("" == u->getSelectedFieldName());
|
||||
serializationTest(u);
|
||||
|
||||
|
||||
u->set("doubleValue", doubleValue);
|
||||
testOk1(doubleValue.get() == u->get().get());
|
||||
testOk1(0 == u->getSelectedIndex());
|
||||
serializationTest(u);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
u->set(1, doubleValue);
|
||||
@@ -523,7 +523,7 @@ void testUnion() {
|
||||
// expected
|
||||
testPass("PVUnion.select(int32) index out of bounds test");
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
u->select(-2);
|
||||
@@ -545,22 +545,22 @@ void testUnion() {
|
||||
// expected
|
||||
testPass("PVUnion.set(int32, PVFieldPtr const&) index out of bounds test");
|
||||
}
|
||||
|
||||
|
||||
testDiag("\tUnion array test");
|
||||
|
||||
PVUnionArrayPtr unionArray = factory->createPVUnionArray(getFieldCreate()->createUnionArray(punion));
|
||||
testOk1(unionArray.get()!=NULL);
|
||||
|
||||
|
||||
unionArray->setLength(6);
|
||||
data.clear();
|
||||
|
||||
u = factory->createPVUnion(punion);
|
||||
data.push_back(u);
|
||||
|
||||
|
||||
u = factory->createPVUnion(punion);
|
||||
u->select<PVDouble>(0)->put(12);
|
||||
data.push_back(u);
|
||||
|
||||
|
||||
u = factory->createPVUnion(punion);
|
||||
u->select<PVInt>(1)->put(421);
|
||||
data.push_back(u);
|
||||
@@ -569,7 +569,7 @@ void testUnion() {
|
||||
|
||||
unionArray->replace(freeze(data));
|
||||
serializationTest(unionArray);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void testStructureArray() {
|
||||
@@ -677,11 +677,11 @@ void testIntrospectionSerialization()
|
||||
// variant union
|
||||
UnionConstPtr variant = factory->createVariantUnion();
|
||||
serializationFieldTest(variant);
|
||||
|
||||
|
||||
// variant array union
|
||||
UnionArrayConstPtr variantArray = factory->createVariantUnionArray();
|
||||
serializationFieldTest(variantArray);
|
||||
|
||||
|
||||
// union
|
||||
UnionConstPtr punion = factory->createFieldBuilder()->
|
||||
add("double", pvDouble)->
|
||||
@@ -693,7 +693,7 @@ void testIntrospectionSerialization()
|
||||
addArray("intArray", pvInt)->
|
||||
createUnion();
|
||||
serializationFieldTest(punion);
|
||||
|
||||
|
||||
// union array
|
||||
UnionArrayConstPtr punionArray = factory->createUnionArray(punion);
|
||||
serializationFieldTest(punionArray);
|
||||
@@ -877,7 +877,7 @@ MAIN(testSerialization) {
|
||||
testStructure();
|
||||
testStructureId();
|
||||
testStructureArray();
|
||||
|
||||
|
||||
testUnion();
|
||||
|
||||
testArraySizeType();
|
||||
|
||||
@@ -522,7 +522,7 @@ void testICE()
|
||||
testOk1(B.size()==6);
|
||||
testOk1(A.data()!=check);
|
||||
testOk1(B.data()==check);
|
||||
|
||||
|
||||
D = B; // create second const reference
|
||||
|
||||
// clears D, but reference to B
|
||||
|
||||
@@ -64,7 +64,7 @@ static void testAlarm()
|
||||
{
|
||||
testDiag("testAlarm\n");
|
||||
Alarm alarm;
|
||||
PVAlarm pvAlarm;
|
||||
PVAlarm pvAlarm;
|
||||
bool result;
|
||||
PVFieldPtr pvField = doubleRecord->getSubField<PVStructure>(string("alarm"));
|
||||
if(pvField.get()==NULL) {
|
||||
@@ -93,7 +93,7 @@ static void testTimeStamp()
|
||||
{
|
||||
testDiag("testTimeStamp\n");
|
||||
TimeStamp timeStamp;
|
||||
PVTimeStamp pvTimeStamp;
|
||||
PVTimeStamp pvTimeStamp;
|
||||
bool result;
|
||||
PVFieldPtr pvField = doubleRecord->getSubField<PVStructure>(string("timeStamp"));
|
||||
if(pvField.get()==NULL) {
|
||||
@@ -132,7 +132,7 @@ static void testControl()
|
||||
{
|
||||
testDiag("testControl\n");
|
||||
Control control;
|
||||
PVControl pvControl;
|
||||
PVControl pvControl;
|
||||
bool result;
|
||||
PVFieldPtr pvField = doubleRecord->getSubField<PVStructure>(string("control"));
|
||||
if(pvField.get()==NULL) {
|
||||
@@ -159,7 +159,7 @@ static void testDisplay()
|
||||
{
|
||||
testDiag("testDisplay\n");
|
||||
Display display;
|
||||
PVDisplay pvDisplay;
|
||||
PVDisplay pvDisplay;
|
||||
bool result;
|
||||
PVFieldPtr pvField = doubleRecord->getSubField<PVStructure>(string("display"));
|
||||
if(pvField.get()==NULL) {
|
||||
@@ -191,7 +191,7 @@ static void testDisplay()
|
||||
static void testEnumerated()
|
||||
{
|
||||
testDiag("testEnumerated\n");
|
||||
PVEnumerated pvEnumerated;
|
||||
PVEnumerated pvEnumerated;
|
||||
bool result;
|
||||
PVFieldPtr pvField = enumeratedRecord->getSubField<PVStructure>(string("value"));
|
||||
if(pvField.get()==NULL) {
|
||||
|
||||
@@ -31,7 +31,7 @@ static StandardPVFieldPtr standardPVField;
|
||||
static void test()
|
||||
{
|
||||
std::ostringstream oss;
|
||||
|
||||
|
||||
testDiag("\ntestBitSetUtil\n");
|
||||
StringArray fieldNames;
|
||||
PVFieldPtrArray pvFields;
|
||||
|
||||
@@ -34,7 +34,7 @@ void test_structure()
|
||||
|
||||
FieldCreatePtr fieldCreate = getFieldCreate();
|
||||
FieldBuilderPtr fb = fieldCreate->createFieldBuilder();
|
||||
|
||||
|
||||
// test with simple (non-nested) structure
|
||||
std::string ID = "testStructureID";
|
||||
StructureConstPtr s = fb->setId(ID)->
|
||||
@@ -44,7 +44,7 @@ void test_structure()
|
||||
testOk1(s.get() != 0);
|
||||
testOk1(ID == s->getID());
|
||||
testOk1(2 == s->getFields().size());
|
||||
|
||||
|
||||
FieldConstPtr f0 = s->getField(0);
|
||||
testOk1(scalar == f0->getType());
|
||||
testOk1("double" == s->getFieldName(0));
|
||||
@@ -54,13 +54,13 @@ void test_structure()
|
||||
testOk1(scalarArray == f1->getType());
|
||||
testOk1("intArray" == s->getFieldName(1));
|
||||
testOk(pvInt == std::tr1::static_pointer_cast<const ScalarArray>(f1)->getElementType(), "f1 element type == int");
|
||||
|
||||
|
||||
// test reuse with empty structure
|
||||
StructureConstPtr emptyStructure = fb->createStructure();
|
||||
testOk1(emptyStructure.get() != 0);
|
||||
testOk1(Structure::DEFAULT_ID == emptyStructure->getID());
|
||||
testOk1(0 == emptyStructure->getFields().size());
|
||||
|
||||
|
||||
// test add/addArray with Field
|
||||
StructureConstPtr s2 = fb->add("s", s)->
|
||||
addArray("sArray", s)->
|
||||
@@ -137,7 +137,7 @@ void test_nestedStructure()
|
||||
testDiag("Test test_nestedStructure()");
|
||||
|
||||
FieldCreatePtr fieldCreate = getFieldCreate();
|
||||
|
||||
|
||||
std::string NESTED_ID = "nestedID";
|
||||
StructureConstPtr s = fieldCreate->createFieldBuilder()->
|
||||
add("double", pvDouble)->
|
||||
@@ -163,21 +163,21 @@ void test_nestedStructure()
|
||||
|
||||
{
|
||||
StructureConstPtr s2 = std::tr1::static_pointer_cast<const Structure>(f1);
|
||||
|
||||
|
||||
testOk1(s2.get() != 0);
|
||||
testOk1(NESTED_ID == s2->getID());
|
||||
testOk1(2 == s2->getFields().size());
|
||||
|
||||
|
||||
FieldConstPtr f20 = s2->getField(0);
|
||||
testOk1(scalar == f20->getType());
|
||||
testOk1("short" == s2->getFieldName(0));
|
||||
testOk(pvShort == std::tr1::static_pointer_cast<const Scalar>(f20)->getScalarType(), "f20 scalar type == short");
|
||||
|
||||
|
||||
FieldConstPtr f21 = s2->getField(1);
|
||||
testOk1(scalar == f21->getType());
|
||||
testOk1("long" == s2->getFieldName(1));
|
||||
testOk(pvLong == std::tr1::static_pointer_cast<const Scalar>(f21)->getScalarType(), "f21 element type == long");
|
||||
|
||||
|
||||
}
|
||||
|
||||
FieldConstPtr f2 = s->getField(2);
|
||||
@@ -185,15 +185,15 @@ void test_nestedStructure()
|
||||
testOk1("intArray" == s->getFieldName(2));
|
||||
testOk(pvInt == std::tr1::static_pointer_cast<const ScalarArray>(f2)->getElementType(), "f2 element type == int");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void test_nestedStructureArray()
|
||||
{
|
||||
testDiag("Test test_nestedStructureArray()");
|
||||
|
||||
FieldCreatePtr fieldCreate = getFieldCreate();
|
||||
|
||||
|
||||
std::string NESTED_ID = "nestedID";
|
||||
StructureConstPtr s = fieldCreate->createFieldBuilder()->
|
||||
add("double", pvDouble)->
|
||||
@@ -219,21 +219,21 @@ void test_nestedStructureArray()
|
||||
|
||||
{
|
||||
StructureConstPtr s2 = std::tr1::static_pointer_cast<const StructureArray>(f1)->getStructure();
|
||||
|
||||
|
||||
testOk1(s2.get() != 0);
|
||||
testOk1(NESTED_ID == s2->getID());
|
||||
testOk1(2 == s2->getFields().size());
|
||||
|
||||
|
||||
FieldConstPtr f20 = s2->getField(0);
|
||||
testOk1(scalar == f20->getType());
|
||||
testOk1("short" == s2->getFieldName(0));
|
||||
testOk(pvShort == std::tr1::static_pointer_cast<const Scalar>(f20)->getScalarType(), "f20 scalar type == short");
|
||||
|
||||
|
||||
FieldConstPtr f21 = s2->getField(1);
|
||||
testOk1(scalar == f21->getType());
|
||||
testOk1("long" == s2->getFieldName(1));
|
||||
testOk(pvLong == std::tr1::static_pointer_cast<const Scalar>(f21)->getScalarType(), "f21 element type == long");
|
||||
|
||||
|
||||
}
|
||||
|
||||
FieldConstPtr f2 = s->getField(2);
|
||||
|
||||
@@ -32,7 +32,7 @@ static void testScalarCommon(ScalarType stype,
|
||||
ScalarConstPtr pscalar = fieldCreate->createScalar(stype);
|
||||
Type type = pscalar->getType();
|
||||
testOk1(type==scalar);
|
||||
|
||||
|
||||
std::ostringstream oss;
|
||||
oss << type;
|
||||
testOk1(oss.str().compare("scalar")==0);
|
||||
@@ -307,17 +307,17 @@ static void testUnion()
|
||||
|
||||
testOk1(union1arr->getUnion()==union1);
|
||||
testOk1(union1arr->getID()=="union[]");
|
||||
|
||||
|
||||
UnionConstPtr variantUnion1 = fieldCreate->createVariantUnion();
|
||||
|
||||
testOk1(variantUnion1->getNumberFields()==0);
|
||||
testOk1(variantUnion1->getID() == Union::ANY_ID);
|
||||
|
||||
|
||||
UnionArrayConstPtr variantUnion1arr = fieldCreate->createVariantUnionArray();
|
||||
|
||||
testOk1(variantUnion1arr->getUnion()==variantUnion1);
|
||||
testOk1(variantUnion1arr->getID()=="any[]");
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void testBoundedString()
|
||||
|
||||
@@ -72,7 +72,7 @@ MAIN(testOperators)
|
||||
|
||||
pvStructure = standardPVField->scalarArray(pvDouble,"alarm,timeStamp");
|
||||
std::cout << *pvStructure << std::endl;
|
||||
|
||||
|
||||
PVDoubleArray::svector values(3);
|
||||
values[0] = 1.1; values[1] = 2.2; values[2] = 3.3;
|
||||
PVDoubleArrayPtr darray = pvStructure->getSubField<PVDoubleArray>("value");
|
||||
|
||||
@@ -81,7 +81,7 @@ static void testCreatePVStructure()
|
||||
pvFields.push_back(pv1);
|
||||
PVStructurePtr pvParent = pvDataCreate->createPVStructure(
|
||||
fieldNames,pvFields);
|
||||
|
||||
|
||||
std::cout << "testCreatePVStructure PASSED" << std::endl;
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ static void testPVScalar()
|
||||
testPVScalarWithProperties(string("float"),pvFloat);
|
||||
testPVScalarWithProperties(string("double"),pvDouble);
|
||||
testPVScalarWithProperties(string("string"),pvString);
|
||||
|
||||
|
||||
std::cout << "testPVScalar PASSED" << std::endl;
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ static void testScalarArray()
|
||||
}
|
||||
|
||||
static void testRequest()
|
||||
{
|
||||
{
|
||||
StringArray nullNames;
|
||||
FieldConstPtrArray nullFields;
|
||||
StringArray optionNames(1);
|
||||
|
||||
@@ -113,9 +113,9 @@ static void testCompress()
|
||||
static void testRemove()
|
||||
{
|
||||
testDiag("Test structure array remove");
|
||||
|
||||
|
||||
PVStructureArray::svector contents(10);
|
||||
|
||||
|
||||
for(size_t i=0; i<contents.size(); i++)
|
||||
contents[i] = standardField->alarm()->build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user