Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_2795_Regression / client.cpp
blobd7dd902e7b9cf6f99958a5f2dfa991e492f1c377
1 #include "tao/ORB_Core.h"
2 #include "tao/StringSeqC.h"
4 void
5 StringOutTest (CORBA::String_out so)
7 CORBA::String_var sv;
8 sv = "StringOutTest";
9 so = sv._retn ();
12 void
13 StringInoutTest (char *& so)
15 CORBA::string_free (so);
16 so = CORBA::string_dup ("StringInoutTest");
19 int
20 ACE_TMAIN(int argc, ACE_TCHAR *argv[])
22 try
24 CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
26 CORBA::StringSeq ts;
27 ts.length (1);
28 ts[0] = CORBA::string_dup ("Hello World");
30 StringOutTest (ts[0].out());
31 ACE_ASSERT (ACE_OS::strcmp (ts[0].in(), "StringOutTest") == 0);
33 StringInoutTest (ts[0].inout());
34 ACE_ASSERT (ACE_OS::strcmp (ts[0].in(), "StringInoutTest") == 0);
36 CORBA::String_var sv = ts[0]._retn ();
37 ACE_ASSERT (ACE_OS::strcmp (ts[0].in(), "") == 0);
39 ts[0] = CORBA::string_dup ("Hello Again");
41 catch (const CORBA::Exception &ex)
43 ACE_ERROR ((LM_ERROR, "Exception caught: %s\"%s\"\n"
44 , ex._name(), ex._rep_id ()));
45 return 1;
48 return 0;
50 return 0;