diff options
author | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-25 18:17:52 +0000 |
---|---|---|
committer | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-25 18:17:52 +0000 |
commit | 2ee7b7eed4c0cc10f4ec25b186b04202af01b565 (patch) | |
tree | 08a8a649c90559cf5b2228c1caad15515902613e /TAO/tests/Any | |
parent | c979767a00db4ea1299af482033a68829cc16675 (diff) | |
download | ATCD-2ee7b7eed4c0cc10f4ec25b186b04202af01b565.tar.gz |
ChangeLogTag: Thu Jan 25 17:39:59 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/tests/Any')
-rw-r--r-- | TAO/tests/Any/Recursive/client.cpp | 115 | ||||
-rw-r--r-- | TAO/tests/Any/Recursive/server.cpp | 18 |
2 files changed, 49 insertions, 84 deletions
diff --git a/TAO/tests/Any/Recursive/client.cpp b/TAO/tests/Any/Recursive/client.cpp index 1f0ca96671d..a9e1e860ca3 100644 --- a/TAO/tests/Any/Recursive/client.cpp +++ b/TAO/tests/Any/Recursive/client.cpp @@ -111,20 +111,18 @@ dump<Test::RecursiveUnion> (Test::RecursiveUnion * data) template<typename T> void perform_invocation (Test::Hello_ptr hello, - CORBA::Any const & the_any - ACE_ENV_ARG_DECL) + CORBA::Any const & the_any) { // Execute more than once to help verify that mutable recursive // TypeCode state is managed correctly. for (unsigned int n = 0; n < 2; ++n) { CORBA::Any_var my_any = - hello->get_any (the_any - ACE_ENV_ARG_PARAMETER); + hello->get_any (the_any); T * my_foo = 0; if (!(my_any.in () >>= my_foo)) - ACE_THROW (Test::Demarshaling_From_Any_Failed ()); + throw Test::Demarshaling_From_Any_Failed (); // ACE_DEBUG ((LM_DEBUG, "Data dump:\n")); // dump<T> (my_foo); @@ -133,25 +131,22 @@ perform_invocation (Test::Hello_ptr hello, CORBA::TypeCode_var my_tc = my_any->type (); CORBA::Boolean const equal_tc = - the_tc->equal (my_tc.in () - ACE_ENV_ARG_PARAMETER); + the_tc->equal (my_tc.in ()); if (!equal_tc) - ACE_THROW (Test::Recursive_Type_In_Any_Test_Failed ()); + throw Test::Recursive_Type_In_Any_Test_Failed (); CORBA::Boolean const equiv_tc = - the_tc->equivalent (my_tc.in () - ACE_ENV_ARG_PARAMETER); + the_tc->equivalent (my_tc.in ()); if (!equiv_tc) - ACE_THROW (Test::Recursive_Type_In_Any_Test_Failed ()); + throw Test::Recursive_Type_In_Any_Test_Failed (); } } void recursive_struct_test (CORBA::ORB_ptr /* orb */, - Test::Hello_ptr hello - ACE_ENV_ARG_DECL) + Test::Hello_ptr hello) { ACE_DEBUG ((LM_INFO, "Executing recursive struct test\n")); @@ -167,14 +162,12 @@ recursive_struct_test (CORBA::ORB_ptr /* orb */, the_any <<= foo; ::perform_invocation<Test::RecursiveStruct> (hello, - the_any - ACE_ENV_ARG_PARAMETER); + the_any); } void nested_recursive_struct_test (CORBA::ORB_ptr /* orb */, - Test::Hello_ptr hello - ACE_ENV_ARG_DECL) + Test::Hello_ptr hello) { ACE_DEBUG ((LM_INFO, "Executing nested recursive struct test\n")); @@ -190,14 +183,12 @@ nested_recursive_struct_test (CORBA::ORB_ptr /* orb */, the_any <<= foo; ::perform_invocation<Test::NestedRecursiveStruct> (hello, - the_any - ACE_ENV_ARG_PARAMETER); + the_any); } void recursive_union_test (CORBA::ORB_ptr /* orb */, - Test::Hello_ptr hello - ACE_ENV_ARG_DECL) + Test::Hello_ptr hello) { ACE_DEBUG ((LM_INFO, "Executing recursive union test\n")); @@ -212,8 +203,7 @@ recursive_union_test (CORBA::ORB_ptr /* orb */, the_any <<= foo_enum; ::perform_invocation<Test::EnumUnion> (hello, - the_any - ACE_ENV_ARG_PARAMETER); + the_any); // Non-recursive member case. foo.i (test_long); @@ -221,8 +211,7 @@ recursive_union_test (CORBA::ORB_ptr /* orb */, the_any <<= foo; ::perform_invocation<Test::RecursiveUnion> (hello, - the_any - ACE_ENV_ARG_PARAMETER); + the_any); // Recursive member case. Test::RecursiveUnionSeq seq; @@ -235,8 +224,7 @@ recursive_union_test (CORBA::ORB_ptr /* orb */, the_any <<= foo; ::perform_invocation<Test::RecursiveUnion> (hello, - the_any - ACE_ENV_ARG_PARAMETER); + the_any); // Recursive member case with no default member Test::RecursiveUnionSeqNoDefault seqnodefault; @@ -250,8 +238,7 @@ recursive_union_test (CORBA::ORB_ptr /* orb */, the_any <<= foonodefault; ::perform_invocation<Test::RecursiveUnionNoDefault> (hello, - the_any - ACE_ENV_ARG_PARAMETER); + the_any); // Recursive member case with enum . Test::VSortRecursiveUnionSeq vsortseq; @@ -265,23 +252,20 @@ recursive_union_test (CORBA::ORB_ptr /* orb */, the_any <<= vsort_foo; ::perform_invocation<Test::VSortRecursiveUnion> (hello, - the_any - ACE_ENV_ARG_PARAMETER); + the_any); // Non-recursive member case with enum . Test::NonRecursiveUnionWithEnum val; the_any <<= val; ::perform_invocation<Test::NonRecursiveUnionWithEnum> (hello, - the_any - ACE_ENV_ARG_PARAMETER); + the_any); } void indirectly_recursive_valuetype_test (CORBA::ORB_ptr /* orb */, - Test::Hello_ptr /* hello */ - ACE_ENV_ARG_DECL_NOT_USED) + Test::Hello_ptr /* hello */) { ACE_DEBUG ((LM_INFO, "Executing indirectly recursive valuetype test\n")); @@ -292,8 +276,7 @@ indirectly_recursive_valuetype_test (CORBA::ORB_ptr /* orb */, void directly_recursive_valuetype_test (CORBA::ORB_ptr /* orb */, - Test::Hello_ptr /* hello */ - ACE_ENV_ARG_DECL_NOT_USED) + Test::Hello_ptr /* hello */) { ACE_DEBUG ((LM_INFO, "Executing directly recursive valuetype test\n")); @@ -306,8 +289,7 @@ directly_recursive_valuetype_test (CORBA::ORB_ptr /* orb */, void recursive_struct_typecodefactory_test (CORBA::ORB_ptr orb, - Test::Hello_ptr hello - ACE_ENV_ARG_DECL) + Test::Hello_ptr hello) { ACE_DEBUG ((LM_INFO, "Executing recursive struct via TypeCodeFactory test\n")); @@ -323,13 +305,11 @@ recursive_struct_typecodefactory_test (CORBA::ORB_ptr orb, the_any <<= foo; CORBA::TypeCode_var recursive_tc = - orb->create_recursive_tc ("IDL:Test/RecursiveStruct:1.0" - ACE_ENV_ARG_PARAMETER); + orb->create_recursive_tc ("IDL:Test/RecursiveStruct:1.0"); CORBA::TypeCode_var seq_tc = orb->create_sequence_tc (0, - recursive_tc.in () - ACE_ENV_ARG_PARAMETER); + recursive_tc.in ()); CORBA::StructMemberSeq members (3); members.length (3); @@ -343,23 +323,19 @@ recursive_struct_typecodefactory_test (CORBA::ORB_ptr orb, CORBA::TypeCode_var struct_tc = orb->create_struct_tc ("IDL:Test/RecursiveStruct:1.0", "RecursiveStruct", - members - ACE_ENV_ARG_PARAMETER); + members); // Reset the underlying TypeCode to the one we just created with the // TypeCodeFactory. - the_any.type (struct_tc.in () - ACE_ENV_ARG_PARAMETER); + the_any.type (struct_tc.in ()); ::perform_invocation<Test::RecursiveStruct> (hello, - the_any - ACE_ENV_ARG_PARAMETER); + the_any); } void recursive_union_typecodefactory_test (CORBA::ORB_ptr /* orb */, - Test::Hello_ptr /* hello */ - ACE_ENV_ARG_DECL_NOT_USED) + Test::Hello_ptr /* hello */) { ACE_DEBUG ((LM_INFO, "Executing recursive union via TypeCodeFactory test\n")); @@ -371,8 +347,7 @@ recursive_union_typecodefactory_test (CORBA::ORB_ptr /* orb */, void indirectly_recursive_valuetype_typecodefactory_test ( CORBA::ORB_ptr /* orb */, - Test::Hello_ptr /* hello */ - ACE_ENV_ARG_DECL_NOT_USED) + Test::Hello_ptr /* hello */) { ACE_DEBUG ((LM_INFO, "Executing indirectly recursive valuetype via " @@ -384,8 +359,7 @@ indirectly_recursive_valuetype_typecodefactory_test ( void directly_recursive_valuetype_typecodefactory_test (CORBA::ORB_ptr /* orb */, - Test::Hello_ptr /* hello */ - ACE_ENV_ARG_DECL_NOT_USED) + Test::Hello_ptr /* hello */) { ACE_DEBUG ((LM_INFO, "Executing directly recursive valuetype via " @@ -419,21 +393,17 @@ struct Caller : public std::unary_function<T, void> /// Function call operator overload. void operator() (T f) { - ACE_DECLARE_NEW_ENV; - ACE_TRY + try { f (orb.in (), - hello.in () - ACE_ENV_ARG_PARAMETER); + hello.in ()); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception thrown:"); + ex._tao_print_exception ("Exception thrown:"); success = false; } - ACE_ENDTRY; } CORBA::ORB_var orb; @@ -444,19 +414,19 @@ struct Caller : public std::unary_function<T, void> int main (int argc, char *argv[]) { - ACE_TRY_NEW_ENV + try { CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + CORBA::ORB_init (argc, argv, ""); if (parse_args (argc, argv) != 0) return 1; CORBA::Object_var tmp = - orb->string_to_object(ior ACE_ENV_ARG_PARAMETER); + orb->string_to_object(ior); Test::Hello_var hello = - Test::Hello::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER); + Test::Hello::_narrow(tmp.in ()); if (CORBA::is_nil (hello.in ())) { @@ -467,8 +437,7 @@ main (int argc, char *argv[]) } typedef void (*test_func) (CORBA::ORB_ptr, - Test::Hello_ptr - ACE_ENV_ARG_DECL); + Test::Hello_ptr); static test_func const tests[] = { @@ -495,19 +464,17 @@ main (int argc, char *argv[]) hello.in ())); if (!c.success) - ACE_TRY_THROW (Test::Recursive_Type_In_Any_Test_Failed ()); + throw Test::Recursive_Type_In_Any_Test_Failed (); hello->shutdown (); orb->destroy (); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught:"); + ex._tao_print_exception ("Exception caught:"); return 1; } - ACE_ENDTRY; return 0; } diff --git a/TAO/tests/Any/Recursive/server.cpp b/TAO/tests/Any/Recursive/server.cpp index 245c288e5c8..8c998950dd3 100644 --- a/TAO/tests/Any/Recursive/server.cpp +++ b/TAO/tests/Any/Recursive/server.cpp @@ -39,16 +39,16 @@ parse_args (int argc, char *argv[]) int main (int argc, char *argv[]) { - ACE_TRY_NEW_ENV + try { CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + CORBA::ORB_init (argc, argv, ""); CORBA::Object_var poa_object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); + orb->resolve_initial_references("RootPOA"); PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); + PortableServer::POA::_narrow (poa_object.in ()); if (CORBA::is_nil (root_poa.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -71,7 +71,7 @@ main (int argc, char *argv[]) hello_impl->_this (); CORBA::String_var ior = - orb->object_to_string (hello.in () ACE_ENV_ARG_PARAMETER); + orb->object_to_string (hello.in ()); // Output the IOR to the <ior_output_file> FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); @@ -89,17 +89,15 @@ main (int argc, char *argv[]) ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n")); - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); + root_poa->destroy (1, 1); orb->destroy (); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught:"); + ex._tao_print_exception ("Exception caught:"); return 1; } - ACE_ENDTRY; return 0; } |