2 //=============================================================================
6 * Verify that the basic typecodes are able to interpret their CDR
9 * @author Carlos O'Ryan
11 //=============================================================================
14 #include "tao/AnyTypeCode/TypeCode.h"
15 #include "tao/AnyTypeCode/TypeCode_Constants.h"
17 #include "tao/SystemException.h"
18 #include "tao/debug.h"
20 #include "ace/Log_Msg.h"
22 // In this version of TAO typecodes are based on CDR, we have to
23 // verify that CDR offers the services needed for Typecode...
25 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
29 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
31 static const CORBA::TypeCode_ptr tcs
[]=
52 // CORBA::_tc_sequence,
58 CORBA::_tc_longdouble
,
65 CORBA::_tc_COMM_FAILURE
,
66 CORBA::_tc_INV_OBJREF
,
67 CORBA::_tc_OBJECT_NOT_EXIST
,
68 CORBA::_tc_NO_PERMISSION
,
71 CORBA::_tc_INITIALIZE
,
72 CORBA::_tc_NO_IMPLEMENT
,
73 CORBA::_tc_BAD_TYPECODE
,
74 CORBA::_tc_BAD_OPERATION
,
75 CORBA::_tc_NO_RESOURCES
,
76 CORBA::_tc_NO_RESPONSE
,
77 CORBA::_tc_PERSIST_STORE
,
78 CORBA::_tc_BAD_INV_ORDER
,
83 CORBA::_tc_INTF_REPOS
,
84 CORBA::_tc_BAD_CONTEXT
,
85 CORBA::_tc_OBJ_ADAPTER
,
86 CORBA::_tc_DATA_CONVERSION
,
87 CORBA::TypeCode::_tc_Bounds
,
88 CORBA::TypeCode::_tc_BadKind
91 static int n
= sizeof (tcs
) / sizeof (tcs
[0]);
93 for (const CORBA::TypeCode_ptr
*i
= tcs
;
97 CORBA::TypeCode_ptr tc
= *i
;
99 CORBA::TCKind k
= tc
->kind ();
103 case CORBA::tk_objref
:
104 case CORBA::tk_struct
:
105 case CORBA::tk_union
:
107 case CORBA::tk_alias
:
108 case CORBA::tk_except
:
110 const char *id
= tc
->id ();
112 const char *name
= tc
->name ();
114 CORBA::ULong length
= 0;
116 if (TAO_debug_level
> 0)
118 ACE_DEBUG ((LM_DEBUG
,
125 (name
?name
:"empty name"),
132 if (TAO_debug_level
> 0)
134 ACE_DEBUG ((LM_DEBUG
,
142 catch (const CORBA::Exception
& ex
)
144 ex
._tao_print_exception ("TC");