1 // This is a simple test of an ImR using the corba interfaces
5 #include "ace/SString.h"
6 #include "ace/Log_Msg.h"
7 #include "ace/OS_NS_stdio.h"
11 #define assertTrue(CONDITION) \
13 ACE_CString str ("Error : "#CONDITION" :"); \
15 ACE_OS::sprintf (line, "%d", __LINE__); \
16 throw std::runtime_error (str.c_str ()); \
19 using namespace CORBA
;
22 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
27 ORB_var orb
= ORB_init (argc
, argv
);
29 Object_var obj
= orb
->resolve_initial_references ("Test");
30 test_var test
= test::_narrow (obj
.in ());
31 assertTrue (!is_nil (test
.in ()));
33 Long n
= test
->get ();
34 Long m
= test
->get ();
35 assertTrue (m
== (n
+ 1));
37 ACE_DEBUG ((LM_DEBUG
, "All tests ran successfully.\n"));
41 catch (const CORBA::Exception
& e
)
43 e
._tao_print_exception ("test:");