More tests update
[ACE_TAO.git] / TAO / tests / Bug_3567_Regression / ami_test_i.cpp
blob7be98ff1a7257733ed60e87ebef34153d3507634
2 //=============================================================================
3 /**
4 * @file ami_test_i.cpp
6 * Implementation of the AMI Test interface.
8 * @author Alexander Babu Arulanthu <alex@cs.wustl.edu>
9 * @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
11 //=============================================================================
14 #include "ami_test_i.h"
15 #include "tao/debug.h"
16 #include "ace/OS_NS_unistd.h"
18 AMI_Test_i::AMI_Test_i (CORBA::ORB_ptr orb,
19 CORBA::Long in_l,
20 const char * in_str,
21 bool check_params)
22 : orb_ (CORBA::ORB::_duplicate (orb)),
23 number_ ((CORBA::Long) 931232),
24 yadda_ ((CORBA::Long) 140474),
25 in_l_ (in_l),
26 in_str_(CORBA::string_dup(in_str)),
27 check_params_(check_params)
31 CORBA::Long
32 AMI_Test_i::foo (CORBA::Long_out out_l,
33 CORBA::Long in_l,
34 const char* in_str)
36 out_l = 931233;
38 //if (TAO_debug_level > 0)
39 ACE_DEBUG ((LM_DEBUG,
40 "%N:%l:(%P:%t):AMI_Test_i::foo: %d %C\n",
41 in_l,
42 in_str));
44 if (in_l == 0)
46 ACE_DEBUG ((LM_DEBUG,
47 "Throwing Exception: A::DidTheRightThing\n"));
48 throw A::DidTheRightThing(42, "Hello world");
51 if (check_params_)
53 if (in_l_ != in_l || ACE_OS::strcmp(in_str_.in (), in_str) != 0)
55 ACE_ERROR ((LM_ERROR,
56 "ERROR: Parameter corruption on in parameters: %d %d %C %C.\n",
57 in_l_, in_l, in_str_.in (), in_str));
58 return 0;
61 ACE_OS::sleep (1);
62 return 931234;
65 void
66 AMI_Test_i::shutdown (void)
68 this->orb_->shutdown (0);
72 CORBA::Long
73 AMI_Test_i::yadda (void)
75 ACE_DEBUG ((LM_DEBUG,
76 "%N:%l:(%P:%t):AMI_Test_i::(get_)yadda\n"));
77 return yadda_;
81 void
82 AMI_Test_i::yadda (CORBA::Long yadda)
84 ACE_DEBUG ((LM_DEBUG,
85 "%N:%l:(%P:%t):AMI_Test_i::(set_)yadda\n"));
86 yadda_ = yadda;
89 void
90 AMI_Test_i::inout_arg_test (char *&)
92 // No action, this operation is to test code generation for INOUT
93 // args in AMI operations.