| 206 | } |
| 207 | |
| 208 | bool test_equality(DDS::DynamicType_ptr lhs, DDS::DynamicType_ptr rhs, DynamicTypePtrPairSeen& dt_ptr_pair) |
| 209 | { |
| 210 | if (lhs == rhs) { |
| 211 | return true; |
| 212 | } |
| 213 | |
| 214 | DynamicTypeImpl* lhs_i = dynamic_cast<DynamicTypeImpl*>(lhs); |
| 215 | DynamicTypeImpl* rhs_i = dynamic_cast<DynamicTypeImpl*>(rhs); |
| 216 | |
| 217 | if (!lhs_i || !rhs_i) { |
| 218 | return false; |
| 219 | } |
| 220 | |
| 221 | const DynamicTypePtrPair this_pair = std::make_pair(lhs, rhs); |
| 222 | DynamicTypePtrPairSeen::const_iterator have_seen = dt_ptr_pair.find(this_pair); |
| 223 | if (have_seen == dt_ptr_pair.end()) { |
| 224 | dt_ptr_pair.insert(this_pair); |
| 225 | |
| 226 | DDS::TypeDescriptor_var lhs_descriptor; |
| 227 | DDS::TypeDescriptor_var rhs_descriptor; |
| 228 | if (lhs->get_descriptor(lhs_descriptor) != DDS::RETCODE_OK || |
| 229 | rhs->get_descriptor(rhs_descriptor) != DDS::RETCODE_OK) { |
| 230 | return false; |
| 231 | } |
| 232 | |
| 233 | return |
| 234 | test_equality(lhs_descriptor, rhs_descriptor, dt_ptr_pair) && |
| 235 | DynamicTypeImpl::test_equality_i(&lhs_i->members_by_name_, &rhs_i->members_by_name_, dt_ptr_pair) && |
| 236 | DynamicTypeImpl::test_equality_i(&lhs_i->members_by_id_, &rhs_i->members_by_id_, dt_ptr_pair); |
| 237 | } |
| 238 | |
| 239 | return true; |
| 240 | } |
| 241 | |
| 242 | bool DynamicTypeImpl::test_equality_i(DynamicTypeMembersByName* lhs, DynamicTypeMembersByName* rhs, DynamicTypePtrPairSeen& dt_ptr_pair) |
| 243 | { |
no test coverage detected