diff options
author | gokhale <asgokhale@users.noreply.github.com> | 1997-08-10 14:27:23 +0000 |
---|---|---|
committer | gokhale <asgokhale@users.noreply.github.com> | 1997-08-10 14:27:23 +0000 |
commit | 5b6461dc187771cdef1d4936483b0187f14f4f21 (patch) | |
tree | 0fe082eeaca9c2e307b1a3441938377227261a82 /TAO/tests | |
parent | 80c1e04971df82da8c86b0e3ec5da4c33c8e9244 (diff) | |
download | ATCD-5b6461dc187771cdef1d4936483b0187f14f4f21.tar.gz |
Some modifications.
Diffstat (limited to 'TAO/tests')
-rw-r--r-- | TAO/tests/Cubit/TAO/clnt.cpp | 153 | ||||
-rw-r--r-- | TAO/tests/Cubit/TAO/cubitC.cpp | 73 | ||||
-rw-r--r-- | TAO/tests/Cubit/TAO/cubitC.h | 2 | ||||
-rw-r--r-- | TAO/tests/Cubit/TAO/cubit_i.cpp | 7 |
4 files changed, 235 insertions, 0 deletions
diff --git a/TAO/tests/Cubit/TAO/clnt.cpp b/TAO/tests/Cubit/TAO/clnt.cpp index 0539180c834..7b69594db87 100644 --- a/TAO/tests/Cubit/TAO/clnt.cpp +++ b/TAO/tests/Cubit/TAO/clnt.cpp @@ -497,6 +497,159 @@ main (int argc, char *argv[]) CORBA_release (objref); +<<<<<<< clnt.cpp + return (error_count == 0) ? 0 : 1; +} + +<<<<<<< clnt.cpp + +static void +cube_union_stub(unsigned i, + unsigned &call_count, + unsigned &error_count, + CORBA_Object_ptr objref, + CORBA_Environment &env) +{ + Cubit_ptr aCubit = Cubit::_narrow(objref); + // + // Cube a "union" ... + // + Cubit_oneof u, *r; + + call_count++; + + u._disc = e_2nd; + u.l = 3; + + r = aCubit->Cubit_cube_union (u, env); + if (env.exception () != 0) { + print_exception (env.exception (), "from cube_union"); + error_count++; + } else { + dmsg ("cube union ..."); + u.l = u.l * u.l * u.l ; + + if (u.l != r->l) { + ACE_OS::printf ("** cube_union_stub ERROR with discrim = e_2nd\n"); + error_count++; + } + + delete r; + } + + // + // Cube another "union" which uses the default arm ... + // + call_count++; + + u._disc = e_5th; + u.cm.l = func (i); + u.cm.s = func (i); + u.cm.o = func (i); + + u.cm.l = 7; + u.cm.s = 5; + u.cm.o = 3; + + r = aCubit->Cubit_cube_union (u, env); + if (env.exception () != 0) { + print_exception (env.exception (), "from cube_union"); + error_count++; + } else { + dmsg ("cube union ..."); + u.cm.l = u.cm.l * u.cm.l * u.cm.l; + u.cm.s = u.cm.s * u.cm.s * u.cm.s; + u.cm.o = u.cm.o * u.cm.o * u.cm.o; + + if (u.cm.l != r->cm.l + || u.cm.s != r->cm.s + || u.cm.o != r->cm.o) { + ACE_OS::printf ("** cube_union_stub ERROR with discrim = e_5th\n"); + error_count++; + } + + delete r; + } +======= return error_count == 0 ? 0 : 1; +>>>>>>> 1.5 +} + + +static void +cube_union_dii (unsigned &call_count, + unsigned &error_count, + CORBA_Object_ptr objref, + CORBA_Environment &env) +{ + // + // Create the request ... + // + CORBA_Request_ptr req; + + call_count++; + + req = objref->_request ((const CORBA_String) "cube_union", env); + if (env.exception () != 0) { + error_count++; + + print_exception (env.exception (), "cube_union_dii request create"); + return; + } + + // + // ... initialise the argument list and result ... + // + Cubit_oneof u, *r; + + u._disc = e_3rd; + u.cm.l = 5; + u.cm.s = -7; + u.cm.o = 3; + + CORBA_Any tmp_arg (TC_Cubit_oneof, &u, CORBA_B_FALSE); + + req->arguments ()->add_value (0, tmp_arg, CORBA_ARG_IN, env); + if (env.exception () != 0) { + error_count++; + print_exception (env.exception (), "cube_union_dii request arg add"); + CORBA_release (req); + return; + } + + req->result ()->value ()->replace (TC_Cubit_oneof, 0, CORBA_B_TRUE, env); + if (env.exception () != 0) { + error_count++; + print_exception (env.exception (), "cube_union_dii result type"); + CORBA_release (req); + return; + } + + // + // Make the invocation, verify the result + // + req->invoke (); + if (req->env ()->exception () != 0) { + error_count++; + print_exception (req->env ()->exception (),"cube_union_dii invoke"); + CORBA_release (req); + return; + } + + r = (Cubit_oneof *) req->result ()->value ()->value (); + + if (r->cm.o != 27 || r->cm.l != 125 || r->cm.s != -343) { + error_count++; + ACE_OS::fprintf (stderr, "cube_union_dii -- bad results\n"); + } + else + dmsg ("cube_union_dii ... success!!"); + + CORBA_release (req); } +======= +>>>>>>> 1.4 + + + diff --git a/TAO/tests/Cubit/TAO/cubitC.cpp b/TAO/tests/Cubit/TAO/cubitC.cpp index a9d140e3434..6691597ab2d 100644 --- a/TAO/tests/Cubit/TAO/cubitC.cpp +++ b/TAO/tests/Cubit/TAO/cubitC.cpp @@ -244,6 +244,78 @@ Cubit::Cubit_cube_struct (Cubit_Many &values, static const CORBA_Long _oc_Cubit_oneof [] = { +<<<<<<< cubitC.cpp + 1, // byte order flag (TRICKY) + 1, 0, // omitted repository/type ID + 1, 0, // omitted struct name, "oneof" + + // + // discriminant typecode: + // + tk_enum, // tk_enum + 72, // encapsulation length + + 1, // byte order flag (TRICKY) + 1, 0, // omitted repository/type ID + 1, 0, // omitted enum name, "discrim" + 6, // 5 elements in the enum + + 1, 0, // omitted member name, "e_0th" + 1, 0, // omitted member name, "e_1st" + 1, 0, // omitted member name, "e_2nd" + 1, 0, // omitted member name, "e_3rd" + 1, 0, // omitted member name, "e_4th" + 1, 0, // omitted member name, "e_5th" + + 4, // default member index (zero based) + 5, // number of union members + + // the 1st union branch arm + e_0th, // member label value + 1, 0, // omitted member name, "o" + tk_octet, // member typecode + + // the 2nd union branch arm + e_1st, // member label value + 1, 0, // omitted member name, "s" + tk_short, // member typecode + + // the 3rd union branch arm + e_2nd, // member label value + 1, 0, // omitted member name, "l" + tk_long, // member typecode + + // the 4th union branch arm + e_3rd, // member label value + 1, 0, // omitted member name, "cm" + + // the 4th union member typecode + tk_struct, // tk_struct + 60, // encap length + + 1, // byte order flag (TRICKY) + 1, 0, // omitted repository/type ID + 1, 0, // omitted struct name, "Many" + 3, // three struct members + + // First structure element + 1, 0, // omitted member name, "o" + tk_octet, // member type, tk_octet + + // Second structure element + 1, 0, // omitted member name, "l" + tk_long, // member type, tk_long + + // Third structure element + 1, 0, // omitted member name, "s" + tk_short, // member type, tk_short + + // the 5th union branch arm + 4, // the 5th member label value + 1, 0, // omitted member name, "cm" + ~0, // indirected typecode (~0) + -88 // offset to struct "Many" typecode +======= 1, // byte order flag (TRICKY) 1, 0, // omitted repository/type ID 1, 0, // omitted struct name, "oneof" @@ -314,6 +386,7 @@ static const CORBA_Long _oc_Cubit_oneof [] = 1, 0, // omitted member name, "cm" ~0, // indirected typecode (~0) -88 // offset to struct "Many" typecode +>>>>>>> 1.4 }; static CORBA_TypeCode _tc_Cubit_oneof (tk_union, diff --git a/TAO/tests/Cubit/TAO/cubitC.h b/TAO/tests/Cubit/TAO/cubitC.h index 03ad2352488..b3330b28c2b 100644 --- a/TAO/tests/Cubit/TAO/cubitC.h +++ b/TAO/tests/Cubit/TAO/cubitC.h @@ -97,3 +97,5 @@ extern const CORBA_Char *Cubit__id; // type ID #endif // VC++ #endif // _CUBIT_HH + + diff --git a/TAO/tests/Cubit/TAO/cubit_i.cpp b/TAO/tests/Cubit/TAO/cubit_i.cpp index a74243e27c2..710ab037f5e 100644 --- a/TAO/tests/Cubit/TAO/cubit_i.cpp +++ b/TAO/tests/Cubit/TAO/cubit_i.cpp @@ -84,7 +84,14 @@ void Cubit_i::Cubit_please_exit (CORBA_Environment &env) { TAO_OA_Parameters* params = TAO_OA_Parameters::instance (); +<<<<<<< cubit_i.cpp + dmsg ("I've been asked to shut down..."); + params->oa()->please_shutdown(env); + ACE_Service_Config::end_reactor_event_loop(); + dexc (env, "please_exit, please_shutdown"); +======= dmsg ("I've been asked to shut down..."); params->oa ()->please_shutdown (env); dexc (env, "please_exit, please_shutdown"); +>>>>>>> 1.4 } |