Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / Bug_2595_Regression / client.cpp
blob1ed1cca0704a66df007cbe53f28ea3761bfa87b8
1 #include "TestC.h"
2 #include "ace/Get_Opt.h"
4 const ACE_TCHAR *ior = ACE_TEXT("file://test.ior");
6 int
7 parse_args (int argc, ACE_TCHAR *argv[])
9 ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:"));
10 int c;
12 while ((c = get_opts ()) != -1)
13 switch (c)
15 case 'k':
16 ior = get_opts.opt_arg ();
17 break;
19 case '?':
20 default:
21 ACE_ERROR_RETURN ((LM_ERROR,
22 "usage: %s "
23 "-k <ior> "
24 "\n",
25 argv [0]),
26 -1);
28 // Indicates successful parsing of the command line
29 return 0;
32 void get_stringList2(Test::Hello_var hello);
34 int
35 ACE_TMAIN(int argc, ACE_TCHAR *argv[])
37 try
39 CORBA::ORB_var orb =
40 CORBA::ORB_init (argc, argv);
42 if (parse_args (argc, argv) != 0)
43 return 1;
45 CORBA::Object_var tmp =
46 orb->string_to_object(ior);
48 Test::Hello_var hello =
49 Test::Hello::_narrow(tmp.in ());
51 if (CORBA::is_nil (hello.in ()))
53 ACE_ERROR_RETURN ((LM_DEBUG,
54 "Nil Test::Hello reference <%s>\n",
55 ior),
56 1);
59 Test::Fls_var fstruct;
60 Test::Vls_var vstruct;
62 ACE_DEBUG ((LM_DEBUG, "\n(%P|%t) - op test 1\n"));
63 hello->op(fstruct.out(), vstruct.out());
65 ACE_DEBUG ((LM_DEBUG, "\n(%P|%t) - op test 2\n"));
66 hello->op(fstruct, vstruct.out());
68 hello->shutdown ();
70 orb->destroy ();
72 catch (const CORBA::Exception& ex)
74 ex._tao_print_exception ("Exception caught:");
75 return 1;
78 return 0;