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

Function ACE_TMAIN

tests/DCPS/ConfigFile/ConfigFile.cpp:34–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32using namespace OpenDDS::DCPS;
33
34int
35ACE_TMAIN(int argc, ACE_TCHAR* argv[])
36{
37 try
38 {
39 DDS::DomainParticipantFactory_var dpf =
40 TheParticipantFactoryWithArgs(argc, argv);
41 TEST_CHECK(dpf.in() != 0);
42
43 // From commandline
44 TEST_CHECK(TheServiceParticipant->config_store()->get("MY_CONFIG_KEY1", "") == "value1");
45 // From environment variable
46 TEST_CHECK(TheServiceParticipant->config_store()->get("MY_CONFIG_KEY2", "") == "value2");
47 TEST_CHECK(OpenDDS::DCPS::DCPS_debug_level == 1);
48 TEST_CHECK(TheServiceParticipant->n_chunks() == 10);
49 TEST_CHECK(TheServiceParticipant->association_chunk_multiplier() == 5);
50 TEST_CHECK(TheServiceParticipant->liveliness_factor() == 70);
51 TEST_CHECK(TheServiceParticipant->bit_transport_port() == 1234);
52 TEST_CHECK(TheServiceParticipant->bit_lookup_duration_msec() == 1000);
53 TEST_CHECK(TheServiceParticipant->get_BIT() == false);
54 TEST_CHECK(OpenDDS::DCPS::Transport_debug_level == 1);
55 TEST_CHECK(TheServiceParticipant->pending_timeout() == TimeDuration(10));
56 TEST_CHECK(TheServiceParticipant->publisher_content_filter() == false);
57 TEST_CHECK(TheServiceParticipant->get_default_discovery() == "MyDefaultDiscovery");
58 TEST_CHECK(TheServiceParticipant->default_address() == NetworkAddress(u_short(0), "127.0.0.1"));
59 TEST_CHECK(TheServiceParticipant->event_dispatcher_thread_count() == 4);
60 TEST_CHECK(TheServiceParticipant->federation_recovery_duration() == 800);
61 TEST_CHECK(TheServiceParticipant->federation_initial_backoff_seconds() == 2);
62 TEST_CHECK(TheServiceParticipant->federation_backoff_multiplier() == 3);
63 TEST_CHECK(TheServiceParticipant->federation_liveliness() == 70);
64
65 TransportInst_rch inst = TransportRegistry::instance()->get_inst("mytcp");
66 TEST_CHECK(inst);
67
68 TcpInst_rch tcp_inst = dynamic_rchandle_cast<TcpInst>(inst);
69 TEST_CHECK(tcp_inst);
70
71 // tcp_inst->dump(std::cout);
72
73 TEST_CHECK(tcp_inst->name() == "mytcp");
74 TEST_CHECK(tcp_inst->max_packet_size() == 2000000000);
75 TEST_CHECK(tcp_inst->max_samples_per_packet() == 3);
76 TEST_CHECK(tcp_inst->optimum_packet_size() == 2048);
77 TEST_CHECK(tcp_inst->thread_per_connection() == true);
78 TEST_CHECK(tcp_inst->event_dispatcher_threads() == 3);
79 TEST_CHECK(tcp_inst->datalink_release_delay() == 5000);
80 TEST_CHECK(tcp_inst->datalink_control_chunks() == 16);
81 TEST_CHECK(tcp_inst->local_address() == "localhost:");
82 TEST_CHECK(tcp_inst->enable_nagle_algorithm() == true);
83 TEST_CHECK(tcp_inst->send_buffer_size() == 131072);
84 TEST_CHECK(tcp_inst->rcv_buffer_size() == 262144);
85 TEST_CHECK(tcp_inst->conn_retry_initial_delay() == 1000);
86 TEST_CHECK(tcp_inst->conn_retry_backoff_multiplier() == 4);
87 TEST_CHECK(tcp_inst->conn_retry_attempts() == 4);
88 TEST_CHECK(tcp_inst->passive_reconnect_duration() == 4000);
89 TEST_CHECK(tcp_inst->max_output_pause_period() == 1000);
90
91 TransportInst_rch inst2 = TransportRegistry::instance()->get_inst("anothertcp");

Callers

nothing calls this directly

Calls 15

instanceFunction · 0.85
config_storeMethod · 0.80
liveliness_factorMethod · 0.80
get_BITMethod · 0.80
pending_timeoutMethod · 0.80
get_default_discoveryMethod · 0.80
default_addressMethod · 0.80

Tested by

no test coverage detected