2 #include "idl3_client.h"
4 #include "ace/Get_Opt.h"
5 #include "ace/OS_NS_string.h"
7 // All the magic quantities are here at the top.
9 const char *COMPONENT_ID
= "IDL:mod/test_component:1.0";
10 const char *COMPONENT_SCOPED_NAME
= "::mod::test_component";
11 const char *COMP_BASE_ID
= "IDL:help/c_base:1.0";
13 const char *VALUETYPE_ID
= "IDL:mod/test_valuetype:1.0";
14 const char *VALUETYPE_SCOPED_NAME
= "::mod::test_valuetype";
15 const char *VT_BASE_ID
= "IDL:help/v_base:1.0";
17 const char *HOME_ID
= "IDL:mod/test_home:1.0";
18 const char *HOME_SCOPED_NAME
= "::mod::test_home";
19 const char *HOME_BASE_ID
= "IDL:help/h_base:1.0";
20 const char *HOME_KEY_ID
= "IDL:help/h_key:1.0";
22 const char *EVENTTYPE_ID
= "IDL:mod/test_eventtype:1.0";
24 const CORBA::ULong ATTRS_LEN
= 1;
25 const CORBA::ULong OPS_LEN
= 1;
26 const CORBA::ULong FACTORY_LEN
= 2;
28 const char *ATTR_LOCAL_NAMES
[] =
33 const CORBA::TCKind ATTR_TC_KINDS
[] =
38 const CORBA::ULong GET_EXCEP_LEN
[] =
43 const CORBA::ULong PUT_EXCEP_LEN
[] =
48 const char *OP_NAMES
[] =
53 const CORBA::TCKind OP_RET_KINDS
[] =
58 const CORBA::ULong PARAMS_LEN
[] =
63 const char *PARAM_NAMES
[] =
70 const CORBA::ULong OP_EXCEP_LEN
[] =
75 const CORBA::ULong COMP_SUPPORTED_LEN
= 2;
77 const char *COMP_SUPPORTED_IDS
[] =
79 "IDL:help/c_supp1:1.0",
80 "IDL:help/c_supp2:1.0"
83 const CORBA::ULong PROVIDES_LEN
= 1;
84 const CORBA::ULong USES_LEN
= 2;
85 const CORBA::ULong EMITS_LEN
= 1;
86 const CORBA::ULong PUBLISHES_LEN
= 1;
87 const CORBA::ULong CONSUMES_LEN
= 1;
89 const char *PROVIDES_NAMES
[] =
94 const char *PROVIDES_TYPE_IDS
[] =
96 "IDL:help/c_provides1:1.0"
99 const char *USES_NAMES
[] =
105 const char *USES_TYPE_IDS
[] =
107 "IDL:help/c_uses1:1.0",
108 "IDL:help/c_uses2:1.0"
111 const CORBA::Boolean USES_MULTIPLE_FLAGS
[] =
117 const char *EMITS_NAMES
[] =
122 const char *PUBLISHES_NAMES
[] =
127 const char *CONSUMES_NAMES
[] =
132 const char *EMITS_IDS
[] =
134 "IDL:help/c_emits1:1.0"
137 const char *PUBLISHES_IDS
[] =
139 "IDL:help/c_publishes1:1.0"
142 const char *CONSUMES_IDS
[] =
144 "IDL:help/c_consumes1:1.0"
147 const CORBA::ULong VT_SUPPORTED_LEN
= 2;
149 const char *VT_SUPPORTED_IDS
[] =
151 "IDL:help/v_supp1:1.0",
152 "IDL:help/v_supp2:1.0"
155 const CORBA::ULong MEM_LEN
= 2;
157 const CORBA::Visibility MEM_VIS
[] =
159 CORBA::PUBLIC_MEMBER
,
160 CORBA::PRIVATE_MEMBER
163 const char *MEM_NAMES
[] =
169 const CORBA::ULong VT_FACTORY_PARAM_LENS
[] =
175 const CORBA::ULong VT_FACTORY_EXCEP_LENS
[] =
181 const char *VT_FACTORY_PARAM_NAMES
[][2] =
184 {"set_tm1a", "set_tm2"}
187 const char *VT_FACTORY_EXCEP_NAMES
[][2] =
193 const CORBA::ULong HOME_SUPPORTED_LEN
= 2;
195 const char *HOME_SUPPORTED_IDS
[] =
197 "IDL:help/h_supp1:1.0",
198 "IDL:help/h_supp2:1.0"
201 const CORBA::ULong HOME_FACTORY_LEN
= 1;
202 const CORBA::ULong HOME_FINDER_LEN
= 1;
204 const CORBA::ULong HOME_FACTORY_PARAM_LENS
[] =
209 const char *HOME_FACTORY_PARAM_NAMES
[][1] =
214 const CORBA::ULong HOME_FACTORY_EXCEP_LENS
[] =
219 const char *HOME_FACTORY_EXCEP_NAMES
[][1] =
224 const CORBA::ULong HOME_FINDER_PARAM_LENS
[] =
229 const char *HOME_FINDER_PARAM_NAMES
[][3] =
231 {"id_number", "id_string", "pkey"}
234 const CORBA::ULong HOME_FINDER_EXCEP_LENS
[] =
239 const char *HOME_FINDER_EXCEP_NAMES
[][1] =
244 IDL3_Client::IDL3_Client (void)
249 IDL3_Client::~IDL3_Client (void)
254 IDL3_Client::init (int argc
,
257 this->orb_
= CORBA::ORB_init (argc
, argv
);
259 CORBA::Object_var obj
=
260 this->orb_
->resolve_initial_references ("InterfaceRepository");
262 if (CORBA::is_nil (obj
.in ()))
264 ACE_ERROR_RETURN ((LM_ERROR
,
265 "IDL3_Client - IFR resolution failed\n"),
270 CORBA::ComponentIR::Repository::_narrow (obj
.in ());
272 if (CORBA::is_nil (this->repo_
.in ()))
274 ACE_ERROR_RETURN ((LM_ERROR
,
275 "IDL3_Client - IFR narrow failed\n"),
279 if (this->parse_args (argc
, argv
) == -1)
288 IDL3_Client::run (void)
290 int status
= this->component_test ();
297 status
= this->valuetype_test (VALUETYPE_ID
,
305 status
= this->home_test ();
312 status
= this->valuetype_test (EVENTTYPE_ID
,
324 IDL3_Client::parse_args (int argc
,
327 ACE_Get_Opt
opts (argc
, argv
, ACE_TEXT("d"));
330 while ((c
= opts ()) != -1)
333 case 'd': // Turn on debugging outoput.
338 ACE_ERROR_RETURN ((LM_ERROR
,
348 IDL3_Client::component_test (void)
350 CORBA::Contained_var result
=
351 this->repo_
->lookup_id (COMPONENT_ID
);
353 if (CORBA::is_nil (result
.in ()))
357 ACE_DEBUG ((LM_DEBUG
,
358 "component_test: lookup by id failed\n"));
364 CORBA::String_var str
=
365 result
->absolute_name ();
367 const char *tmp
= str
.in ();
373 ACE_DEBUG ((LM_DEBUG
,
374 "component_test: component has null scoped name\n"));
380 if (ACE_OS::strcmp (tmp
, COMPONENT_SCOPED_NAME
) != 0)
384 ACE_DEBUG ((LM_DEBUG
,
386 "component has incorrect scoped name\n"));
392 CORBA::ComponentIR::ComponentDef_var comp_def
=
393 CORBA::ComponentIR::ComponentDef::_narrow (result
.in ());
395 CORBA::TypeCode_var comp_tc
=
398 if (CORBA::is_nil (comp_tc
.in ()))
402 ACE_DEBUG ((LM_DEBUG
,
404 "type code creation failed\n"));
410 tmp
= comp_tc
->id ();
412 if (tmp
== 0 || ACE_OS::strcmp (tmp
, COMPONENT_ID
) != 0)
416 ACE_DEBUG ((LM_DEBUG
,
418 "bad id from type code\n"));
424 CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription_var desc
=
425 comp_def
->describe_ext_interface ();
427 if (desc
.ptr () == 0)
431 ACE_DEBUG ((LM_DEBUG
,
433 "describe_ext_interface return null\n"));
439 int status
= this->component_attribute_test (desc
);
446 status
= this->component_inheritance_test (comp_def
);
453 status
= this->component_port_test (comp_def
);
464 IDL3_Client::home_test (void)
466 CORBA::Contained_var result
=
467 this->repo_
->lookup_id (HOME_ID
);
469 if (CORBA::is_nil (result
.in ()))
473 ACE_DEBUG ((LM_DEBUG
,
474 "home_test: lookup by id failed\n"));
480 CORBA::ComponentIR::HomeDef_var home
=
481 CORBA::ComponentIR::HomeDef::_narrow (result
.in ());
483 if (CORBA::is_nil (result
.in ()))
487 ACE_DEBUG ((LM_DEBUG
,
488 "home_test: home narrow failed\n"));
494 CORBA::ComponentIR::ComponentDef_var managed
=
495 home
->managed_component ();
497 if (CORBA::is_nil (managed
.in ()))
501 ACE_DEBUG ((LM_DEBUG
,
502 "home_test: managed component is null\n"));
508 CORBA::String_var str
= managed
->id ();
510 if (str
.in () == 0 || ACE_OS::strcmp (str
.in (), COMPONENT_ID
) != 0)
514 ACE_DEBUG ((LM_DEBUG
,
515 "home_test: bad id for managed component\n"));
521 CORBA::ValueDef_var pkey
=
522 home
->primary_key ();
524 if (CORBA::is_nil (pkey
.in ()))
528 ACE_DEBUG ((LM_DEBUG
,
529 "home_test: primary key is null\n"));
537 if (str
.in () == 0 || ACE_OS::strcmp (str
.in (), HOME_KEY_ID
) != 0)
541 ACE_DEBUG ((LM_DEBUG
,
542 "home_test: bad id for managed component\n"));
548 int status
= this->home_inheritance_test (home
);
555 CORBA::Contained::Description_var desc
=
558 const CORBA::ComponentIR::HomeDescription
*home_desc
= 0;
560 if ((desc
->value
>>= home_desc
) == 0)
564 ACE_DEBUG ((LM_DEBUG
,
565 "home_test: extraction of HomeDescription failed\n"));
571 status
= this->home_factory_test (home_desc
);
578 status
= this->home_finder_test (home_desc
);
589 IDL3_Client::valuetype_test (const char *repo_id
,
592 CORBA::Contained_var result
=
593 this->repo_
->lookup_id (repo_id
);
595 if (CORBA::is_nil (result
.in ()))
599 ACE_DEBUG ((LM_DEBUG
,
600 "%Ctype_test: lookup by id failed\n",
607 CORBA::ExtValueDef_var evd
=
608 CORBA::ExtValueDef::_narrow (result
.in ());
610 if (CORBA::is_nil (evd
.in ()))
614 ACE_DEBUG ((LM_DEBUG
,
615 "%Ctype_test: narrow to ExtValueDef failed\n",
622 CORBA::ExtValueDef::ExtFullValueDescription_var desc
=
623 evd
->describe_ext_value ();
625 int status
= this->valuetype_attribute_test (desc
,
633 status
= this->valuetype_inheritance_test (evd
,
641 status
= this->valuetype_operation_test (desc
,
649 status
= this->valuetype_member_test (desc
,
657 status
= this->valuetype_factory_test (desc
, prefix
);
668 IDL3_Client::component_attribute_test (
669 CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription_var
&desc
)
671 if (desc
->attributes
.length () != ATTRS_LEN
)
675 ACE_DEBUG ((LM_DEBUG
,
676 "component_attribute_test: wrong number of attrs\n"));
684 for (CORBA::ULong i
= 0; i
< ATTRS_LEN
; ++i
)
686 tmp
= desc
->attributes
[i
].name
.in ();
688 if (tmp
== 0 || ACE_OS::strcmp (tmp
, ATTR_LOCAL_NAMES
[i
]) != 0)
692 ACE_DEBUG ((LM_DEBUG
,
693 "component_attribute_test: "
694 "wrong local name for attribute #%d\n",
702 desc
->attributes
[i
].type
->kind ();
704 if (kind
!= ATTR_TC_KINDS
[i
])
708 ACE_DEBUG ((LM_DEBUG
,
709 "component_attribute_test: "
710 "wrong TCKind for attribute #%d\n",
717 if (desc
->attributes
[i
].get_exceptions
.length () != GET_EXCEP_LEN
[i
])
721 ACE_DEBUG ((LM_DEBUG
,
722 "component_attribute_test: "
723 "wrong number of get-exceptions"
724 " for attribute #%d\n",
731 if (desc
->attributes
[i
].put_exceptions
.length () != PUT_EXCEP_LEN
[i
])
735 ACE_DEBUG ((LM_DEBUG
,
736 "component_attribute_test: "
737 "wrong number of put-exceptions"
738 " for attribute #%d\n",
750 IDL3_Client::component_inheritance_test (
751 CORBA::ComponentIR::ComponentDef_var
&comp_def
)
753 CORBA::ComponentIR::ComponentDef_var comp_base
=
754 comp_def
->base_component ();
756 if (CORBA::is_nil (comp_base
.in ()))
760 ACE_DEBUG ((LM_DEBUG
,
761 "component_inheritance_test: "
762 "base component is null\n"));
768 CORBA::String_var str
= comp_base
->id ();
770 if (str
.in () == 0 || ACE_OS::strcmp (str
.in (), COMP_BASE_ID
) != 0)
774 ACE_DEBUG ((LM_DEBUG
,
775 "component_inheritance_test: "
776 "bad id on base component\n"));
782 CORBA::InterfaceDefSeq_var supported
=
783 comp_base
->supported_interfaces ();
785 CORBA::ULong length
= supported
->length ();
787 if (length
!= COMP_SUPPORTED_LEN
)
791 ACE_DEBUG ((LM_DEBUG
,
792 "component_inheritance_test: "
793 "wrong number of supported interfaces\n"));
799 for (CORBA::ULong i
= 0; i
< length
; ++i
)
801 str
= supported
[i
]->id ();
804 || ACE_OS::strcmp (str
.in (), COMP_SUPPORTED_IDS
[i
]) != 0)
808 ACE_DEBUG ((LM_DEBUG
,
809 "component_inheritance_test: "
810 "bad id on supported interface #%d\n",
822 IDL3_Client::component_port_test (
823 CORBA::ComponentIR::ComponentDef_var
&comp_def
)
825 CORBA::Contained::Description_var desc
=
826 comp_def
->describe ();
828 const CORBA::ComponentIR::ComponentDescription
*cd
= 0;
830 if ((desc
->value
>>= cd
) == 0)
834 ACE_DEBUG ((LM_DEBUG
,
835 "component_port_test: "
836 "Any extraction of component description failed\n"));
842 int status
= this->provides_test (cd
->provided_interfaces
);
849 status
= this->uses_test (cd
->used_interfaces
);
856 status
= this->event_port_test (cd
->emits_events
,
867 status
= this->event_port_test (cd
->publishes_events
,
878 status
= this->event_port_test (cd
->consumes_events
,
893 IDL3_Client::provides_test (const CORBA::ComponentIR::ProvidesDescriptionSeq
&pds
)
895 if (pds
.length () != PROVIDES_LEN
)
899 ACE_DEBUG ((LM_DEBUG
,
901 "wrong number of provides interfaces\n"));
909 for (CORBA::ULong i
= 0; i
< PROVIDES_LEN
; ++i
)
911 tmp
= pds
[i
].name
.in ();
913 if (tmp
== 0 || ACE_OS::strcmp (tmp
, PROVIDES_NAMES
[i
]) != 0)
917 ACE_DEBUG ((LM_DEBUG
,
919 "wrong local name for provides #%d\n",
926 tmp
= pds
[i
].interface_type
.in ();
928 if (tmp
== 0 || ACE_OS::strcmp (tmp
, PROVIDES_TYPE_IDS
[i
]) != 0)
932 ACE_DEBUG ((LM_DEBUG
,
934 "wrong base interface type id for provides #%d\n",
946 IDL3_Client::uses_test (const CORBA::ComponentIR::UsesDescriptionSeq
&uds
)
948 if (uds
.length () != USES_LEN
)
952 ACE_DEBUG ((LM_DEBUG
,
954 "wrong number of uses interfaces\n"));
961 CORBA::Boolean mult
= 0;
963 for (CORBA::ULong i
= 0; i
< USES_LEN
; ++i
)
965 tmp
= uds
[i
].name
.in ();
967 if (tmp
== 0 || ACE_OS::strcmp (tmp
, USES_NAMES
[i
]) != 0)
971 ACE_DEBUG ((LM_DEBUG
,
973 "wrong local name for uses #%d\n",
980 tmp
= uds
[i
].interface_type
.in ();
982 if (tmp
== 0 || ACE_OS::strcmp (tmp
, USES_TYPE_IDS
[i
]) != 0)
986 ACE_DEBUG ((LM_DEBUG
,
988 "wrong base interface type id for uses #%d\n",
995 mult
= uds
[i
].is_multiple
;
997 if (mult
!= USES_MULTIPLE_FLAGS
[i
])
1001 ACE_DEBUG ((LM_DEBUG
,
1003 "wrong is_multiple value for uses #%d\n",
1015 IDL3_Client::event_port_test (const CORBA::ComponentIR::EventPortDescriptionSeq
&eds
,
1016 CORBA::ULong seq_length
,
1017 const char *port_type
,
1021 if (eds
.length () != seq_length
)
1025 ACE_DEBUG ((LM_DEBUG
,
1027 "wrong number of event %C ports\n",
1034 const char *tmp
= 0;
1036 for (CORBA::ULong i
= 0; i
< seq_length
; ++i
)
1038 tmp
= eds
[i
].name
.in ();
1040 if (tmp
== 0 || ACE_OS::strcmp (tmp
, names
[i
]) != 0)
1044 ACE_DEBUG ((LM_DEBUG
,
1046 "wrong local name for %C port #%d\n",
1054 tmp
= eds
[i
].event
.in ();
1056 if (tmp
== 0 || ACE_OS::strcmp (tmp
, ids
[i
]) != 0)
1060 ACE_DEBUG ((LM_DEBUG
,
1062 "wrong base event type id for %C port #%d\n",
1075 IDL3_Client::valuetype_inheritance_test (CORBA::ExtValueDef_var
&vd
,
1078 CORBA::ValueDef_var bvd
= vd
->base_value ();
1080 if (CORBA::is_nil (bvd
.in ()))
1084 ACE_DEBUG ((LM_DEBUG
,
1085 "%Ctype_inheritance_test: "
1086 "base valuetype is null\n",
1093 CORBA::String_var str
= bvd
->id ();
1095 if (str
.in () == 0 || ACE_OS::strcmp (str
.in (), VT_BASE_ID
) != 0)
1099 ACE_DEBUG ((LM_DEBUG
,
1100 "%Ctype_inheritance_test: "
1101 "wrong repo id for base valuetype\n",
1108 CORBA::InterfaceDefSeq_var supported
=
1109 vd
->supported_interfaces ();
1111 CORBA::ULong length
= supported
->length ();
1113 if (length
!= VT_SUPPORTED_LEN
)
1117 ACE_DEBUG ((LM_DEBUG
,
1118 "%Ctype_inheritance_test: "
1119 "wrong number of supported interfaces\n",
1126 for (CORBA::ULong i
= 0; i
< length
; ++i
)
1128 str
= supported
[i
]->id ();
1131 || ACE_OS::strcmp (str
.in (), VT_SUPPORTED_IDS
[i
]) != 0)
1135 ACE_DEBUG ((LM_DEBUG
,
1136 "%Ctype_inheritance_test: "
1137 "bad id on supported interface #%d\n",
1150 IDL3_Client::valuetype_attribute_test (
1151 CORBA::ExtValueDef::ExtFullValueDescription_var
&desc
,
1154 if (desc
->attributes
.length () != ATTRS_LEN
)
1158 ACE_DEBUG ((LM_DEBUG
,
1159 "%Ctype_attribute_test: wrong number of attrs\n",
1166 const char *tmp
= 0;
1168 for (CORBA::ULong i
= 0; i
< ATTRS_LEN
; ++i
)
1170 tmp
= desc
->attributes
[i
].name
.in ();
1172 if (tmp
== 0 || ACE_OS::strcmp (tmp
, ATTR_LOCAL_NAMES
[i
]) != 0)
1176 ACE_DEBUG ((LM_DEBUG
,
1177 "%Ctype_attribute_test: "
1178 "wrong local name for attribute #%d\n",
1186 CORBA::TCKind kind
=
1187 desc
->attributes
[i
].type
->kind ();
1189 if (kind
!= ATTR_TC_KINDS
[i
])
1193 ACE_DEBUG ((LM_DEBUG
,
1194 "%Ctype_attribute_test: "
1195 "wrong TCKind for attribute #%d\n",
1203 if (desc
->attributes
[i
].get_exceptions
.length () != GET_EXCEP_LEN
[i
])
1207 ACE_DEBUG ((LM_DEBUG
,
1208 "%Ctype_attribute_test: "
1209 "wrong number of get-exceptions"
1210 " for attribute #%d\n",
1218 if (desc
->attributes
[i
].put_exceptions
.length () != PUT_EXCEP_LEN
[i
])
1222 ACE_DEBUG ((LM_DEBUG
,
1223 "%Ctype_attribute_test: "
1224 "wrong number of put-exceptions"
1225 " for attribute #%d\n",
1238 IDL3_Client::valuetype_operation_test (
1239 CORBA::ExtValueDef::ExtFullValueDescription_var
&desc
,
1243 CORBA::ULong ops_length
= desc
->operations
.length ();
1245 if (ops_length
!= OPS_LEN
)
1249 ACE_DEBUG ((LM_DEBUG
,
1250 "%Ctype_operation_test: "
1251 "wrong number of operations\n",
1258 const char *tmp
= 0;
1260 CORBA::ULong length
= 0;
1262 for (CORBA::ULong i
= 0; i
< ops_length
; ++i
)
1264 tmp
= desc
->operations
[i
].name
.in ();
1266 if (tmp
== 0 || ACE_OS::strcmp (tmp
, OP_NAMES
[i
]) != 0)
1270 ACE_DEBUG ((LM_DEBUG
,
1271 "%Ctype_operation_test: "
1272 "wrong name for operation #%d\n",
1280 CORBA::TCKind ret_kind
=
1281 desc
->operations
[i
].result
.in ()->kind ();
1283 if (ret_kind
!= OP_RET_KINDS
[i
])
1287 ACE_DEBUG ((LM_DEBUG
,
1288 "%Ctype_operation_test: "
1289 "wrong return type\n",
1296 length
= desc
->operations
[i
].parameters
.length ();
1298 if (length
!= PARAMS_LEN
[i
])
1302 ACE_DEBUG ((LM_DEBUG
,
1303 "%Ctype_operation_test: "
1304 "wrong number of parameters in operation #%d\n",
1312 for (j
= 0; j
< length
; ++j
)
1314 tmp
= desc
->operations
[i
].parameters
[j
].name
.in ();
1316 if (tmp
== 0 || ACE_OS::strcmp (tmp
, PARAM_NAMES
[j
]) != 0)
1320 ACE_DEBUG ((LM_DEBUG
,
1321 "%Ctype_operation_test: "
1322 "wrong name for operation #%d,"
1333 length
= desc
->operations
[i
].exceptions
.length ();
1335 if (length
!= OP_EXCEP_LEN
[i
])
1339 ACE_DEBUG ((LM_DEBUG
,
1340 "%Ctype_operation_test: "
1341 "wrong number of exceptions in operation #%d\n",
1354 IDL3_Client::valuetype_member_test (
1355 CORBA::ExtValueDef::ExtFullValueDescription_var
&desc
,
1358 CORBA::ULong length
= desc
->members
.length ();
1360 if (length
!= MEM_LEN
)
1364 ACE_DEBUG ((LM_DEBUG
,
1365 "%Ctype_member_test: "
1366 "wrong number of members\n",
1373 const char *tmp
= 0;
1375 for (CORBA::ULong i
= 0; i
< length
; ++i
)
1377 if (desc
->members
[i
].access
!= MEM_VIS
[i
])
1381 ACE_DEBUG ((LM_DEBUG
,
1382 "%Ctype_member_test: "
1383 "wrong access value in member #%d\n",
1391 tmp
= desc
->members
[i
].name
.in ();
1393 if (tmp
== 0 || ACE_OS::strcmp (tmp
, MEM_NAMES
[i
]) != 0)
1397 ACE_DEBUG ((LM_DEBUG
,
1398 "%Ctype_member_test: "
1399 "wrong repo id for member #%d\n",
1412 IDL3_Client::valuetype_factory_test (
1413 CORBA::ExtValueDef::ExtFullValueDescription_var
&desc
,
1416 CORBA::ULong length
= desc
->initializers
.length ();
1418 if (length
!= FACTORY_LEN
)
1422 ACE_DEBUG ((LM_DEBUG
,
1423 "%Ctype_factory_test: "
1424 "wrong number of factories\n",
1431 CORBA::ULong inside_len
= 0;
1432 const char *tmp
= 0;
1434 for (CORBA::ULong i
= 0; i
< FACTORY_LEN
; ++i
)
1436 inside_len
= desc
->initializers
[i
].members
.length ();
1438 if (inside_len
!= VT_FACTORY_PARAM_LENS
[i
])
1442 ACE_DEBUG ((LM_DEBUG
,
1443 "%Ctype_factory_test: "
1444 "wrong number of params in factory #%d\n",
1454 for (j
= 0; j
< VT_FACTORY_PARAM_LENS
[i
]; ++j
)
1456 tmp
= desc
->initializers
[i
].members
[j
].name
.in ();
1459 || ACE_OS::strcmp (tmp
, VT_FACTORY_PARAM_NAMES
[i
][j
]) != 0)
1463 ACE_DEBUG ((LM_DEBUG
,
1464 "%Ctype_factory_test: "
1465 "wrong name for arg #%d in factory #%d\n",
1475 inside_len
= desc
->initializers
[i
].exceptions
.length ();
1477 if (inside_len
!= VT_FACTORY_EXCEP_LENS
[i
])
1481 ACE_DEBUG ((LM_DEBUG
,
1482 "%Ctype_factory_test: "
1483 "wrong number of exceptions in factory #%d\n",
1491 for (j
= 0; j
< VT_FACTORY_EXCEP_LENS
[i
]; ++j
)
1493 tmp
= desc
->initializers
[i
].exceptions
[j
].name
.in ();
1496 || ACE_OS::strcmp (tmp
, VT_FACTORY_EXCEP_NAMES
[i
][j
]) != 0)
1500 ACE_DEBUG ((LM_DEBUG
,
1501 "%Ctype_factory_test: "
1502 "wrong name for exception #%d in factory #%d\n",
1517 IDL3_Client::home_inheritance_test (CORBA::ComponentIR::HomeDef_var
&hd
)
1519 CORBA::ComponentIR::HomeDef_var bhd
=
1522 if (CORBA::is_nil (bhd
.in ()))
1526 ACE_DEBUG ((LM_DEBUG
,
1527 "home_inheritance_test: "
1528 "base home is null\n"));
1534 CORBA::String_var str
= bhd
->id ();
1536 if (str
.in () == 0 || ACE_OS::strcmp (str
.in (), HOME_BASE_ID
) != 0)
1540 ACE_DEBUG ((LM_DEBUG
,
1541 "home_inheritance_test: "
1542 "wrong repo id for base home\n"));
1548 CORBA::InterfaceDefSeq_var supported
=
1549 bhd
->supported_interfaces ();
1551 CORBA::ULong length
= supported
->length ();
1553 if (length
!= HOME_SUPPORTED_LEN
)
1557 ACE_DEBUG ((LM_DEBUG
,
1558 "home_inheritance_test: "
1559 "wrong number of supported interfaces\n"));
1565 for (CORBA::ULong i
= 0; i
< length
; ++i
)
1567 str
= supported
[i
]->id ();
1570 || ACE_OS::strcmp (str
.in (), HOME_SUPPORTED_IDS
[i
]) != 0)
1574 ACE_DEBUG ((LM_DEBUG
,
1575 "home_inheritance_test: "
1576 "bad id on supported interface #%d\n",
1588 IDL3_Client::home_factory_test (const CORBA::ComponentIR::HomeDescription
*hd
)
1590 CORBA::ULong length
= hd
->factories
.length ();
1592 if (length
!= HOME_FACTORY_LEN
)
1596 ACE_DEBUG ((LM_DEBUG
,
1597 "home_factory_test: "
1598 "wrong number of factories\n"));
1604 CORBA::ULong inside_len
= 0;
1606 const char *tmp
= 0;
1608 for (CORBA::ULong i
= 0; i
< HOME_FACTORY_LEN
; ++i
)
1610 inside_len
= hd
->factories
[i
].parameters
.length ();
1612 if (inside_len
!= HOME_FACTORY_PARAM_LENS
[i
])
1616 ACE_DEBUG ((LM_DEBUG
,
1617 "home_factory_test: "
1618 "wrong number of params in factory #%d\n",
1625 for (j
= 0; j
< inside_len
; ++j
)
1627 tmp
= hd
->factories
[i
].parameters
[j
].name
.in ();
1630 || ACE_OS::strcmp (tmp
, HOME_FACTORY_PARAM_NAMES
[i
][j
]) != 0)
1634 ACE_DEBUG ((LM_DEBUG
,
1635 "home_factory_test: "
1636 "wrong name for param #%d in factory #%d\n",
1645 inside_len
= hd
->factories
[i
].exceptions
.length ();
1647 if (inside_len
!= HOME_FACTORY_EXCEP_LENS
[i
])
1651 ACE_DEBUG ((LM_DEBUG
,
1652 "home_factory_test: "
1653 "wrong number of exceptions in factory #%d\n",
1660 for (j
= 0; j
< inside_len
; ++j
)
1662 tmp
= hd
->factories
[i
].exceptions
[j
].name
.in ();
1665 || ACE_OS::strcmp (tmp
, HOME_FACTORY_EXCEP_NAMES
[i
][j
]) != 0)
1669 ACE_DEBUG ((LM_DEBUG
,
1670 "home_factory_test: "
1671 "wrong name for exception #%d in factory #%d\n",
1685 IDL3_Client::home_finder_test (const CORBA::ComponentIR::HomeDescription
*hd
)
1687 CORBA::ULong length
= hd
->finders
.length ();
1689 if (length
!= HOME_FINDER_LEN
)
1693 ACE_DEBUG ((LM_DEBUG
,
1694 "home_finder_test: "
1695 "wrong number of finders\n"));
1701 CORBA::ULong inside_len
= 0;
1703 const char *tmp
= 0;
1705 for (CORBA::ULong i
= 0; i
< HOME_FINDER_LEN
; ++i
)
1707 inside_len
= hd
->finders
[i
].parameters
.length ();
1709 if (inside_len
!= HOME_FINDER_PARAM_LENS
[i
])
1713 ACE_DEBUG ((LM_DEBUG
,
1714 "home_finder_test: "
1715 "wrong number of params in finder #%d\n",
1722 for (j
= 0; j
< inside_len
; ++j
)
1724 tmp
= hd
->finders
[i
].parameters
[j
].name
.in ();
1727 || ACE_OS::strcmp (tmp
, HOME_FINDER_PARAM_NAMES
[i
][j
]) != 0)
1731 ACE_DEBUG ((LM_DEBUG
,
1732 "home_finder_test: "
1733 "wrong name for param #%d in finder #%d\n",
1742 inside_len
= hd
->finders
[i
].exceptions
.length ();
1744 if (inside_len
!= HOME_FINDER_EXCEP_LENS
[i
])
1748 ACE_DEBUG ((LM_DEBUG
,
1749 "home_finder_test: "
1750 "wrong number of exceptions in finder #%d\n",
1757 for (j
= 0; j
< inside_len
; ++j
)
1759 tmp
= hd
->finders
[i
].exceptions
[j
].name
.in ();
1762 || ACE_OS::strcmp (tmp
, HOME_FINDER_EXCEP_NAMES
[i
][j
]) != 0)
1766 ACE_DEBUG ((LM_DEBUG
,
1767 "home_finder_test: "
1768 "wrong name for exception #%d in finder #%d\n",