| 960 | } |
| 961 | |
| 962 | int run_test(int argc, ACE_TCHAR* argv[]) |
| 963 | { |
| 964 | DomainParticipantFactory_var dpf = TheParticipantFactoryWithArgs(argc, argv); |
| 965 | |
| 966 | ACE_Argv_Type_Converter conv(argc, argv); |
| 967 | char** const argva = conv.get_ASCII_argv(); |
| 968 | for (int i = 1; i < argc; ++i) { |
| 969 | if (0 == std::strcmp("-dynamic", argva[i])) { |
| 970 | dynamic = true; |
| 971 | break; |
| 972 | } |
| 973 | } |
| 974 | |
| 975 | DomainParticipant_var dp = |
| 976 | dpf->create_participant(23, PARTICIPANT_QOS_DEFAULT, 0, |
| 977 | DEFAULT_STATUS_MASK); |
| 978 | MessageTypeSupport_var ts = new MessageTypeSupportImpl; |
| 979 | ts->register_type(dp, ""); |
| 980 | |
| 981 | Publisher_var pub = dp->create_publisher(PUBLISHER_QOS_DEFAULT, 0, |
| 982 | DEFAULT_STATUS_MASK); |
| 983 | |
| 984 | DomainParticipant_var dp_reader = dp; |
| 985 | if (dynamic) { |
| 986 | dp_reader = dpf->create_participant(23, PARTICIPANT_QOS_DEFAULT, 0, 0); |
| 987 | DDS::DynamicType_var dt = ts->get_type(); |
| 988 | DDS::TypeSupport_var dts = new DDS::DynamicTypeSupport(dt); |
| 989 | CORBA::String_var type_name = ts->get_type_name(); |
| 990 | dts->register_type(dp_reader, type_name); |
| 991 | TransportConfig_rch cfg = TheTransportRegistry->get_config("config2"); |
| 992 | if (cfg) { |
| 993 | TheTransportRegistry->bind_config(cfg, dp_reader); |
| 994 | } |
| 995 | } |
| 996 | |
| 997 | Subscriber_var sub = dp_reader->create_subscriber(SUBSCRIBER_QOS_DEFAULT, 0, 0); |
| 998 | |
| 999 | bool passed = true; |
| 1000 | passed &= run_sorting_test(ts, pub, sub); |
| 1001 | passed &= run_filtering_test(ts, pub, sub); |
| 1002 | passed &= run_change_parameter_test(ts, pub, sub); |
| 1003 | passed &= run_complex_filtering_test(ts, pub, sub); |
| 1004 | passed &= run_dispose_filter_tests(ts, pub, sub); |
| 1005 | |
| 1006 | pub = 0; |
| 1007 | ts = 0; |
| 1008 | sub = 0; |
| 1009 | dp->delete_contained_entities(); |
| 1010 | |
| 1011 | dpf->delete_participant(dp); |
| 1012 | if (dynamic) { |
| 1013 | dp_reader->delete_contained_entities(); |
| 1014 | dpf->delete_participant(dp_reader); |
| 1015 | } |
| 1016 | return passed ? 0 : 1; |
| 1017 | } |
| 1018 | |
| 1019 |
no test coverage detected