diff options
Diffstat (limited to 'CIAO/tests/IDL3/Events/Any/main.cpp')
-rw-r--r-- | CIAO/tests/IDL3/Events/Any/main.cpp | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/CIAO/tests/IDL3/Events/Any/main.cpp b/CIAO/tests/IDL3/Events/Any/main.cpp deleted file mode 100644 index 39811f17525..00000000000 --- a/CIAO/tests/IDL3/Events/Any/main.cpp +++ /dev/null @@ -1,84 +0,0 @@ -#include "EventAnyC.h" -#include "ace/Get_Opt.h" - -void -insert_into_any (CORBA::Any& any, Components::EventBase* vb) -{ - any <<= vb; -} - -void -debug_msg (const char *msg) -{ - ACE_ERROR ((LM_ERROR, "Error: %s\n", msg)); -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY - { - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, ""); - StringMsg_init *StringMsg_factory = new StringMsg_init; - - orb->register_value_factory (StringMsg_factory->tao_repository_id (), - StringMsg_factory); - StringMsg_factory->_remove_ref (); // release ownership - - const char *test_str = "a message"; - - StringMsg_var ev = new OBV_StringMsg; - ev->str_msg (test_str); - - CORBA::Any in_any; - insert_into_any (in_any, ev.in ()); - - TAO_OutputCDR out; - CORBA::Boolean good = out << in_any; - - if (!good) - { - debug_msg ("Any marshaling failed"); - return -1; - } - - TAO_InputCDR in (out); - CORBA::Any out_any; - good = in >> out_any; - - if (!good) - { - debug_msg ("Any demarshaling failed"); - return -1; - } - - StringMsg *ev_out = 0; - good = out_any >>= ev_out; - - if (!good) - { - debug_msg ("Any extraction failed"); - return -1; - } - - const char *result_str = ev_out->str_msg (); - - if (result_str == 0 || ACE_OS::strcmp (result_str, test_str) != 0) - { - debug_msg ("Extracted member string null or incorrect"); - return -1; - } - - orb->destroy (); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "caught exception:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} - |