MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / check

Function check

tests/DCPS/MetaStruct/MetaStructTest.cpp:96–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94
95template<typename T, typename T2>
96bool check(const T& lhs, const T& rhs, const char* name, ACE_Message_Block* amb, Value::Type type,
97 const MetaStruct& ms, T2 Value::* ptrmbr, Encoding::Kind e)
98{
99 if (!checkVal(lhs, rhs, name)) return false;
100
101 Message_Block_Ptr mb(amb->duplicate());
102 const Encoding encoding(e);
103 Serializer ser(mb.get(), encoding);
104 Value val = ms.getValue(ser, name);
105 if (val.type_ == type) {
106 std::string ser_name = std::string("Serialized ") + name;
107 if (!checkVal(T2(enumToString(rhs)), val.*ptrmbr, ser_name.c_str())) return false;
108 } else {
109 std::cout << "ERROR: Serialized type of " << name
110 << " does not match. expected " << type
111 << " received " << val.type_ << std::endl;
112 return false;
113 }
114 return true;
115}
116
117template<size_t N, size_t M>
118void fill_2d(short (&arr)[N][M])

Callers 3

run_test_iFunction · 0.70
validate_posMethod · 0.50
on_data_available_iMethod · 0.50

Calls 5

checkValFunction · 0.85
enumToStringFunction · 0.85
duplicateMethod · 0.45
getMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected