Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / AMI / ami_test_i.cpp
blobce59c0ad3d769bc4aec76ac6ed52d1e4f72f373b
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 //=============================================================================
13 #include "ami_test_i.h"
14 #include "tao/debug.h"
16 AMI_Test_i::AMI_Test_i (CORBA::ORB_ptr orb,
17 CORBA::Long in_l,
18 const char * in_str,
19 bool check_params)
20 : orb_ (CORBA::ORB::_duplicate (orb)),
21 number_ ((CORBA::Long) 931232),
22 yadda_ ((CORBA::Long) 140474),
23 in_l_ (in_l),
24 in_str_(CORBA::string_dup(in_str)),
25 check_params_(check_params)
29 CORBA::Long
30 AMI_Test_i::foo (CORBA::Long_out out_l,
31 CORBA::Long in_l,
32 const char* in_str)
34 out_l = 931233;
36 //if (TAO_debug_level > 0)
37 ACE_DEBUG ((LM_DEBUG,
38 "%N:%l:(%P:%t):AMI_Test_i::foo: %d %C\n",
39 in_l,
40 in_str));
42 if (in_l == 0)
44 ACE_DEBUG ((LM_DEBUG,
45 "Throwing Exception: A::DidTheRightThing\n"));
46 throw A::DidTheRightThing(42, "Hello world");
49 if (check_params_)
51 if (in_l_ != in_l || ACE_OS::strcmp(in_str_.in (), in_str) != 0)
53 ACE_ERROR ((LM_ERROR,
54 "ERROR: Parameter corruption on in parameters: %d %d %C %C.\n",
55 in_l_, in_l, in_str_.in (), in_str));
56 return 0;
60 return 931234;
63 void
64 AMI_Test_i::shutdown (void)
66 this->orb_->shutdown (0);
69 CORBA::Long
70 AMI_Test_i::yadda (void)
72 ACE_DEBUG ((LM_DEBUG,
73 "%N:%l:(%P:%t):AMI_Test_i::(get_)yadda\n"));
74 return yadda_;
77 void
78 AMI_Test_i::yadda (CORBA::Long yadda)
80 ACE_DEBUG ((LM_DEBUG,
81 "%N:%l:(%P:%t):AMI_Test_i::(set_)yadda\n"));
82 yadda_ = yadda;
85 void
86 AMI_Test_i::inout_arg_test (char *&)
88 // No action, this operation is to test code generation for INOUT
89 // args in AMI operations.