| 335 | } |
| 336 | |
| 337 | int run_test(int argc, ACE_TCHAR *argv[]) |
| 338 | { |
| 339 | u_long mask = ACE_LOG_MSG->priority_mask(ACE_Log_Msg::PROCESS); |
| 340 | ACE_LOG_MSG->priority_mask(mask | LM_TRACE | LM_DEBUG, ACE_Log_Msg::PROCESS); |
| 341 | |
| 342 | ACE_DEBUG((LM_DEBUG,"(%P|%t) write data container test start\n")); |
| 343 | |
| 344 | parse_args(argc, argv); |
| 345 | |
| 346 | try { |
| 347 | DDS::DomainParticipantFactory_var dpf = |
| 348 | TheParticipantFactoryWithArgs(argc, argv); |
| 349 | InstanceHandleGenerator participant_handles; |
| 350 | TestParticipantImpl* tpi = new TestParticipantImpl(participant_handles); |
| 351 | DDS::DomainParticipant_var participant = tpi; |
| 352 | OpenDDS::DCPS::unique_ptr<DDS_TEST> test(new DDS_TEST); |
| 353 | ::DDS::DataWriterQos dw_qos; |
| 354 | test->get_default_datawriter_qos(dw_qos); |
| 355 | |
| 356 | ACE_Recursive_Thread_Mutex deadline_status_lock; |
| 357 | DDS::OfferedDeadlineMissedStatus deadline_status; |
| 358 | CORBA::Long deadline_last_total_count; |
| 359 | try { // the real testing. |
| 360 | |
| 361 | { //Test Case 1 scope |
| 362 | #ifdef OPENDDS_NO_OWNERSHIP_PROFILE |
| 363 | ACE_DEBUG((LM_INFO, ACE_TEXT("\n\n==== Skipping TEST case 1 due to ownership_profile disabled\n"))); |
| 364 | #else |
| 365 | ACE_DEBUG((LM_INFO, |
| 366 | ACE_TEXT("\n\n==== TEST case 1 : Reliable, Keep All, max_samples_per_instance = 2, max samples = 3.\n") |
| 367 | ACE_TEXT("Single instance: Should block on third obtain buffer due to max_samples_per_instance\n") |
| 368 | ACE_TEXT("===============================================\n"))); |
| 369 | |
| 370 | dw_qos.history.kind = DDS::KEEP_ALL_HISTORY_QOS; |
| 371 | dw_qos.history.depth = DDS::LENGTH_UNLIMITED; |
| 372 | dw_qos.resource_limits.max_samples_per_instance = MAX_SAMPLES_PER_INSTANCE; |
| 373 | dw_qos.resource_limits.max_samples = MAX_SAMPLES; |
| 374 | |
| 375 | OpenDDS::DCPS::unique_ptr<Test::SimpleDataWriterImpl> fast_dw(new Test::SimpleDataWriterImpl()); |
| 376 | GuidBuilder builder; |
| 377 | fast_dw->set_publication_id(builder.create()); |
| 378 | fast_dw->set_qos(dw_qos); |
| 379 | test->setup_serialization(fast_dw.get()); |
| 380 | test->substitute_dw_particpant(fast_dw.get(), tpi); |
| 381 | |
| 382 | WriteDataContainer* test_data_container = |
| 383 | test->get_test_data_container(dw_qos, fast_dw.get(), deadline_status_lock, |
| 384 | deadline_status, deadline_last_total_count); |
| 385 | |
| 386 | test->log_dw_qos_limits(dw_qos); |
| 387 | test->log_perceived_qos_limits(test_data_container); |
| 388 | test->log_send_state_lists("Initial Setup:", test_data_container); |
| 389 | |
| 390 | Test::Simple foo1; |
| 391 | foo1.key = 1; |
| 392 | foo1.count = 1; |
| 393 | |
| 394 | Message_Block_Ptr mb(test->serialize_sample(fast_dw.get(), foo1, Sample::KeyOnly)); |
no test coverage detected