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

Function test_cleanup

tests/DCPS/QueryCondition/QueryConditionTest.cpp:296–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296bool test_cleanup(const Publisher_var& pub, const Subscriber_var& sub,
297 DataWriter_var& dw, DataReader_var& dr,
298 bool complex_test = false)
299{
300 TopicDescription_var reader_topic_desc = dr->get_topicdescription();
301 Topic_var reader_topic = Topic::_narrow(reader_topic_desc);
302 ReturnCode_t r = sub->delete_datareader(dr);
303 if (r != DDS::RETCODE_OK) {
304 cerr << "ERROR: " << (complex_test ? "complex_" : "") << "test_cleanup: "
305 << "delete " << (complex_test ? "1st " : "")
306 << "datareader failed: " << retcode_to_string(r) << endl;
307 return false;
308 }
309 Topic_var writer_topic = dw->get_topic();
310 r = pub->delete_datawriter(dw);
311 if (r != DDS::RETCODE_OK) {
312 cerr << "ERROR: " << (complex_test ? "complex_" : "") << "test_cleanup: "
313 << "delete datawriter failed: " << retcode_to_string(r) << endl;
314 return false;
315 }
316 DDS::DomainParticipant_var dp = pub->get_participant();
317 r = dp->delete_topic(writer_topic);
318 if (r != DDS::RETCODE_OK) {
319 cerr << "ERROR: " << (complex_test ? "complex_" : "") << "test_cleanup: "
320 << "delete topic failed: " << retcode_to_string(r) << endl;
321 return false;
322 }
323 DDS::DomainParticipant_var dp_sub = sub->get_participant();
324 if (dp_sub != dp) {
325 r = dp_sub->delete_topic(reader_topic);
326 if (r != DDS::RETCODE_OK) {
327 cerr << "ERROR: " << (complex_test ? "complex_" : "") << "test_cleanup: "
328 << "delete topic (reader) failed: " << retcode_to_string(r) << endl;
329 return false;
330 }
331 }
332 return true;
333}
334
335bool complex_test_cleanup(const Publisher_var& pub, const Subscriber_var& sub,
336 DataWriter_var& dw, DataReader_var& dr1, DataReader_var& dr2)

Callers 5

complex_test_cleanupFunction · 0.85
run_filtering_testFunction · 0.85
run_sorting_testFunction · 0.85

Calls 7

retcode_to_stringFunction · 0.85
delete_datawriterMethod · 0.80
delete_topicMethod · 0.80
get_topicdescriptionMethod · 0.45
delete_datareaderMethod · 0.45
get_topicMethod · 0.45
get_participantMethod · 0.45

Tested by

no test coverage detected