diff options
author | mitza <mitza@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-12-04 15:00:27 +0000 |
---|---|---|
committer | mitza <mitza@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-12-04 15:00:27 +0000 |
commit | 0bf3e638bfd7802322192cd0af2421bd72bc8c6a (patch) | |
tree | 23fe1f831d8254c6920c83bdd3dacc31114c8be3 /TAO/tests | |
parent | 3acfc81c56507026e185dea4319df457652e47f9 (diff) | |
download | ATCD-0bf3e638bfd7802322192cd0af2421bd72bc8c6a.tar.gz |
ChangeLogTag: Tue Dec 4 14:54:02 UTC 2007 Adam Mitz <mitza@ociweb.com>
Diffstat (limited to 'TAO/tests')
-rw-r--r-- | TAO/tests/Bug_2234_Regression/Test.idl | 4 | ||||
-rw-r--r-- | TAO/tests/Bug_2234_Regression/client.cpp | 55 | ||||
-rw-r--r-- | TAO/tests/Bug_2234_Regression/server.cpp | 95 | ||||
-rw-r--r-- | TAO/tests/Bug_3163_Regression/server.cpp | 10 |
4 files changed, 159 insertions, 5 deletions
diff --git a/TAO/tests/Bug_2234_Regression/Test.idl b/TAO/tests/Bug_2234_Regression/Test.idl index 5843ece7d9e..662cfb2e660 100644 --- a/TAO/tests/Bug_2234_Regression/Test.idl +++ b/TAO/tests/Bug_2234_Regression/Test.idl @@ -26,6 +26,8 @@ module Test typedef sequence< long > MySeqOfLong; + typedef MySeqOfLong MyArray[2]; + interface Foo { long TestLong( in long a, out long b, inout long c ); @@ -36,6 +38,8 @@ module Test MyVarUnion TestVarUnion( in MyVarUnion a, out MyVarUnion b, inout MyVarUnion c ); MySeqOfLong TestSeqOfLong( in MySeqOfLong a, out MySeqOfLong b, inout MySeqOfLong c ); any TestAny( in any a, out any b, inout any c ); + MyArray TestArray( in MyArray a, out MyArray b, inout MyArray c ); + Object TestObject( in Object a, out Object b, inout Object c); oneway void ShutdownServer(); }; }; diff --git a/TAO/tests/Bug_2234_Regression/client.cpp b/TAO/tests/Bug_2234_Regression/client.cpp index a2acf0a3f37..be552a77801 100644 --- a/TAO/tests/Bug_2234_Regression/client.cpp +++ b/TAO/tests/Bug_2234_Regression/client.cpp @@ -284,6 +284,61 @@ main( ACE_DEBUG( (LM_INFO, "OK\n") ); //----------------------------------------------------------------------- + { + Test::MyArray arr_a; + arr_a[0].length (1); + arr_a[0][0] = 9; + arr_a[1].length (1); + arr_a[1][0] = 23; + + Test::MyArray_var arr_b; + + Test::MyArray arr_c; + arr_c[0].length (1); + arr_c[0][0] = 23; + arr_c[1].length (1); + arr_c[1][0] = 9; + + ACE_DEBUG( (LM_INFO, ". MyArray() ") ); + Test::MyArray_var arr_ret = foo->TestArray (arr_a, arr_b.out (), arr_c); + + if (arr_c[0].length () != 1 || arr_c[0][0] != 24) + { + ACE_DEBUG( (LM_ERROR, "arr_c[0] is wrong\n") ); testFailed = 1; + } + else if (arr_c[1].length () != 1 || arr_c[1][0] != 10) + { + ACE_DEBUG( (LM_ERROR, "arr_c[1] is wrong\n") ); testFailed = 1; + } + else if (arr_b[0].length () != 1 || arr_b[0][0] != 8) + { + ACE_DEBUG( (LM_ERROR, "arr_b[0] is wrong\n") ); testFailed = 1; + } + else if (arr_b[1].length () != 1 || arr_b[1][0] != 22) + { + ACE_DEBUG( (LM_ERROR, "arr_b[1] is wrong\n") ); testFailed = 1; + } + else if (arr_ret[0].length () != 1 || arr_ret[0][0] != 7) + { + ACE_DEBUG( (LM_ERROR, "arr_ret[0] is wrong\n") ); testFailed = 1; + } + else if (arr_ret[1].length () != 1 || arr_ret[1][0] != 21) + { + ACE_DEBUG( (LM_ERROR, "arr_ret[1] is wrong\n") ); testFailed = 1; + } + else + ACE_DEBUG( (LM_INFO, "OK\n") ); + } + + //----------------------------------------------------------------------- + { + CORBA::Object_var a = CORBA::Object::_duplicate (foo); + CORBA::Object_var b; + CORBA::Object_var c = CORBA::Object::_duplicate (a); + CORBA::Object_var ret = foo->TestObject (a.in (), b.out (), c.inout ()); + } + + //----------------------------------------------------------------------- foo->ShutdownServer( ); //----------------------------------------------------------------------- diff --git a/TAO/tests/Bug_2234_Regression/server.cpp b/TAO/tests/Bug_2234_Regression/server.cpp index 4f4bd992438..ac0e36fd044 100644 --- a/TAO/tests/Bug_2234_Regression/server.cpp +++ b/TAO/tests/Bug_2234_Regression/server.cpp @@ -419,6 +419,86 @@ public: //----------------------------------------------------------- + Test::MyArray_slice *TestArray( + const Test::MyArray a, + Test::MyArray_out b, + Test::MyArray c) + { + ACE_DEBUG( (LM_INFO, ". in TestArray\n") ); + if (a[0].length () != 1) + { + ACE_DEBUG( (LM_INFO, "* Incorrect length of parameter a[0]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + if (a[0][0] != 9) + { + ACE_DEBUG( (LM_INFO, "* Incorrect input value of parameter a[0]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + if (a[1].length () != 1) + { + ACE_DEBUG( (LM_INFO, "* Incorrect length of parameter a[1]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + if (a[1][0] != 23) + { + ACE_DEBUG( (LM_INFO, "* Incorrect input value of parameter a[1]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + + if (c[0].length () != 1) + { + ACE_DEBUG( (LM_INFO, "* Incorrect length of parameter c[0]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + if (c[0][0]++ != 23) + { + ACE_DEBUG( (LM_INFO, "* Incorrect input value of parameter c[0]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + if (c[1].length () != 1) + { + ACE_DEBUG( (LM_INFO, "* Incorrect length of parameter c[1]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + if (c[1][0]++ != 9) + { + ACE_DEBUG( (LM_INFO, "* Incorrect input value of parameter c[1]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + + b = Test::MyArray_alloc (); + CORBA::ULong idx (0); + b[idx].length (1); + b[idx][0] = 8; + ++idx; + b[idx].length (1); + b[idx][0] = 22; + + Test::MyArray_var ret = new Test::MyArray; + idx = 0; + ret[idx].length (1); + ret[idx][0] = 7; + ++idx; + ret[idx].length (1); + ret[idx][0] = 21; + return ret._retn (); + } + + //----------------------------------------------------------- + + CORBA::Object_ptr TestObject( + CORBA::Object_ptr a, + CORBA::Object_out b, + CORBA::Object_ptr &c + ) + { + b = CORBA::Object::_duplicate (a); + return CORBA::Object::_duplicate (c); + } + + //----------------------------------------------------------- + void ShutdownServer( ) { @@ -459,6 +539,8 @@ public: const Test::MyVarUnion *vU; const Test::MyNonVarUnion *fU; const Test::MySeqOfLong *sL; + Test::MyArray_forany arr; + CORBA::Object_var obj; if (arg >>= vS) { @@ -554,6 +636,19 @@ public: else ACE_DEBUG( (LM_INFO, "*Null*") ); } + else if (arg >>= arr) + { + ACE_DEBUG( (LM_INFO, "MyArray (") ); + for (CORBA::ULong a_idx = 0; a_idx < 2; ++a_idx) + { + CORBA::ULong length = arr[a_idx].length (); + ACE_DEBUG( (LM_INFO, "[%u].length () == %u ", a_idx, length)); + } + } + else if (arg >>= CORBA::Any::to_object(obj)) + { + ACE_DEBUG( (LM_INFO, "CORBA::Object (") ); + } else ACE_DEBUG( (LM_INFO, "Unknown (") ); ACE_DEBUG( (LM_INFO, ") parameter\n") ); diff --git a/TAO/tests/Bug_3163_Regression/server.cpp b/TAO/tests/Bug_3163_Regression/server.cpp index b55b2029e16..e7df2954cd5 100644 --- a/TAO/tests/Bug_3163_Regression/server.cpp +++ b/TAO/tests/Bug_3163_Regression/server.cpp @@ -46,10 +46,10 @@ public: data->length(size); - for (size_t i = 0; i < data->length(); ++i) - { - data[i] = (rand() % 26) + 'A'; - } + for (CORBA::ULong i = 0; i < data->length(); ++i) + { + data[i] = (rand() % 26) + 'A'; + } return 0; } @@ -59,7 +59,7 @@ public: } private: - /// Use an ORB reference to conver strings to objects and shutdown + /// Use an ORB reference to convert strings to objects and shutdown /// the application. CORBA::ORB_var orb_; }; |