summaryrefslogtreecommitdiff
path: root/TAO/tests
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2020-12-29 09:16:03 +0100
committerJohnny Willemsen <jwillemsen@remedy.nl>2020-12-29 09:16:03 +0100
commit1d1caa2f5340920a93898f9e34cd1c5477400320 (patch)
treee15c34bf9476ee1687965b1eccd78bc316223813 /TAO/tests
parent76c3b5473a9d0aa75e8f36522eff1a1307f89cf2 (diff)
parentdaabeb9bb2388926f610f93c987563ce596e091f (diff)
downloadATCD-1d1caa2f5340920a93898f9e34cd1c5477400320.tar.gz
Merge branch 'master' into test-corba-is-nil
Diffstat (limited to 'TAO/tests')
-rw-r--r--TAO/tests/AMH_Exceptions/server.cpp7
-rw-r--r--TAO/tests/AMH_Oneway/server.cpp3
-rwxr-xr-xTAO/tests/AMI/run_test.pl2
-rw-r--r--TAO/tests/AlternateIIOP/README8
-rw-r--r--TAO/tests/BiDirectional_NestedUpcall/README2
-rw-r--r--TAO/tests/Big_Oneways/README10
-rw-r--r--TAO/tests/Big_Oneways/Session.h2
-rw-r--r--TAO/tests/Bug_1361_Regression/Echo.h7
-rwxr-xr-xTAO/tests/Bug_2702_Regression/fakeserver2.pl3
-rw-r--r--TAO/tests/Bug_3531b_Regression/server.cpp7
-rw-r--r--TAO/tests/IDL_Test/IDL_Test.mpc5
-rw-r--r--TAO/tests/IDL_Test/README2
-rw-r--r--TAO/tests/IDL_Test/enum_in_struct.idl2
-rw-r--r--TAO/tests/IDL_Test/keywords.idl20
-rw-r--r--TAO/tests/IDL_Test/typecode.idl3
-rw-r--r--TAO/tests/OBV/Collocated/Forward/TreeBase.idl2
-rw-r--r--TAO/tests/OBV/Forward/TreeBase.idl2
-rw-r--r--TAO/tests/ORB_shutdown/README2
-rw-r--r--TAO/tests/Portable_Interceptors/Bug_3582/Client_Request_Interceptor.h3
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp7
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h4
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp6
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.h4
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/README2
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/client.cpp12
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp71
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h28
-rwxr-xr-xTAO/tests/Portable_Interceptors/Dynamic/run_test.pl2
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/server.cpp8
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp170
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h26
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp11
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/test_i.h16
-rw-r--r--TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h3
-rw-r--r--TAO/tests/Portable_Interceptors/PICurrent/ClientORBInitializer.h4
-rw-r--r--TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.h3
-rw-r--r--TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.h3
-rw-r--r--TAO/tests/Portable_Interceptors/PICurrent/README2
-rw-r--r--TAO/tests/Portable_Interceptors/PICurrent/ServerORBInitializer.h2
-rw-r--r--TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.h3
-rw-r--r--TAO/tests/Portable_Interceptors/PICurrent/test_i.h3
-rw-r--r--TAO/tests/Portable_Interceptors/Redirection/Client_Request_Interceptor.h3
-rw-r--r--TAO/tests/Portable_Interceptors/Redirection/Server_Request_Interceptor.h4
-rw-r--r--TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_ORBInitializer.h3
-rw-r--r--TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_Request_Interceptor.h3
-rw-r--r--TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/README5
-rw-r--r--TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.h3
-rw-r--r--TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_ORBInitializer.h2
-rw-r--r--TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.cpp4
-rw-r--r--TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.h3
-rw-r--r--TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test_i.h3
-rw-r--r--TAO/tests/RTCORBA/Dynamic_Thread_Pool/README4
-rw-r--r--TAO/tests/RTCORBA/Dynamic_Thread_Pool/server.cpp1
-rw-r--r--TAO/tests/RTCORBA/Dynamic_Thread_Pool/test_i.h3
-rw-r--r--TAO/tests/Sequence_Iterators/.gitignore4
-rw-r--r--TAO/tests/Sequence_Iterators/Bounded_String.cpp673
-rw-r--r--TAO/tests/Sequence_Iterators/Sequence_Iterators.mpc29
-rw-r--r--TAO/tests/Sequence_Iterators/StringSeq.cpp959
-rw-r--r--TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp667
-rw-r--r--TAO/tests/Sequence_Iterators/Unbounded_Value.cpp690
-rw-r--r--TAO/tests/Sequence_Iterators/mock_reference.cpp88
-rw-r--r--TAO/tests/Sequence_Iterators/mock_reference.hpp100
-rwxr-xr-xTAO/tests/Sequence_Iterators/run_test.pl45
-rw-r--r--TAO/tests/Sequence_Iterators/testing_counters.hpp104
-rw-r--r--TAO/tests/Sequence_Iterators/testing_exception.hpp13
-rw-r--r--TAO/tests/Stack_Recursion/README2
-rw-r--r--TAO/tests/TransportCurrent/lib/Server_Request_Interceptor.h3
67 files changed, 265 insertions, 3635 deletions
diff --git a/TAO/tests/AMH_Exceptions/server.cpp b/TAO/tests/AMH_Exceptions/server.cpp
index 83afa65ba63..14dce3d4eb6 100644
--- a/TAO/tests/AMH_Exceptions/server.cpp
+++ b/TAO/tests/AMH_Exceptions/server.cpp
@@ -39,10 +39,9 @@ ST_AMH_Servant::test_method (Test::AMH_RoundtripResponseHandler_ptr _tao_rh,
Test::Timestamp)
{
// Throw an overload exception
-
Test::ServerOverload *ts = new Test::ServerOverload;
- // Calee owns the memory now. Need not delete 'ts'
+ // Caller owns the memory now. Need not delete 'ts'
Test::AMH_RoundtripExceptionHolder holder (ts);
try
@@ -72,7 +71,7 @@ public:
ST_AMH_Server (int argc, ACE_TCHAR **argv);
virtual ~ST_AMH_Server ();
- /// ORB inititalisation stuff
+ /// ORB initialisation stuff
int start_orb_and_poa (void);
/// register the servant with the poa
@@ -97,8 +96,6 @@ private:
int write_ior_to_file (CORBA::String_var ior);
};
-
-
/*** Server Declaration ***/
ST_AMH_Server::ST_AMH_Server (int argc, ACE_TCHAR **argv)
diff --git a/TAO/tests/AMH_Oneway/server.cpp b/TAO/tests/AMH_Oneway/server.cpp
index 88512b95d35..086b43367e0 100644
--- a/TAO/tests/AMH_Oneway/server.cpp
+++ b/TAO/tests/AMH_Oneway/server.cpp
@@ -1,4 +1,3 @@
-
#include "ace/OS_NS_stdio.h"
#include "ace/OS_NS_unistd.h"
#include "ace/Get_Opt.h"
@@ -113,8 +112,6 @@ private:
int write_ior_to_file (CORBA::String_var ior);
};
-
-
/*** Server Declaration ***/
ST_AMH_Server::ST_AMH_Server (int* argc, ACE_TCHAR **argv)
diff --git a/TAO/tests/AMI/run_test.pl b/TAO/tests/AMI/run_test.pl
index 13f9a99095c..884119168eb 100755
--- a/TAO/tests/AMI/run_test.pl
+++ b/TAO/tests/AMI/run_test.pl
@@ -63,7 +63,7 @@ if ($client->PutFile ($iorbase) == -1) {
$SV->Kill (); $SV->TimedWait (1);
exit 1;
}
-# copy the configruation file.
+# copy the configuration file.
if ($client->PutFile ($conf_file) == -1) {
print STDERR "ERROR: cannot set file <$client_conf>\n";
$SV->Kill (); $SV->TimedWait (1);
diff --git a/TAO/tests/AlternateIIOP/README b/TAO/tests/AlternateIIOP/README
index 18fcfb795c6..ea0923cc06c 100644
--- a/TAO/tests/AlternateIIOP/README
+++ b/TAO/tests/AlternateIIOP/README
@@ -1,10 +1,8 @@
/**
-
-
@page AlternateIIOP Test README File
- This test uses the binaries from the Hello test, but builds an
+This test uses the binaries from the Hello test, but builds an
IOR that contains multiple endpoints. The "hostname_in_ior" option is
used to add two unreachable endpoints along with a third that is
successful.
@@ -13,8 +11,8 @@ successful.
the test to allow for manual inspection using
$TAO_ROOT/utils/catior/catior.
- To run the test use the run_test.pl script:
+To run the test use the run_test.pl script:
$ ./run_test.pl
- the script returns 0 if the test was successful.
+the script returns 0 if the test was successful.
diff --git a/TAO/tests/BiDirectional_NestedUpcall/README b/TAO/tests/BiDirectional_NestedUpcall/README
index 3aa2e88e6e2..d6c6e88c475 100644
--- a/TAO/tests/BiDirectional_NestedUpcall/README
+++ b/TAO/tests/BiDirectional_NestedUpcall/README
@@ -1,5 +1,3 @@
-
-
This test is similar to the $TAO_ROOT/tests/BiDirectional test. The
only difference being that the server as a part of the upcall sends a
bunch of remote calls, to show some nested upcall behaviour.
diff --git a/TAO/tests/Big_Oneways/README b/TAO/tests/Big_Oneways/README
index 3de1a42ef28..7787ce966e0 100644
--- a/TAO/tests/Big_Oneways/README
+++ b/TAO/tests/Big_Oneways/README
@@ -1,23 +1,21 @@
/**
-
-
@page Big_Oneways Test README File
- This is a stress test for the non-blocking I/O features in the
+This is a stress test for the non-blocking I/O features in the
ORB. The test connects multiple peer processes together. Each
process sends messages to all its peers, using multiple threads to
generate the messages. Without non-blocking I/O the system soon
deadlocks.
- This is part of the regression testsuite for:
+This is part of the regression testsuite for:
http://bugzilla.dre.vanderbilt.edu/show_bug.cgi?id=132
- To run the test use the run_test.pl script:
+To run the test use the run_test.pl script:
$ ./run_test.pl
- the script returns 0 if the test was successful.
+the script returns 0 if the test was successful.
*/
diff --git a/TAO/tests/Big_Oneways/Session.h b/TAO/tests/Big_Oneways/Session.h
index e085eaf5c3c..7dad8676bc4 100644
--- a/TAO/tests/Big_Oneways/Session.h
+++ b/TAO/tests/Big_Oneways/Session.h
@@ -85,7 +85,7 @@ private:
/// Helper class to run svc() in a separate thread
Session_Task task_;
- /// Barrier to start all threads simultaenously
+ /// Barrier to start all threads simultaneously
#if defined(ACE_HAS_THREADS)
typedef ACE_Thread_Barrier Barrier;
#else
diff --git a/TAO/tests/Bug_1361_Regression/Echo.h b/TAO/tests/Bug_1361_Regression/Echo.h
index e10e02a1773..2f7d8119694 100644
--- a/TAO/tests/Bug_1361_Regression/Echo.h
+++ b/TAO/tests/Bug_1361_Regression/Echo.h
@@ -13,14 +13,11 @@
class Echo : public POA_Test::Echo
{
public:
- Echo(CORBA::ORB_ptr orb,
- int abort_counter);
+ Echo(CORBA::ORB_ptr orb, int abort_counter);
virtual void echo_payload (Test::Payload const & data);
- virtual void echo_payload_out (
- Test::Payload_out data
- );
+ virtual void echo_payload_out (Test::Payload_out data);
private:
CORBA::ORB_var orb_;
diff --git a/TAO/tests/Bug_2702_Regression/fakeserver2.pl b/TAO/tests/Bug_2702_Regression/fakeserver2.pl
index 038c9deb64d..13d0a9a04ef 100755
--- a/TAO/tests/Bug_2702_Regression/fakeserver2.pl
+++ b/TAO/tests/Bug_2702_Regression/fakeserver2.pl
@@ -1,5 +1,4 @@
-#!/usr/bin/perl
-
+#!/usr/bin/env perl
use Socket;
use IO::Socket;
diff --git a/TAO/tests/Bug_3531b_Regression/server.cpp b/TAO/tests/Bug_3531b_Regression/server.cpp
index 93fdf3555f6..8863849edb7 100644
--- a/TAO/tests/Bug_3531b_Regression/server.cpp
+++ b/TAO/tests/Bug_3531b_Regression/server.cpp
@@ -203,10 +203,6 @@ public:
virtual ACE_Reactor_Impl* allocate_reactor_impl (void) const
{
ACE_Reactor_Impl *impl = 0;
- /*
- * Hook to specialize TAO's reactor implementation.
- */
- //@@ TAO_REACTOR_SPL_COMMENT_HOOK_START
ACE_NEW_RETURN (impl,
Test_Reactor (ACE::max_handles (),
1,
@@ -215,14 +211,13 @@ public:
this->reactor_mask_signals_,
ACE_Select_Reactor_Token::LIFO),
0);
- //@@ TAO_REACTOR_SPL_COMMENT_HOOK_END
return impl;
}
private:
};
-// force export flag otherwise Windoze will complain
+// force export flag otherwise Windows will complain
#define TAO_Test_Export ACE_Proper_Export_Flag
ACE_FACTORY_DEFINE (TAO_Test, Test_Resource_Factory)
diff --git a/TAO/tests/IDL_Test/IDL_Test.mpc b/TAO/tests/IDL_Test/IDL_Test.mpc
index 8ef9a6b2d1e..7ce1884e8bc 100644
--- a/TAO/tests/IDL_Test/IDL_Test.mpc
+++ b/TAO/tests/IDL_Test/IDL_Test.mpc
@@ -30,7 +30,7 @@ project(*IDL): taoserver, messaging, gen_ostream {
gperf.idl
interface.idl
nested_scope.idl
-
+ keywords.idl
old_constants.idl
simple.idl
simple2.idl
@@ -39,7 +39,6 @@ project(*IDL): taoserver, messaging, gen_ostream {
old_struct.idl
old_union.idl
old_union2.idl
-
params.idl
reopened_modules.idl
struct.idl
@@ -73,7 +72,6 @@ project(*IDL): taoserver, messaging, gen_ostream {
array_only.idl
constants.idl
generic_object.idl
- keywords.idl
inherit.idl
module.idl
@@ -162,7 +160,6 @@ project(*DLL): taoidldefaults, taolib, messaging {
inheritS.cpp
interfaceC.cpp
interfaceS.cpp
- keywordsA.cpp
keywordsC.cpp
keywordsS.cpp
loader_constC.cpp
diff --git a/TAO/tests/IDL_Test/README b/TAO/tests/IDL_Test/README
index 4533b382ce1..386728b4915 100644
--- a/TAO/tests/IDL_Test/README
+++ b/TAO/tests/IDL_Test/README
@@ -1,5 +1,3 @@
-
-
This test is a collection of IDL files that once caused IDL compiler
or C++ compiler errors, plus a dummy main.cpp for the build. There is
no execution check in this test, the only outcome of interest being
diff --git a/TAO/tests/IDL_Test/enum_in_struct.idl b/TAO/tests/IDL_Test/enum_in_struct.idl
index 9b71f864eb3..cd0d4ee97f5 100644
--- a/TAO/tests/IDL_Test/enum_in_struct.idl
+++ b/TAO/tests/IDL_Test/enum_in_struct.idl
@@ -61,7 +61,7 @@ struct decl_heavy_struct
};
// Similar case for exception included here - no sense
-// in making a separte file for exceptions, which are
+// in making a separate file for exceptions, which are
// almost the same as structs.
exception ErrorException
diff --git a/TAO/tests/IDL_Test/keywords.idl b/TAO/tests/IDL_Test/keywords.idl
index 561e511b996..08f7233ea91 100644
--- a/TAO/tests/IDL_Test/keywords.idl
+++ b/TAO/tests/IDL_Test/keywords.idl
@@ -1,4 +1,3 @@
-
//=============================================================================
/**
* @file keywords.idl
@@ -8,31 +7,36 @@
* compiler. This test is to make sure the problems
* stay fixed.
*
- *
* @author Jeff Parsons <parsons@cs.wustl.edu> and TAO users.
*/
//=============================================================================
-
// All these identifiers should be accepted, but
// prepended with _cxx_.
-// 'private' and 'public' have been commented out because they are now, in
-// addition to being C++ keywords, IDL keywords, and thus are illegal
-// except when used as such.
+// IDL identifiers are escaped using _
struct Keywords
{
unsigned short or;
char or_eq;
-// octet private;
+ octet _private;
boolean protected;
-// float public;
+ float _public;
double int;
};
+struct _Object {
+ long long id;
+};
+typedef sequence<_Object> ObjectSeq;
+struct Objects {
+ ObjectSeq objs;
+};
+
interface Testing
{
void foo (in string namespace);
+ void bar (in Objects foo);
};
diff --git a/TAO/tests/IDL_Test/typecode.idl b/TAO/tests/IDL_Test/typecode.idl
index d4c1f051da1..4ec95f616a3 100644
--- a/TAO/tests/IDL_Test/typecode.idl
+++ b/TAO/tests/IDL_Test/typecode.idl
@@ -1,16 +1,13 @@
-
//=============================================================================
/**
* @file typecode.idl
*
* Test a sequence of typecodes
*
- *
* @author Johnny Willemsen <jwillemsen@remedy.nl>
*/
//=============================================================================
-
#include "orb.idl"
module MyModule
diff --git a/TAO/tests/OBV/Collocated/Forward/TreeBase.idl b/TAO/tests/OBV/Collocated/Forward/TreeBase.idl
index 666b02e83fe..57d4280b016 100644
--- a/TAO/tests/OBV/Collocated/Forward/TreeBase.idl
+++ b/TAO/tests/OBV/Collocated/Forward/TreeBase.idl
@@ -1,7 +1,7 @@
// Forward declaration to make recursive construct.
valuetype BaseNode;
-//@@ Dosn't work for now
+//@@ Doesn't work for now
//typedef sequence<BaseNode> BaseNodeSeq;
// Performance test: One may try to pass
diff --git a/TAO/tests/OBV/Forward/TreeBase.idl b/TAO/tests/OBV/Forward/TreeBase.idl
index 666b02e83fe..57d4280b016 100644
--- a/TAO/tests/OBV/Forward/TreeBase.idl
+++ b/TAO/tests/OBV/Forward/TreeBase.idl
@@ -1,7 +1,7 @@
// Forward declaration to make recursive construct.
valuetype BaseNode;
-//@@ Dosn't work for now
+//@@ Doesn't work for now
//typedef sequence<BaseNode> BaseNodeSeq;
// Performance test: One may try to pass
diff --git a/TAO/tests/ORB_shutdown/README b/TAO/tests/ORB_shutdown/README
index 89eecda60dc..9e57fb2934e 100644
--- a/TAO/tests/ORB_shutdown/README
+++ b/TAO/tests/ORB_shutdown/README
@@ -7,7 +7,7 @@
The simplest possible test for TAO's shutdown procedure. This
test is basically a regression for BUG 1265. Please see BUG 1265 in
- http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=1265
+ http://bugzilla.dre.vanderbilt.edu/show_bug.cgi?id=1265
for details.
diff --git a/TAO/tests/Portable_Interceptors/Bug_3582/Client_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/Bug_3582/Client_Request_Interceptor.h
index 3753fc5ccdc..c9090eae741 100644
--- a/TAO/tests/Portable_Interceptors/Bug_3582/Client_Request_Interceptor.h
+++ b/TAO/tests/Portable_Interceptors/Bug_3582/Client_Request_Interceptor.h
@@ -27,7 +27,6 @@ class Client_Request_Interceptor
public virtual ::CORBA::LocalObject
{
public:
-
/// Constructor.
Client_Request_Interceptor (const char *orb_id,
const char *forward_str);
@@ -63,7 +62,6 @@ public:
//@}
private:
-
///The ID of the ORB this interceptor is registered with.
CORBA::String_var orb_id_;
@@ -75,7 +73,6 @@ private:
CORBA::ULong request_count_;
CORBA::String_var forward_str_;
-
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp
index 2af09d07db9..a51d948d3a1 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp
@@ -5,6 +5,10 @@
#include "client_interceptor.h"
+Echo_Client_ORBInitializer::Echo_Client_ORBInitializer (int& result) : result_ (result)
+{
+}
+
void
Echo_Client_ORBInitializer::pre_init (
PortableInterceptor::ORBInitInfo_ptr)
@@ -21,14 +25,13 @@ Echo_Client_ORBInitializer::post_init (
// Install the Echo client request interceptor
ACE_NEW_THROW_EX (interceptor,
- Echo_Client_Request_Interceptor,
+ Echo_Client_Request_Interceptor (this->result_),
CORBA::NO_MEMORY ());
PortableInterceptor::ClientRequestInterceptor_var
client_interceptor = interceptor;
info->add_client_request_interceptor (client_interceptor.in ());
-
}
#endif /* TAO_HAS_INTERCEPTORS == 1 */
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h
index 84cdaa3c472..4a6ed849fed 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h
+++ b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h
@@ -27,10 +27,14 @@ class Echo_Client_ORBInitializer :
public virtual ::CORBA::LocalObject
{
public:
+ Echo_Client_ORBInitializer (int& result);
virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info);
virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info);
+
+private:
+ int& result_;
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp
index 095a32b08e0..f50e351c6f2 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp
@@ -5,6 +5,10 @@
#include "server_interceptor.h"
+Echo_Server_ORBInitializer::Echo_Server_ORBInitializer (int& result) : result_ (result)
+{
+}
+
void
Echo_Server_ORBInitializer::pre_init (
PortableInterceptor::ORBInitInfo_ptr)
@@ -21,7 +25,7 @@ Echo_Server_ORBInitializer::post_init (
// Install the Echo server request interceptor
ACE_NEW_THROW_EX (interceptor,
- Echo_Server_Request_Interceptor,
+ Echo_Server_Request_Interceptor (this->result_),
CORBA::NO_MEMORY ());
PortableInterceptor::ServerRequestInterceptor_var
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.h
index d2c2e6de155..c611cdf28eb 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.h
+++ b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.h
@@ -27,10 +27,14 @@ class Echo_Server_ORBInitializer :
public virtual ::CORBA::LocalObject
{
public:
+ Echo_Server_ORBInitializer (int& result);
virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info);
virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info);
+
+private:
+ int& result_;
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/README b/TAO/tests/Portable_Interceptors/Dynamic/README
index 6f494bcdf76..a2e686c1941 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/README
+++ b/TAO/tests/Portable_Interceptors/Dynamic/README
@@ -1,5 +1,3 @@
-
-
This test allows you to visually check the correct invocation of
TAO's pseudo-portable interceptors, especially the Dynamic interface.
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/client.cpp b/TAO/tests/Portable_Interceptors/Dynamic/client.cpp
index c0153f9e365..0917bb12eaf 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/client.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/client.cpp
@@ -38,12 +38,10 @@ run_test (Test_Interceptors::Visual_ptr server)
{
CORBA::String_var msg;
- server->normal (10,
- msg.out ());
+ server->normal (10, msg.out ());
CORBA::Long one = 1, two = 1, result = 0;
- result = server->calculate (one,
- two);
+ result = server->calculate (one, two);
ACE_DEBUG ((LM_DEBUG,
"calculate() result = %d\n",
@@ -81,6 +79,8 @@ run_test (Test_Interceptors::Visual_ptr server)
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
+ int result = 0;
+
try
{
#if TAO_HAS_INTERCEPTORS == 1
@@ -88,7 +88,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
PortableInterceptor::ORBInitializer::_nil ();
ACE_NEW_RETURN (temp_initializer,
- Echo_Client_ORBInitializer,
+ Echo_Client_ORBInitializer (result),
-1); // No exceptions yet!
PortableInterceptor::ORBInitializer_var orb_initializer =
temp_initializer;
@@ -128,5 +128,5 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
return 1;
}
- return 0;
+ return result;
}
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp b/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp
index af4dab6e0b9..5249375a979 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp
@@ -6,38 +6,32 @@
#include "tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h"
#include "ace/Log_Msg.h"
-#include "ace/OS_NS_string.h"
+#include <cstring>
-Echo_Client_Request_Interceptor::Echo_Client_Request_Interceptor (void)
- : myname_ ("Echo_Client_Interceptor")
-{
-}
-
-Echo_Client_Request_Interceptor::~Echo_Client_Request_Interceptor ()
+Echo_Client_Request_Interceptor::Echo_Client_Request_Interceptor (int& result)
+ : result_ (result)
{
}
char *
-Echo_Client_Request_Interceptor::name (void)
+Echo_Client_Request_Interceptor::name ()
{
- return CORBA::string_dup (this->myname_);
+ return CORBA::string_dup ("Echo_Client_Interceptor");
}
void
-Echo_Client_Request_Interceptor::destroy (void)
+Echo_Client_Request_Interceptor::destroy ()
{
}
void
-Echo_Client_Request_Interceptor::send_poll (
- PortableInterceptor::ClientRequestInfo_ptr)
+Echo_Client_Request_Interceptor::send_poll (PortableInterceptor::ClientRequestInfo_ptr)
{
// Do nothing
}
void
-Echo_Client_Request_Interceptor::send_request (
- PortableInterceptor::ClientRequestInfo_ptr ri)
+Echo_Client_Request_Interceptor::send_request (PortableInterceptor::ClientRequestInfo_ptr ri)
{
bool catched_exception = false;
try
@@ -45,13 +39,15 @@ Echo_Client_Request_Interceptor::send_request (
PortableInterceptor::ReplyStatus rstatus = ri->reply_status ();
ACE_UNUSED_ARG (rstatus);
}
- catch (const ::CORBA::BAD_INV_ORDER&)
+ catch (const ::CORBA::BAD_INV_ORDER& ex)
{
- catched_exception = true;
+ // BAD_INV_ORDER should be thrown with minor code 14
+ catched_exception = (ex.minor () == (CORBA::OMGVMCID | 14));
}
if (!catched_exception)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR, no exception when getting reply status\n"));
}
@@ -64,17 +60,15 @@ Echo_Client_Request_Interceptor::send_request (
op.in ()));
// For the "normal" operation, get the argument list.
- if (ACE_OS::strcmp (op.in (),
- "normal") == 0)
+ if (std::strcmp (op.in (), "normal") == 0)
{
- Dynamic::ParameterList_var paramlist =
- ri->arguments ();
+ Dynamic::ParameterList_var paramlist = ri->arguments ();
if (paramlist->length () != 2)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) All parameters not available\n"));
-
}
CORBA::ULong first = 0, second = 1; // If you dont understand
@@ -92,6 +86,7 @@ Echo_Client_Request_Interceptor::send_request (
if (param != 10)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR in send_request while checking "
"the value of the extracted "
@@ -101,6 +96,7 @@ Echo_Client_Request_Interceptor::send_request (
CORBA::TypeCode_var second_typecode = paramlist[second].argument.type ();
if (second_typecode->kind () != CORBA::tk_null)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR in send_request while checking "
"the type of the extracted out"
@@ -110,10 +106,8 @@ Echo_Client_Request_Interceptor::send_request (
}
void
-Echo_Client_Request_Interceptor::receive_other (
- PortableInterceptor::ClientRequestInfo_ptr ri)
+Echo_Client_Request_Interceptor::receive_other (PortableInterceptor::ClientRequestInfo_ptr ri)
{
-
CORBA::String_var op = ri->operation ();
ACE_DEBUG ((LM_DEBUG,
@@ -123,8 +117,7 @@ Echo_Client_Request_Interceptor::receive_other (
}
void
-Echo_Client_Request_Interceptor::receive_reply (
- PortableInterceptor::ClientRequestInfo_ptr ri)
+Echo_Client_Request_Interceptor::receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri)
{
CORBA::String_var op = ri->operation ();
@@ -134,11 +127,9 @@ Echo_Client_Request_Interceptor::receive_reply (
op.in ()));
// For the "normal" operation, get the argument list.
- if (ACE_OS::strcmp (op.in (),
- "normal") == 0)
+ if (std::strcmp (op.in (), "normal") == 0)
{
- Dynamic::ParameterList_var paramlist =
- ri->arguments ();
+ Dynamic::ParameterList_var paramlist = ri->arguments ();
if (paramlist->length () != 2)
{
@@ -153,6 +144,7 @@ Echo_Client_Request_Interceptor::receive_reply (
if (paramlist[first].mode != CORBA::PARAM_IN ||
paramlist[second].mode != CORBA::PARAM_OUT)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR in the extracted argument list\n"));
}
@@ -162,6 +154,7 @@ Echo_Client_Request_Interceptor::receive_reply (
if (param != 10)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR in send_request while checking "
"the value of the extracted "
@@ -174,9 +167,9 @@ Echo_Client_Request_Interceptor::receive_reply (
CORBA::String_var transfer (str);
- if (ACE_OS::strcmp (str,
- "DO_NOT_INSULT_MY_INTELLIGENCE") != 0)
+ if (std::strcmp (str, "DO_NOT_INSULT_MY_INTELLIGENCE") != 0)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR in send_request while checking "
"the value of the extracted "
@@ -184,10 +177,9 @@ Echo_Client_Request_Interceptor::receive_reply (
}
}
- if (ACE_OS::strcmp (op.in (), "calculate") == 0)
+ if (std::strcmp (op.in (), "calculate") == 0)
{
- Dynamic::ParameterList_var paramlist =
- ri->arguments ();
+ Dynamic::ParameterList_var paramlist = ri->arguments ();
CORBA::Long param1, param2, result;
CORBA::ULong i = 0; // index -- explicitly used to avoid
@@ -206,11 +198,11 @@ Echo_Client_Request_Interceptor::receive_reply (
result));
}
- if (ACE_OS::strcmp (op.in (), "_get_the_structure") == 0)
+ if (std::strcmp (op.in (), "_get_the_structure") == 0)
{
CORBA::Any_var a = ri->result ();
- const Test_Interceptors::Visual::VarLenStruct * v = 0;
+ const Test_Interceptors::Visual::VarLenStruct * v = nullptr;
(a.in ()) >>= v;
@@ -227,7 +219,6 @@ void
Echo_Client_Request_Interceptor::receive_exception (
PortableInterceptor::ClientRequestInfo_ptr ri)
{
-
CORBA::String_var op = ri->operation ();
ACE_DEBUG ((LM_DEBUG,
@@ -235,9 +226,7 @@ Echo_Client_Request_Interceptor::receive_exception (
"from \"%C\"\n",
op.in ()));
-
- CORBA::String_var exception_id =
- ri->received_exception_id ();
+ CORBA::String_var exception_id = ri->received_exception_id ();
ACE_DEBUG ((LM_DEBUG,
"Exception ID = %C\n",
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h b/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h
index 5e340799c91..939e199f681 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h
+++ b/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h
@@ -15,40 +15,34 @@
#pragma warning(disable:4250)
#endif /* _MSC_VER */
+/// Client-side echo interceptor. For checking interceptor visually only.
class Echo_Client_Request_Interceptor
: public virtual PortableInterceptor::ClientRequestInterceptor,
public virtual ::CORBA::LocalObject
{
- // = Client-side echo interceptor. For checking interceptor visually only.
public:
+ Echo_Client_Request_Interceptor (int& result);
- Echo_Client_Request_Interceptor (void);
- // ctor.
-
- virtual char * name (void);
// Canonical name of the interceptor.
+ char * name () override;
- virtual void destroy (void);
+ void destroy () override;
- virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr);
+ void send_poll (PortableInterceptor::ClientRequestInfo_ptr) override;
- virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri);
+ void send_request (PortableInterceptor::ClientRequestInfo_ptr ri) override;
- virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr);
+ void receive_other (PortableInterceptor::ClientRequestInfo_ptr) override;
- virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri);
+ void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri) override;
- virtual void receive_exception (
- PortableInterceptor::ClientRequestInfo_ptr ri);
+ void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri) override;
protected:
-
- virtual ~Echo_Client_Request_Interceptor (void);
- // dtor.
+ ~Echo_Client_Request_Interceptor () override = default;
private:
- const char *myname_;
-
+ int& result_;
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/run_test.pl b/TAO/tests/Portable_Interceptors/Dynamic/run_test.pl
index 1113978c01a..3d1fb801bc5 100755
--- a/TAO/tests/Portable_Interceptors/Dynamic/run_test.pl
+++ b/TAO/tests/Portable_Interceptors/Dynamic/run_test.pl
@@ -52,7 +52,7 @@ if ($client->PutFile ($iorbase) == -1) {
exit 1;
}
-$client_status = $CL->SpawnWaitKill ($server->ProcessStartWaitInterval() + 45);
+$client_status = $CL->SpawnWaitKill ($server->ProcessStartWaitInterval());
if ($client_status != 0) {
print STDERR "ERROR: client returned $client_status\n";
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/server.cpp b/TAO/tests/Portable_Interceptors/Dynamic/server.cpp
index 6ca15eecd4b..809cd868d40 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/server.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/server.cpp
@@ -2,7 +2,6 @@
#include "test_i.h"
#include "Echo_Server_ORBInitializer.h"
#include "ace/OS_NS_stdio.h"
-
#include "tao/ORBInitializer_Registry.h"
const ACE_TCHAR *ior_output_file = ACE_TEXT("test.ior");
@@ -35,6 +34,7 @@ parse_args (int argc, ACE_TCHAR *argv[])
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
+ int result = 0;
try
{
#if TAO_HAS_INTERCEPTORS == 1
@@ -42,7 +42,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
PortableInterceptor::ORBInitializer::_nil ();
ACE_NEW_RETURN (temp_initializer,
- Echo_Server_ORBInitializer,
+ Echo_Server_ORBInitializer (result),
-1); // No exceptions yet!
PortableInterceptor::ORBInitializer_var orb_initializer =
temp_initializer;
@@ -86,7 +86,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
CORBA::String_var ior =
orb->object_to_string (server.in ());
- ACE_DEBUG ((LM_DEBUG, "Test_Interceptors::Visual: <%s>\n", ior.in ()));
+ ACE_DEBUG ((LM_DEBUG, "Test_Interceptors::Visual: <%C>\n", ior.in ()));
// If the ior_output_file exists, output the ior to it
if (ior_output_file != 0)
@@ -115,5 +115,5 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
return 1;
}
- return 0;
+ return result;
}
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp
index 4f12e95e2d5..20671f6c34b 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp
@@ -6,32 +6,99 @@
#include "testC.h"
#include "ace/Log_Msg.h"
-#include "ace/OS_NS_string.h"
+#include <cstring>
-Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (void)
- : myname_ ("Echo_Server_Interceptor")
-{
-}
-
-Echo_Server_Request_Interceptor::~Echo_Server_Request_Interceptor ()
+Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (int& result)
+ : result_ (result)
{
}
char *
-Echo_Server_Request_Interceptor::name (void)
+Echo_Server_Request_Interceptor::name ()
{
- return CORBA::string_dup (this->myname_);
+ return CORBA::string_dup ("Echo_Server_Interceptor");
}
void
-Echo_Server_Request_Interceptor::destroy (void)
+Echo_Server_Request_Interceptor::destroy ()
{
}
void
Echo_Server_Request_Interceptor::receive_request_service_contexts (
- PortableInterceptor::ServerRequestInfo_ptr)
+ PortableInterceptor::ServerRequestInfo_ptr ri)
{
+ bool catched_exception = false;
+ try
+ {
+ CORBA::String_var tmdi = ri->target_most_derived_interface ();
+ }
+ catch (const ::CORBA::BAD_INV_ORDER& ex)
+ {
+ // BAD_INV_ORDER should be thrown with minor code 14
+ catched_exception = (ex.minor () == (CORBA::OMGVMCID | 14));
+ }
+
+ if (!catched_exception)
+ {
+ ++this->result_;
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR, no exception when calling target_most_derived_interface from receive_request_service_contexts\n"));
+ }
+
+ catched_exception = false;
+ try
+ {
+ CORBA::Boolean tmdi = ri->target_is_a ("FOO");
+ }
+ catch (const ::CORBA::BAD_INV_ORDER& ex)
+ {
+ // BAD_INV_ORDER should be thrown with minor code 14
+ catched_exception = (ex.minor () == (CORBA::OMGVMCID | 14));
+ }
+
+ if (!catched_exception)
+ {
+ ++this->result_;
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR, no exception when calling target_is_a from receive_request_service_contexts\n"));
+ }
+
+ catched_exception = false;
+ try
+ {
+ PortableInterceptor::ReplyStatus tmdi = ri->reply_status ();
+ }
+ catch (const ::CORBA::BAD_INV_ORDER& ex)
+ {
+ // BAD_INV_ORDER should be thrown with minor code 14
+ catched_exception = (ex.minor () == (CORBA::OMGVMCID | 14));
+ }
+
+ if (!catched_exception)
+ {
+ ++this->result_;
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR, no exception when calling reply_status from receive_request_service_contexts\n"));
+ }
+
+ catched_exception = false;
+ try
+ {
+ Dynamic::ParameterList_var paramlist = ri->arguments ();
+ }
+ catch (const ::CORBA::BAD_INV_ORDER& ex)
+ {
+ // BAD_INV_ORDER should be thrown with minor code 14
+ catched_exception = (ex.minor () == (CORBA::OMGVMCID | 14));
+ }
+
+ if (!catched_exception)
+ {
+ ++this->result_;
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR, no exception when calling arguments from receive_request_service_contexts\n"));
+ }
}
void
@@ -44,13 +111,15 @@ Echo_Server_Request_Interceptor::receive_request (
PortableInterceptor::ReplyStatus rstatus = ri->reply_status ();
ACE_UNUSED_ARG (rstatus);
}
- catch (const ::CORBA::BAD_INV_ORDER&)
+ catch (const ::CORBA::BAD_INV_ORDER& ex)
{
- catched_exception = true;
+ // BAD_INV_ORDER should be thrown with minor code 14
+ catched_exception = (ex.minor () == (CORBA::OMGVMCID | 14));
}
if (!catched_exception)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR, no exception when getting reply status\n"));
}
@@ -61,10 +130,26 @@ Echo_Server_Request_Interceptor::receive_request (
"Echo_Server_Request_Interceptor::receive_request from \"%C\"\n",
op.in ()));
- if (ACE_OS::strcmp (op.in (), "normal") == 0)
+ CORBA::Boolean targetisa = ri->target_is_a ("FOO");
+ if (targetisa)
{
- Dynamic::ParameterList_var paramlist =
- ri->arguments ();
+ ++this->result_;
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR in receive_request while checking "
+ "target_is_a, it is not a FOO\n"));
+ }
+ targetisa = ri->target_is_a ("IDL:Test_Interceptors/Visual:1.0");
+ if (!targetisa)
+ {
+ ++this->result_;
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR in receive_request while checking "
+ "target_is_a, it should be IDL:Test_Interceptors/Visual:1.0\n"));
+ }
+
+ if (std::strcmp (op.in (), "normal") == 0)
+ {
+ Dynamic::ParameterList_var paramlist = ri->arguments ();
CORBA::Long param;
CORBA::ULong i = 0; // index -- explicitly used to avoid
@@ -79,6 +164,7 @@ Echo_Server_Request_Interceptor::receive_request (
CORBA::TypeCode_var second_typecode = paramlist[i].argument.type ();
if (second_typecode->kind () != CORBA::tk_null)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR in receive_request while checking "
"the type of the extracted out"
@@ -86,29 +172,51 @@ Echo_Server_Request_Interceptor::receive_request (
}
}
- CORBA::String_var tmdi =
- ri->target_most_derived_interface ();
+ CORBA::String_var tmdi = ri->target_most_derived_interface ();
ACE_DEBUG ((LM_DEBUG,
"Target most derived interface: %C\n",
tmdi.in ()));
+
+ if (std::strcmp (tmdi.in (), "IDL:Test_Interceptors/Visual:1.0") != 0)
+ {
+ ++this->result_;
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR in receive_request while checking "
+ "target_most_derived_interface\n"));
+ }
+
+ catched_exception = false;
+ try
+ {
+ PortableInterceptor::ReplyStatus tmdi = ri->reply_status ();
+ }
+ catch (const ::CORBA::BAD_INV_ORDER& ex)
+ {
+ // BAD_INV_ORDER should be thrown with minor code 14
+ catched_exception = (ex.minor () == (CORBA::OMGVMCID | 14));
+ }
+
+ if (!catched_exception)
+ {
+ ++this->result_;
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR, no exception when calling reply_status from receive_request\n"));
+ }
}
void
-Echo_Server_Request_Interceptor::send_reply (
- PortableInterceptor::ServerRequestInfo_ptr ri)
+Echo_Server_Request_Interceptor::send_reply (PortableInterceptor::ServerRequestInfo_ptr ri)
{
-
CORBA::String_var op = ri->operation ();
ACE_DEBUG ((LM_DEBUG,
"Echo_Server_Request_Interceptor::send_reply from \"%C\"\n",
op.in ()));
- if (ACE_OS::strcmp (op.in (), "normal") == 0)
+ if (std::strcmp (op.in (), "normal") == 0)
{
- Dynamic::ParameterList_var paramlist =
- ri->arguments ();
+ Dynamic::ParameterList_var paramlist = ri->arguments ();
CORBA::Long param;
CORBA::ULong i = 0; // index -- explicitly used to avoid
@@ -119,10 +227,9 @@ Echo_Server_Request_Interceptor::send_reply (
param));
}
- if (ACE_OS::strcmp (op.in (), "calculate") == 0)
+ if (std::strcmp (op.in (), "calculate") == 0)
{
- Dynamic::ParameterList_var paramlist =
- ri->arguments ();
+ Dynamic::ParameterList_var paramlist = ri->arguments ();
CORBA::Long param1, param2, result = 0;
CORBA::ULong i = 0; // index -- explicitly used to avoid
@@ -146,7 +253,6 @@ void
Echo_Server_Request_Interceptor::send_exception (
PortableInterceptor::ServerRequestInfo_ptr ri)
{
-
CORBA::String_var op = ri->operation ();
ACE_DEBUG ((LM_DEBUG,
@@ -154,17 +260,15 @@ Echo_Server_Request_Interceptor::send_exception (
"from \"%C\"\n",
op.in ()));
-
- CORBA::Any_var any =
- ri->sending_exception ();
+ CORBA::Any_var any = ri->sending_exception ();
CORBA::TypeCode_var type = any->type ();
- const char *exception_id = type->id ();
+ CORBA::String_var exception_id = type->id ();
ACE_DEBUG ((LM_DEBUG,
"Exception ID = %C\n",
- exception_id));
+ exception_id.in ()));
}
void
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h
index da47f879f3a..b0a99af2ab6 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h
+++ b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h
@@ -15,38 +15,34 @@
#pragma warning(disable:4250)
#endif /* _MSC_VER */
+/// Server-side echo interceptor. For checking interceptor visually only.
class Echo_Server_Request_Interceptor
: public PortableInterceptor::ServerRequestInterceptor,
public virtual ::CORBA::LocalObject
{
- // = Server-side echo interceptor. For checking interceptor visually only.
public:
- Echo_Server_Request_Interceptor (void);
- // cotr.
+ Echo_Server_Request_Interceptor (int& result);
- virtual char * name (void);
// Canonical name of the interceptor.
+ char * name () override;
- virtual void destroy (void);
+ void destroy () override;
- virtual void receive_request_service_contexts (PortableInterceptor::ServerRequestInfo_ptr);
+ void receive_request_service_contexts (PortableInterceptor::ServerRequestInfo_ptr) override;
- virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri);
+ void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri) override;
- virtual void send_reply (PortableInterceptor::ServerRequestInfo_ptr ri);
+ void send_reply (PortableInterceptor::ServerRequestInfo_ptr ri) override;
- virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri);
+ void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri) override;
- virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr);
+ void send_other (PortableInterceptor::ServerRequestInfo_ptr) override;
protected:
-
- virtual ~Echo_Server_Request_Interceptor (void);
- // dotr.
+ ~Echo_Server_Request_Interceptor () override = default;
private:
- const char *myname_;
-
+ int& result_;
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp b/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp
index 540b0e2ebd3..600905ee3ce 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp
@@ -4,7 +4,6 @@ Visual_i::Visual_i (CORBA::ORB_ptr orb)
: orb_ (CORBA::ORB::_duplicate (orb))
{
}
- // ctor
void
Visual_i::normal (CORBA::Long arg,
@@ -23,9 +22,9 @@ Visual_i::calculate (CORBA::Long one,
}
Test_Interceptors::Visual::VarLenStruct *
-Visual_i::the_structure (void)
+Visual_i::the_structure ()
{
- Test_Interceptors::Visual::VarLenStruct * s;
+ Test_Interceptors::Visual::VarLenStruct * s = nullptr;
ACE_NEW_THROW_EX (s,
Test_Interceptors::Visual::VarLenStruct,
@@ -40,21 +39,21 @@ Visual_i::the_structure (void)
}
void
-Visual_i::user (void)
+Visual_i::user ()
{
ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing Silly\n"));
throw Test_Interceptors::Silly ();
}
void
-Visual_i::system (void)
+Visual_i::system ()
{
ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing INV_OBJREF\n"));
throw CORBA::INV_OBJREF ();
}
void
-Visual_i::shutdown (void)
+Visual_i::shutdown ()
{
this->orb_->shutdown ();
}
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/test_i.h b/TAO/tests/Portable_Interceptors/Dynamic/test_i.h
index 2e8230b8576..03d5177ae04 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/test_i.h
+++ b/TAO/tests/Portable_Interceptors/Dynamic/test_i.h
@@ -19,24 +19,20 @@ class Visual_i : public POA_Test_Interceptors::Visual
public:
Visual_i (CORBA::ORB_ptr orb);
- virtual CORBA::Long calculate (CORBA::Long one,
- CORBA::Long two);
+ CORBA::Long calculate (CORBA::Long one, CORBA::Long two) override;
- void normal (CORBA::Long arg,
- CORBA::String_out msg);
+ void normal (CORBA::Long arg, CORBA::String_out msg) override;
- virtual Test_Interceptors::Visual::VarLenStruct * the_structure ();
+ Test_Interceptors::Visual::VarLenStruct * the_structure () override;
- virtual void user (void);
+ void user () override;
- virtual void system (void);
+ void system () override;
- virtual void shutdown (void);
+ void shutdown () override;
private:
-
CORBA::ORB_var orb_;
-
};
#endif /* TAO_INTERCEPTOR_TEST_I_H */
diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h
index 37728cbd5b4..df858f6df1f 100644
--- a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h
+++ b/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h
@@ -48,7 +48,6 @@ class Client_Request_Interceptor
public virtual ::CORBA::LocalObject
{
public:
-
/// Constructor.
Client_Request_Interceptor (const char *orb_id,
const char *forward_str);
@@ -84,7 +83,6 @@ public:
//@}
private:
-
///The ID of the ORB this interceptor is registered with.
CORBA::String_var orb_id_;
@@ -98,7 +96,6 @@ private:
/// Stringified reference to the object the initial request will be
/// forwarded to by this interceptor.
CORBA::String_var forward_str_;
-
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ClientORBInitializer.h b/TAO/tests/Portable_Interceptors/PICurrent/ClientORBInitializer.h
index d915986215d..d4a5cbd430e 100644
--- a/TAO/tests/Portable_Interceptors/PICurrent/ClientORBInitializer.h
+++ b/TAO/tests/Portable_Interceptors/PICurrent/ClientORBInitializer.h
@@ -25,7 +25,6 @@
#pragma warning(disable:4250)
#endif /* _MSC_VER */
-
// Test's SlotId made global for ease of implementation.
// It is initialized to a large number to make it obvious when the
// SlotId is invalid.
@@ -34,7 +33,6 @@
// if thread-safety is an issue!!!
extern PortableInterceptor::SlotId slot_id;
-
/**
* @class ClientORBInitializer
*
@@ -48,7 +46,6 @@ class ClientORBInitializer :
public virtual ::CORBA::LocalObject
{
public:
-
/**
* @name Methods Required by the ORBInitializer Interface
*
@@ -65,7 +62,6 @@ public:
virtual void post_init (
PortableInterceptor::ORBInitInfo_ptr info);
//@}
-
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.h b/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.h
index 7b7f18aac6b..0bca4b49de4 100644
--- a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.h
+++ b/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.h
@@ -43,7 +43,6 @@ class ClientRequestInterceptor
public virtual ::CORBA::LocalObject
{
public:
-
/// Constructor.
ClientRequestInterceptor (PortableInterceptor::SlotId slot_id,
PortableInterceptor::Current_ptr pi_current);
@@ -79,14 +78,12 @@ public:
//@}
private:
-
/// The PICurrent slot ID allocated to this application during ORB
/// initialization.
PortableInterceptor::SlotId slot_id_;
/// Reference to the PICurrent object.
PortableInterceptor::Current_var pi_current_;
-
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.h b/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.h
index 4d3bafe639d..bb69b5c1e82 100644
--- a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.h
+++ b/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.h
@@ -40,7 +40,6 @@ class ClientRequestInterceptor2
public virtual ::CORBA::LocalObject
{
public:
-
/// Constructor.
ClientRequestInterceptor2 (PortableInterceptor::SlotId slot_id);
@@ -75,11 +74,9 @@ public:
//@}
private:
-
/// The PICurrent slot ID allocated to this application during ORB
/// initialization.
PortableInterceptor::SlotId slot_id_;
-
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/PICurrent/README b/TAO/tests/Portable_Interceptors/PICurrent/README
index 605ac2c1260..98e491468d7 100644
--- a/TAO/tests/Portable_Interceptors/PICurrent/README
+++ b/TAO/tests/Portable_Interceptors/PICurrent/README
@@ -1,5 +1,3 @@
-
-
This test verifies that the "PICurrent" object semantics are correct
on both the client side and the server side. In particular, it
attempts to make sure the request scope current (RSC) and thread scope
diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ServerORBInitializer.h b/TAO/tests/Portable_Interceptors/PICurrent/ServerORBInitializer.h
index fe70c86f8eb..4985cf7d4de 100644
--- a/TAO/tests/Portable_Interceptors/PICurrent/ServerORBInitializer.h
+++ b/TAO/tests/Portable_Interceptors/PICurrent/ServerORBInitializer.h
@@ -49,7 +49,6 @@ class ServerORBInitializer :
public virtual ::CORBA::LocalObject
{
public:
-
/**
* @name Methods Required by the ORBInitializer Interface
*
@@ -66,7 +65,6 @@ public:
virtual void post_init (
PortableInterceptor::ORBInitInfo_ptr info);
//@}
-
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.h b/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.h
index 8be04ba5395..d9990d5b102 100644
--- a/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.h
+++ b/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.h
@@ -42,7 +42,6 @@ class ServerRequestInterceptor
public virtual ::CORBA::LocalObject
{
public:
-
/// Constructor.
ServerRequestInterceptor (PortableInterceptor::SlotId id,
PortableInterceptor::Current_ptr pi_current);
@@ -78,14 +77,12 @@ public:
//@}
private:
-
/// The PICurrent slot ID allocated to this application during ORB
/// initialization.
PortableInterceptor::SlotId slot_id_;
/// Reference to the PICurrent object.
PortableInterceptor::Current_var pi_current_;
-
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/PICurrent/test_i.h b/TAO/tests/Portable_Interceptors/PICurrent/test_i.h
index cda81e4f4ed..9e370707c0e 100644
--- a/TAO/tests/Portable_Interceptors/PICurrent/test_i.h
+++ b/TAO/tests/Portable_Interceptors/PICurrent/test_i.h
@@ -29,7 +29,6 @@
class test_i : public virtual POA_PICurrentTest::test
{
public:
-
/// Constructor.
test_i (PortableInterceptor::Current_ptr current,
PortableInterceptor::SlotId id,
@@ -53,7 +52,6 @@ public:
virtual void shutdown (void);
private:
-
/// Reference to the PICurrent object.
PortableInterceptor::Current_var current_;
@@ -62,7 +60,6 @@ private:
/// Pseudo-reference to the ORB.
CORBA::ORB_var orb_;
-
};
#endif /* TEST_I_H */
diff --git a/TAO/tests/Portable_Interceptors/Redirection/Client_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/Redirection/Client_Request_Interceptor.h
index 3753fc5ccdc..c9090eae741 100644
--- a/TAO/tests/Portable_Interceptors/Redirection/Client_Request_Interceptor.h
+++ b/TAO/tests/Portable_Interceptors/Redirection/Client_Request_Interceptor.h
@@ -27,7 +27,6 @@ class Client_Request_Interceptor
public virtual ::CORBA::LocalObject
{
public:
-
/// Constructor.
Client_Request_Interceptor (const char *orb_id,
const char *forward_str);
@@ -63,7 +62,6 @@ public:
//@}
private:
-
///The ID of the ORB this interceptor is registered with.
CORBA::String_var orb_id_;
@@ -75,7 +73,6 @@ private:
CORBA::ULong request_count_;
CORBA::String_var forward_str_;
-
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/Redirection/Server_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/Redirection/Server_Request_Interceptor.h
index 1f2abcbc24b..5907543ac8b 100644
--- a/TAO/tests/Portable_Interceptors/Redirection/Server_Request_Interceptor.h
+++ b/TAO/tests/Portable_Interceptors/Redirection/Server_Request_Interceptor.h
@@ -26,7 +26,6 @@ class Server_Request_Interceptor
public virtual ::CORBA::LocalObject
{
public:
-
/// Constructor.
Server_Request_Interceptor (void);
@@ -61,15 +60,12 @@ public:
//@}
protected:
-
/// Destructor.
~Server_Request_Interceptor (void);
private:
-
/// The number of requests intercepted by this interceptor.
CORBA::ULong request_count_;
-
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_ORBInitializer.h
index a6adcaee7d7..66aef9277e6 100644
--- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_ORBInitializer.h
+++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_ORBInitializer.h
@@ -8,7 +8,6 @@
*/
//=============================================================================
-
#ifndef TAO_CLIENT_ORB_INITIALIZER_H
#define TAO_CLIENT_ORB_INITIALIZER_H
@@ -42,11 +41,9 @@ class Client_ORBInitializer :
public virtual ::CORBA::LocalObject
{
public:
-
virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info);
virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info);
-
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_Request_Interceptor.h
index 514796e720e..0b6a17e2bb0 100644
--- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_Request_Interceptor.h
+++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_Request_Interceptor.h
@@ -43,7 +43,6 @@ class Client_Request_Interceptor
public virtual Request_Interceptor
{
public:
-
/// Constructor.
Client_Request_Interceptor (const char *name);
@@ -73,12 +72,10 @@ public:
//@}
private:
-
// Returns 1 if the client-side test is currently being run, and 0
// otherwise.
CORBA::Boolean client_side_test (
PortableInterceptor::ClientRequestInfo_ptr info);
-
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/README b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/README
index a002c1bbc16..86f889bfa0c 100644
--- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/README
+++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/README
@@ -1,12 +1,9 @@
-
-
NOTE: The code in this test is highly specialized and very brittle.
Do not use it as a model for "real world" interceptor code.
-
This test verifies that proper request interceptor flow semantics
occur during a given request/invocation. It does so by executing a
-canned (hard-coded) set of scenarios. Each scenario excercises a
+canned (hard-coded) set of scenarios. Each scenario exercises a
specific flow behavior. All scenarios correspond to the ones detailed
in the Portable Interceptor specification (00-04-05). They are listed
below:
diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.h b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.h
index ded8412f970..662b8e79d85 100644
--- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.h
+++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.h
@@ -42,7 +42,6 @@ class Request_Interceptor
: public virtual PortableInterceptor::Interceptor
{
public:
-
/// Constructor.
Request_Interceptor (const char *name);
@@ -62,7 +61,6 @@ public:
//@}
protected:
-
/// The name of this interceptor.
CORBA::String_var name_;
@@ -75,7 +73,6 @@ protected:
/// called.
ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::ULong>
ending_interception_point_count_;
-
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_ORBInitializer.h
index bf6e9a79b15..4f9f1a17d5f 100644
--- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_ORBInitializer.h
+++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_ORBInitializer.h
@@ -42,11 +42,9 @@ class Server_ORBInitializer :
public virtual ::CORBA::LocalObject
{
public:
-
virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info);
virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info);
-
};
#if defined(_MSC_VER)
diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.cpp b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.cpp
index 435eb4e6a3d..0caaf005906 100644
--- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.cpp
+++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.cpp
@@ -15,7 +15,6 @@ void
Server_Request_Interceptor::receive_request_service_contexts (
PortableInterceptor::ServerRequestInfo_ptr ri)
{
-
CORBA::Boolean server_side =
this->server_side_test (ri);
@@ -58,7 +57,6 @@ void
Server_Request_Interceptor::receive_request (
PortableInterceptor::ServerRequestInfo_ptr ri)
{
-
CORBA::Boolean server_side =
this->server_side_test (ri);
@@ -129,7 +127,6 @@ void
Server_Request_Interceptor::send_exception (
PortableInterceptor::ServerRequestInfo_ptr ri)
{
-
CORBA::Boolean server_side =
this->server_side_test (ri);
@@ -206,7 +203,6 @@ void
Server_Request_Interceptor::send_other (
PortableInterceptor::ServerRequestInfo_ptr ri)
{
-
CORBA::Boolean server_side =
this->server_side_test (ri);
diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.h
index 524842dd5a3..79f396b40fc 100644
--- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.h
+++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.h
@@ -44,7 +44,6 @@ class Server_Request_Interceptor
public virtual Request_Interceptor
{
public:
-
/// Constructor. Accepts the name of the interceptor.
Server_Request_Interceptor (const char *name);
@@ -74,14 +73,12 @@ public:
//@}
private:
-
/// Returns 1 if the server-side test is currently being run, and 0
/// otherwise.
CORBA::Boolean server_side_test (
PortableInterceptor::ServerRequestInfo_ptr info);
private:
-
/// Variable used to keep track of the scenario count. Used to get
/// around the inability to call RequestInfo::arguments() in the
/// receive_service_contexts() interception point.
diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test_i.h b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test_i.h
index 654eb1a4a1b..91260b771db 100644
--- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test_i.h
+++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test_i.h
@@ -26,7 +26,6 @@
class test_i : public virtual POA_Test
{
public:
-
/// Constructor.
test_i (CORBA::ORB_ptr orb);
@@ -41,10 +40,8 @@ public:
virtual void shutdown (void);
private:
-
/// Pseudo-reference to the ORB.
CORBA::ORB_var orb_;
-
};
#endif /* TEST_I_H */
diff --git a/TAO/tests/RTCORBA/Dynamic_Thread_Pool/README b/TAO/tests/RTCORBA/Dynamic_Thread_Pool/README
index 94074ab8aeb..3286dcbe9ad 100644
--- a/TAO/tests/RTCORBA/Dynamic_Thread_Pool/README
+++ b/TAO/tests/RTCORBA/Dynamic_Thread_Pool/README
@@ -1,5 +1,3 @@
-
-
Description:
This is a simple test for a RT thread-pool server. It creates a
server process with multiple thread pools, POAs, and servants. The
@@ -7,4 +5,4 @@ test also spawns multiple clients for each servant. The servants with
multiple threads in their thread-pool respond faster than the servants
with a single thread thread-pool.
-See run_test.pl to see how to run this test. \ No newline at end of file
+See run_test.pl to see how to run this test.
diff --git a/TAO/tests/RTCORBA/Dynamic_Thread_Pool/server.cpp b/TAO/tests/RTCORBA/Dynamic_Thread_Pool/server.cpp
index 7bdf6bff90d..3de5fa0d2bb 100644
--- a/TAO/tests/RTCORBA/Dynamic_Thread_Pool/server.cpp
+++ b/TAO/tests/RTCORBA/Dynamic_Thread_Pool/server.cpp
@@ -150,7 +150,6 @@ create_POA_and_register_servant (CORBA::Policy_ptr threadpool_policy,
class Task : public ACE_Task_Base
{
public:
-
Task (ACE_Thread_Manager &thread_manager,
CORBA::ORB_ptr orb);
diff --git a/TAO/tests/RTCORBA/Dynamic_Thread_Pool/test_i.h b/TAO/tests/RTCORBA/Dynamic_Thread_Pool/test_i.h
index 3dafef71563..17dc7cbdea7 100644
--- a/TAO/tests/RTCORBA/Dynamic_Thread_Pool/test_i.h
+++ b/TAO/tests/RTCORBA/Dynamic_Thread_Pool/test_i.h
@@ -8,8 +8,7 @@
#include "testS.h"
-class test_i :
- public POA_test
+class test_i : public POA_test
{
public:
/// Constructor.
diff --git a/TAO/tests/Sequence_Iterators/.gitignore b/TAO/tests/Sequence_Iterators/.gitignore
deleted file mode 100644
index c24a6328561..00000000000
--- a/TAO/tests/Sequence_Iterators/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/Bounded_String
-/StringSeq
-/Unbounded_Objectref
-/Unbounded_Value
diff --git a/TAO/tests/Sequence_Iterators/Bounded_String.cpp b/TAO/tests/Sequence_Iterators/Bounded_String.cpp
deleted file mode 100644
index 4e10ab58bf0..00000000000
--- a/TAO/tests/Sequence_Iterators/Bounded_String.cpp
+++ /dev/null
@@ -1,673 +0,0 @@
-/**
- * @file Bounded_String.cpp
- *
- * @brief test for STL iterator behaviour of CORBA bounded string sequence
- *
- * @author Friedhelm Wolf (fwolf@dre.vanderbilt.edu)
- */
-
-#include "tao/Bounded_Basic_String_Sequence_T.h"
-#include "tao/CORBA_String.h"
-#include "ace/Log_Msg.h"
-#include "ace/OS_NS_string.h"
-
-#include <iostream>
-#include <iterator>
-#include <sstream>
-
-#if defined TAO_HAS_SEQUENCE_ITERATORS && TAO_HAS_SEQUENCE_ITERATORS == 1
-
-typedef TAO::bounded_basic_string_sequence<char, 4> s_sequence;
-
-#define FAIL_RETURN_IF(CONDITION) \
- if (CONDITION) \
- { \
- ACE_DEBUG ((LM_ERROR, ACE_TEXT ("\tFailed at %N:%l\n"))); \
- return 1; \
- }
-
-template <typename ITERATOR_T>
-int test_sequence ()
-{
- s_sequence a;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test for correct behaviour for empty sequence
- FAIL_RETURN_IF (a.begin() != a.end ());
-
- // setup of an example sequence
- a.length (4);
-
- const char * elem0_cstr = "elem0";
- const char * elem1_cstr = "elem1";
- const char * elem2_cstr = "elem2";
- const char * elem3_cstr = "elem3";
-
- a[0] = CORBA::string_dup (elem0_cstr);
- a[1] = CORBA::string_dup (elem1_cstr);
- a[2] = CORBA::string_dup (elem2_cstr);
- a[3] = CORBA::string_dup (elem3_cstr);
-
- // test iterator copy constructor
- ITERATOR_T a_it (a.begin ());
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test assignment operator
- a_it = a.begin ();
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test non const dereferencing
- // JWH2 - I don't think this test makes sense. I believe the compiler
- // will always return a const value since the dereference is on
- // the right hand side of the assignment (i.e., r value).
- //char* value0 = *a_it;
- //FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem0_cstr) != 0);
-
- // test const dereferencing
- const char* const value1 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value1, elem0_cstr) != 0);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.begin());
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem1_cstr) != 0);
-
- // test < operator
- FAIL_RETURN_IF (!(a.begin () < a_it));
- FAIL_RETURN_IF (a_it < a.begin ());
-
- // test difference type
- int a_diff = a_it - a.begin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.end ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem3_cstr) != 0);
-
- // test pre-decrement operator
- a_it = a.end ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem3_cstr) != 0);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.begin ();
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[0]) != 0);
- a_it += 2;
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[2]) != 0);
-
- // test operator[] write
- // NOTE: This now changes the sequence a.
- // NOTE: This does not work for const_iterators which are
- // sometimes used in this function.
- // a_it[0] = CORBA::string_dup (elem0_cstr);
- // FAIL_RETURN_IF (ACE_OS::strcmp (a[2],elem0_cstr) != 0);
-
- // reset content of sequence a
- //a[2] = CORBA::string_dup (elem2_cstr);
-
- // test for loop behaviour
- s_sequence b = a;
- ITERATOR_T b_it = b.begin ();
-
- for (a_it = a.begin ();
- a_it != a.end ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, *b_it) != 0);
- }
-
- s_sequence test;
- test.length (4);
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- ITERATOR_T copytest_iter = test.begin ();
- for (ITERATOR_T copya_iter = a.begin ();
- copya_iter != a.end ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*copya_iter, *copytest_iter) != 0);
- }
-
- /// Testing - using ostream_iterator
- std::ostringstream ostream;
- std::copy (a.begin (),
- a.end (),
- // JWH2 - I changed value_type to const_value_type. Is that
- // the correct approach?
- std::ostream_iterator<s_sequence::const_value_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem0\nelem1\nelem2\nelem3\n") != 0);
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename ITERATOR_T>
-int test_const_sequence ()
-{
- // setup of an example sequence
- s_sequence setup;
- setup.length (4);
-
- const char * elem0_cstr = "elem0";
- const char * elem1_cstr = "elem1";
- const char * elem2_cstr = "elem2";
- const char * elem3_cstr = "elem3";
-
- setup[0] = CORBA::string_dup (elem0_cstr);
- setup[1] = CORBA::string_dup (elem1_cstr);
- setup[2] = CORBA::string_dup (elem2_cstr);
- setup[3] = CORBA::string_dup (elem3_cstr);
-
- const s_sequence a = setup;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test iterator copy constructor
- ITERATOR_T a_it (a.begin ());
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test assignment operator
- a_it = a.begin ();
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test non const dereferencing
- // JWH2 - I don't think this test makes sense. I believe the compiler
- // will always return a const value since the dereference is on
- // the right hand side of the assignment (i.e., r value).
- //char* value0 = *a_it;
- //FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem0_cstr) != 0);
-
- // test const dereferencing
- const char* const value1 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value1, elem0_cstr) != 0);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.begin());
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem1_cstr) != 0);
-
- // test < operator
- FAIL_RETURN_IF (!(a.begin () < a_it));
- FAIL_RETURN_IF (a_it < a.begin ());
-
- // test difference type
- int a_diff = a_it - a.begin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.end ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem3_cstr) != 0);
-
- // test pre-decrement operator
- a_it = a.end ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem3_cstr) != 0);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.begin ();
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[0]) != 0);
- a_it += 2;
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[2]) != 0);
-
- // test for loop behaviour
- s_sequence b = a;
- ITERATOR_T b_it = b.begin ();
-
- for (a_it = a.begin ();
- a_it != a.end ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, *b_it) != 0);
- }
-
- s_sequence test;
- test.length (4);
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- ITERATOR_T copytest_iter = test.begin ();
- for (ITERATOR_T copya_iter = a.begin ();
- copya_iter != a.end ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*copya_iter, *copytest_iter) != 0);
- }
-
- /// Testing - using ostream_iterator
- std::ostringstream ostream;
- std::copy (a.begin (),
- a.end (),
- // JWH2 - I changed value_type to const_value_type. Is that
- // the correct approach?
- std::ostream_iterator<s_sequence::const_value_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem0\nelem1\nelem2\nelem3\n") != 0);
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename REVERSE_ITERATOR_T>
-int test_sequence_reverse ()
-{
- s_sequence a;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test for correct behaviour for empty sequence
-
- FAIL_RETURN_IF (a.begin() != a.end ());
-
- // setup of an example sequence
- a.length (4);
-
- const char * elem0_cstr = "elem0";
- const char * elem1_cstr = "elem1";
- const char * elem2_cstr = "elem2";
- const char * elem3_cstr = "elem3";
-
- a.length (4);
- a[0] = CORBA::string_dup (elem0_cstr);
- a[1] = CORBA::string_dup (elem1_cstr);
- a[2] = CORBA::string_dup (elem2_cstr);
- a[3] = CORBA::string_dup (elem3_cstr);
-
- // test iterator copy constructor
- REVERSE_ITERATOR_T a_it (a.rbegin ());
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test assignment operator
- a_it = a.rbegin ();
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test non const dereferencing
- // JWH2 - I don't think this test makes sense. I believe the compiler
- // will always return a const value since the dereference is on
- // the right hand side of the assignment (i.e., r value).
- //char* value0 = *a_it;
- //FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem3_cstr) != 0);
-
- // test const dereferencing
- const char* const value1 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value1, elem3_cstr) != 0);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.rbegin());
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem2_cstr) != 0);
-
- // test < operator
- FAIL_RETURN_IF (!(a.rbegin () < a_it));
- FAIL_RETURN_IF (a_it < a.rbegin ());
-
- // test difference type
- int a_diff = a_it - a.rbegin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- REVERSE_ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- REVERSE_ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.rend ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem0_cstr) != 0);
-
- // test pre-decrement operator
- a_it = a.rend ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem0_cstr) != 0);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.rbegin ();
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[3]) != 0);
- a_it += 2;
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[1]) != 0);
-
- // test operator[] write
- // NOTE: This now changes the sequence a.
- // this is not possible for const iterators which are
- // sometimes used by this function.
- // a_it[0] = CORBA::string_dup (elem0_cstr);
- // FAIL_RETURN_IF (ACE_OS::strcmp (a[1],elem0_cstr) != 0);
-
- // reset content of sequence a
- //a[1] = CORBA::string_dup (elem1_cstr);
-
- // test for loop behaviour
- s_sequence b = a;
- REVERSE_ITERATOR_T b_it = b.rbegin ();
-
- for (a_it = a.rbegin ();
- a_it != a.rend ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, *b_it) != 0);
- }
-
- s_sequence test;
- test.length (a.length ());
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- REVERSE_ITERATOR_T copytest_iter = test.rbegin ();
- for (REVERSE_ITERATOR_T copya_iter = a.rbegin ();
- copya_iter != a.rend ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*copya_iter, *copytest_iter) != 0);
- }
-
- /// Testing - using ostream_iterator
- std::ostringstream ostream;
- std::copy (a.rbegin (),
- a.rend (),
- // JWH2 - I changed value_type to const_value_type. Is that
- // the correct approach?
- std::ostream_iterator<s_sequence::const_value_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem3\nelem2\nelem1\nelem0\n") != 0);
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename REVERSE_ITERATOR_T>
-int test_const_sequence_reverse ()
-{
- // setup of an example sequence
- s_sequence setup;
- setup.length (4);
-
- const char * elem0_cstr = "elem0";
- const char * elem1_cstr = "elem1";
- const char * elem2_cstr = "elem2";
- const char * elem3_cstr = "elem3";
-
- setup[0] = CORBA::string_dup (elem0_cstr);
- setup[1] = CORBA::string_dup (elem1_cstr);
- setup[2] = CORBA::string_dup (elem2_cstr);
- setup[3] = CORBA::string_dup (elem3_cstr);
-
- const s_sequence a = setup;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test iterator copy constructor
- REVERSE_ITERATOR_T a_it (a.rbegin ());
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test assignment operator
- a_it = a.rbegin ();
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test non const dereferencing
- // JWH2 - I don't think this test makes sense. I believe the compiler
- // will always return a const value since the dereference is on
- // the right hand side of the assignment (i.e., r value).
- //char* value0 = *a_it;
- //FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem3_cstr) != 0);
-
- // test const dereferencing
- const char* const value1 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value1, elem3_cstr) != 0);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.rbegin());
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem2_cstr) != 0);
-
- // test < operator
- FAIL_RETURN_IF (!(a.rbegin () < a_it));
- FAIL_RETURN_IF (a_it < a.rbegin ());
-
- // test difference type
- int a_diff = a_it - a.rbegin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- REVERSE_ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- REVERSE_ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.rend ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem0_cstr) != 0);
-
- // test pre-decrement operator
- a_it = a.rend ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem0_cstr) != 0);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.rbegin ();
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[3]) != 0);
- a_it += 2;
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[1]) != 0);
-
- // test for loop behaviour
- s_sequence b = a;
- REVERSE_ITERATOR_T b_it = b.rbegin ();
-
- for (a_it = a.rbegin ();
- a_it != a.rend ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, *b_it) != 0);
- }
-
- s_sequence test;
- test.length (a.length ());
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- REVERSE_ITERATOR_T copytest_iter = test.rbegin ();
- for (REVERSE_ITERATOR_T copya_iter = a.rbegin ();
- copya_iter != a.rend ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*copya_iter, *copytest_iter) != 0);
- }
-
- /// Testing - using ostream_iterator
- std::ostringstream ostream;
- std::copy (a.rbegin (),
- a.rend (),
- // JWH2 - I changed value_type to const_value_type. Is that
- // the correct approach?
- std::ostream_iterator<s_sequence::const_value_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem3\nelem2\nelem1\nelem0\n") != 0);
-
- return 0;
-}
-
-#endif
-
-//-----------------------------------------------------------------------------
-
-int ACE_TMAIN(int,ACE_TCHAR*[])
-{
- int status = 0;
-
-#if defined TAO_HAS_SEQUENCE_ITERATORS && TAO_HAS_SEQUENCE_ITERATORS == 1
-
- // Test Generic_Sequence_Iterator.
- status += test_sequence<s_sequence::iterator> ();
-
- // Test Const_Generic_Sequence_Iterator with non-const sequence.
- status += test_sequence<s_sequence::const_iterator> ();
-
- // Test Const_Generic_Sequence_Iterator with const sequence.
- status += test_const_sequence<s_sequence::const_iterator> ();
-
- // Test Generic_Sequence_Reverse_Iterator.
- status += test_sequence_reverse<s_sequence::reverse_iterator> ();
-
- // Test Const_Generic_Sequence_Reverse_Iterator with non-const sequence.
- status += test_sequence_reverse<s_sequence::const_reverse_iterator> ();
-
- // Test Const_Generic_Sequence_Reverse_Iterator with const sequence.
- status += test_const_sequence_reverse<s_sequence::const_reverse_iterator> ();
-
-#endif
-
- return status;
-}
-
diff --git a/TAO/tests/Sequence_Iterators/Sequence_Iterators.mpc b/TAO/tests/Sequence_Iterators/Sequence_Iterators.mpc
deleted file mode 100644
index 320b84b882c..00000000000
--- a/TAO/tests/Sequence_Iterators/Sequence_Iterators.mpc
+++ /dev/null
@@ -1,29 +0,0 @@
-// -*- MPC -*-
-project(StringSeq) : taoexe {
- exename = StringSeq
- Source_Files {
- StringSeq.cpp
- }
-}
-
-project(Bounded_String) : taoexe {
- exename = Bounded_String
- Source_Files {
- Bounded_String.cpp
- }
-}
-
-project(Unbounded_Value) : taoexe {
- exename = Unbounded_Value
- Source_Files {
- Unbounded_Value.cpp
- }
-}
-
-project(Unbounded_Objectref) : taoexe {
- exename = Unbounded_Objectref
- Source_Files {
- mock_reference.cpp
- Unbounded_Objectref.cpp
- }
-}
diff --git a/TAO/tests/Sequence_Iterators/StringSeq.cpp b/TAO/tests/Sequence_Iterators/StringSeq.cpp
deleted file mode 100644
index 937c583c7aa..00000000000
--- a/TAO/tests/Sequence_Iterators/StringSeq.cpp
+++ /dev/null
@@ -1,959 +0,0 @@
-/**
- * @file StringSeq.cpp
- *
- * @brief test for STL iterator behaviour of CORBA unbounded string sequence
- *
- * @author Friedhelm Wolf (fwolf@dre.vanderbilt.edu)
- */
-
-#include "tao/StringSeqC.h"
-#include "ace/Log_Msg.h"
-#include "ace/OS_NS_string.h"
-
-#include <iostream>
-#include <iterator>
-#include <sstream>
-
-#define FAIL_RETURN_IF(CONDITION) \
- if (CONDITION) \
- { \
- ACE_DEBUG ((LM_ERROR, ACE_TEXT ("\tFailed at %N:%l\n"))); \
- return 1; \
- }
-
-//-----------------------------------------------------------------------------
-
-#if defined TAO_HAS_SEQUENCE_ITERATORS && TAO_HAS_SEQUENCE_ITERATORS == 1
-
-template <typename ITERATOR_T>
-int test_sequence ()
-{
- ::CORBA::StringSeq a;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test for correct behaviour for empty sequence
-
- FAIL_RETURN_IF (a.begin() != a.end ());
-
- // setup of an example sequence
-
- const char * elem0_cstr = "elem0";
- const char * elem1_cstr = "elem1";
- const char * elem2_cstr = "elem2";
- const char * elem3_cstr = "elem3";
-
- a.length (4);
- // Create a case to test for memory leaks
- // in the sequence.
- a[0] = CORBA::string_dup (elem0_cstr);
- a[0] = CORBA::string_dup (elem0_cstr);
- a[1] = CORBA::string_dup (elem1_cstr);
- a[2] = CORBA::string_dup (elem2_cstr);
- a[3] = CORBA::string_dup (elem3_cstr);
-
- // test iterator copy constructor
- ITERATOR_T a_it (a.begin ());
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test assignment operator
- a_it = a.begin ();
-
- // Create a case to test for memory leaks
- // in the iterator.
- *a_it = CORBA::string_dup (elem0_cstr);
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test non const dereferencing
- // I'm not sure this test makes sense since what's returned from
- // dereferencing the iterator is an r value.
- const char* value_seq = a[0];
- FAIL_RETURN_IF (ACE_OS::strcmp (value_seq, elem0_cstr) != 0);
- const char* value0 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem0_cstr) != 0);
-
- // test const dereferencing
- const char* const value1 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value1, elem0_cstr) != 0);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.begin());
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem1_cstr) != 0);
-
- // test < operator
- FAIL_RETURN_IF (!(a.begin () < a_it));
- FAIL_RETURN_IF (a_it < a.begin ());
-
- // test difference type
- int a_diff = a_it - a.begin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.end ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem3_cstr) != 0);
-
- // test pre-decrement operator
- a_it = a.end ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem3_cstr) != 0);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.begin ();
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[0]) != 0);
- a_it += 2;
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[2]) != 0);
-
- // test operator[] write
- // NOTE: This assignment actually modifies the third element
- // in the sequence since the iterator was previously positioned
- // at the third element. I believe these are the proper semantics
- // for using the bracket operator with an iterator. The number
- // in the brackets is additive - not absolute.
- a_it[0] = CORBA::string_dup (elem2_cstr);
- FAIL_RETURN_IF (ACE_OS::strcmp (a[2], elem2_cstr) != 0);
-
- // reset content of sequence a
- a[1] = CORBA::string_dup (elem1_cstr);
-
- // test for loop behaviour
- ::CORBA::StringSeq b = a;
- ITERATOR_T b_it = b.begin ();
-
- for (a_it = a.begin ();
- a_it != a.end ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, *b_it) != 0);
- }
-
- ::CORBA::StringSeq test;
- test.length (a.length ());
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- ITERATOR_T copytest_iter = test.begin ();
- for (ITERATOR_T copya_iter = a.begin ();
- copya_iter != a.end ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*copya_iter, *copytest_iter) != 0);
- }
-
- /// Testing - using ostream_iterator
- std::ostringstream ostream;
- std::copy (a.begin (),
- a.end (),
- std::ostream_iterator<CORBA::StringSeq::const_value_type> (ostream,
- "\n"));
-
- // The third sequence element has been modified. Either we need to restore
- // the original sequence values or modify the test here. I modified the
- // test since it's easier.
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem0\nelem1\nelem2\nelem3\n") != 0);
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename ITERATOR_T>
-int test_sequence_const_iterator ()
-{
- ::CORBA::StringSeq a;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test for correct behaviour for empty sequence
-
- FAIL_RETURN_IF (a.begin() != a.end ());
-
- // setup of an example sequence
-
- const char * elem0_cstr = "elem0";
- const char * elem1_cstr = "elem1";
- const char * elem2_cstr = "elem2";
- const char * elem3_cstr = "elem3";
-
- a.length (4);
- a[0] = CORBA::string_dup (elem0_cstr);
- a[0] = CORBA::string_dup (elem0_cstr);
- a[1] = CORBA::string_dup (elem1_cstr);
- a[2] = CORBA::string_dup (elem2_cstr);
- a[3] = CORBA::string_dup (elem3_cstr);
-
- // test iterator copy constructor
- ITERATOR_T a_it (a.begin ());
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test assignment operator
- a_it = a.begin ();
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test non const dereferencing
- // I'm not sure non-const deferencing makes sense since
- // we are getting an r value.
- const char * value0 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem0_cstr) != 0);
-
- // test const dereferencing
- const char* const value1 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value1, elem0_cstr) != 0);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.begin());
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem1_cstr) != 0);
-
- // test < operator
- FAIL_RETURN_IF (!(a.begin () < a_it));
- FAIL_RETURN_IF (a_it < a.begin ());
-
- // test difference type
- int a_diff = a_it - a.begin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.end ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem3_cstr) != 0);
-
- // test pre-decrement operator
- a_it = a.end ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem3_cstr) != 0);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.begin ();
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[0]) != 0);
- a_it += 2;
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[2]) != 0);
-
- // test for loop behaviour
- ::CORBA::StringSeq b = a;
- ITERATOR_T b_it = b.begin ();
-
- for (a_it = a.begin ();
- a_it != a.end ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, *b_it) != 0);
- }
-
- ::CORBA::StringSeq test;
- test.length (a.length ());
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- ITERATOR_T copytest_iter = test.begin ();
- for (ITERATOR_T copya_iter = a.begin ();
- copya_iter != a.end ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*copya_iter, *copytest_iter) != 0);
- }
-
- /// Testing - using ostream_iterator
- std::ostringstream ostream;
- std::copy (a.begin (),
- a.end (),
- std::ostream_iterator<CORBA::StringSeq::const_value_type>(ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem0\nelem1\nelem2\nelem3\n") != 0);
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename ITERATOR_T>
-int test_const_sequence ()
-{
- // setup of an example sequence
- const char * elem0_cstr = "elem0";
- const char * elem1_cstr = "elem1";
- const char * elem2_cstr = "elem2";
- const char * elem3_cstr = "elem3";
-
- ::CORBA::StringSeq setup;
- setup.length (4);
- setup[0] = CORBA::string_dup (elem0_cstr);
- setup[1] = CORBA::string_dup (elem1_cstr);
- setup[2] = CORBA::string_dup (elem2_cstr);
- setup[3] = CORBA::string_dup (elem3_cstr);
-
- const ::CORBA::StringSeq a = setup;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
- ITERATOR_T c_iter1 (a.begin ());
- ITERATOR_T c_iter2 = a.begin ();
- FAIL_RETURN_IF (!(c_iter1 == c_iter2));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test iterator copy constructor
- ITERATOR_T a_it (a.begin ());
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test non const dereferencing
- // JWH2 - This test shouldn't be done when dealing with
- // a const iterator (which we sometimes do with the current
- // testing setup).
- //typename ITERATOR_T::element_type value0 = *a_it;
- //FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem0_cstr) != 0);
-
- // test const dereferencing
- typename ITERATOR_T::const_element_type value1 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value1, elem0_cstr) != 0);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.begin());
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem1_cstr) != 0);
-
- // test < operator
- FAIL_RETURN_IF (!(a.begin () < a_it));
- FAIL_RETURN_IF (a_it < a.begin ());
-
- // test difference type
- int a_diff = a_it - a.begin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.end ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem3_cstr) != 0);
-
- // test pre-decrement operator
- a_it = a.end ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem3_cstr) != 0);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.begin ();
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[0]) != 0);
- a_it += 2;
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[2]) != 0);
-
- // test for loop behaviour
- const ::CORBA::StringSeq b = a;
- ITERATOR_T b_it = b.begin ();
-
- for (a_it = a.begin ();
- a_it != a.end ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, *b_it) != 0);
- }
-
- ::CORBA::StringSeq test;
- test.length (a.length ());
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- ITERATOR_T copytest_iter = test.begin ();
- for (ITERATOR_T copya_iter = a.begin ();
- copya_iter != a.end ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*copya_iter, *copytest_iter) != 0);
- }
-
- /// Testing - using ostream_iterator
- std::ostringstream ostream;
- std::copy (a.begin (),
- a.end (),
- std::ostream_iterator<CORBA::StringSeq::const_value_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem0\nelem1\nelem2\nelem3\n") != 0);
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename REVERSE_ITERATOR_T>
-int test_sequence_reverse ()
-{
- ::CORBA::StringSeq a;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test for correct behaviour for empty sequence
-
- FAIL_RETURN_IF (a.begin() != a.end ());
-
- // setup of an example sequence
- const char * elem0_cstr = "elem0";
- const char * elem1_cstr = "elem1";
- const char * elem2_cstr = "elem2";
- const char * elem3_cstr = "elem3";
-
- a.length (4);
- a[0] = CORBA::string_dup (elem0_cstr);
- a[1] = CORBA::string_dup (elem1_cstr);
- a[2] = CORBA::string_dup (elem2_cstr);
- a[3] = CORBA::string_dup (elem3_cstr);
-
- // test iterator copy constructor
- REVERSE_ITERATOR_T a_it (a.rbegin ());
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test assignment operator
- a_it = a.rbegin ();
-
- // Create a case to test for memory leaks
- // in the iterator.
- *a_it = CORBA::string_dup (elem3_cstr);
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test non const dereferencing
- typename REVERSE_ITERATOR_T::element_type value0 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem3_cstr) != 0);
-
- // test const dereferencing
- const char* const value1 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value1, elem3_cstr) != 0);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.rbegin());
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem2_cstr) != 0);
-
- // test < operator
- FAIL_RETURN_IF (!(a.rbegin () < a_it));
- FAIL_RETURN_IF (a_it < a.rbegin ());
-
- // test difference type
- int a_diff = a_it - a.rbegin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- REVERSE_ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- REVERSE_ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.rend ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem0_cstr) != 0);
-
- // test pre-decrement operator
- a_it = a.rend ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem0_cstr) != 0);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.rbegin ();
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[3]) != 0);
- a_it += 2;
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[1]) != 0);
-
- // test operator[] write
- a_it[0] = CORBA::string_dup (elem0_cstr);
- FAIL_RETURN_IF (ACE_OS::strcmp (a[1],elem0_cstr) != 0);
-
- // reset content of sequence a
- a[1] = CORBA::string_dup (elem1_cstr);
-
- // test for loop behaviour
- ::CORBA::StringSeq b = a;
- REVERSE_ITERATOR_T b_it = b.rbegin ();
-
- for (a_it = a.rbegin ();
- a_it != a.rend ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, *b_it) != 0);
- }
-
- ::CORBA::StringSeq test;
- test.length (a.length ());
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- REVERSE_ITERATOR_T copytest_iter = test.rbegin ();
- for (REVERSE_ITERATOR_T copya_iter = a.rbegin ();
- copya_iter != a.rend ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*copya_iter, *copytest_iter) != 0);
- }
-
- /// Testing - using ostream_iterator
- std::ostringstream ostream;
- std::copy (a.rbegin (),
- a.rend (),
- std::ostream_iterator<CORBA::StringSeq::element_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem3\nelem2\nelem1\nelem0\n") != 0);
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename REVERSE_ITERATOR_T>
-int test_sequence_reverse_const_iterator ()
-{
- ::CORBA::StringSeq a;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test for correct behaviour for empty sequence
-
- FAIL_RETURN_IF (a.begin() != a.end ());
-
- // setup of an example sequence
- const char * elem0_cstr = "elem0";
- const char * elem1_cstr = "elem1";
- const char * elem2_cstr = "elem2";
- const char * elem3_cstr = "elem3";
-
- a.length (4);
- a[0] = CORBA::string_dup (elem0_cstr);
- a[1] = CORBA::string_dup (elem1_cstr);
- a[2] = CORBA::string_dup (elem2_cstr);
- a[3] = CORBA::string_dup (elem3_cstr);
-
- // test iterator copy constructor
- REVERSE_ITERATOR_T a_it (a.rbegin ());
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test assignment operator
- a_it = a.rbegin ();
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test non const dereferencing
- typename REVERSE_ITERATOR_T::const_element_type value0 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem3_cstr) != 0);
-
- // test const dereferencing
- const char* const value1 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value1, elem3_cstr) != 0);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.rbegin());
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem2_cstr) != 0);
-
- // test < operator
- FAIL_RETURN_IF (!(a.rbegin () < a_it));
- FAIL_RETURN_IF (a_it < a.rbegin ());
-
- // test difference type
- int a_diff = a_it - a.rbegin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- REVERSE_ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- REVERSE_ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.rend ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem0_cstr) != 0);
-
- // test pre-decrement operator
- a_it = a.rend ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem0_cstr) != 0);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.rbegin ();
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[3]) != 0);
- a_it += 2;
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[1]) != 0);
-
- // test for loop behaviour
- ::CORBA::StringSeq b = a;
- REVERSE_ITERATOR_T b_it = b.rbegin ();
-
- for (a_it = a.rbegin ();
- a_it != a.rend ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, *b_it) != 0);
- }
-
- ::CORBA::StringSeq test;
- test.length (a.length ());
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- REVERSE_ITERATOR_T copytest_iter = test.rbegin ();
- for (REVERSE_ITERATOR_T copya_iter = a.rbegin ();
- copya_iter != a.rend ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*copya_iter, *copytest_iter) != 0);
- }
-
- /// Testing - using ostream_iterator
- std::ostringstream ostream;
- std::copy (a.rbegin (),
- a.rend (),
- std::ostream_iterator<CORBA::StringSeq::element_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem3\nelem2\nelem1\nelem0\n") != 0);
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename REVERSE_ITERATOR_T>
-int test_const_sequence_reverse ()
-{
- // setup of an example sequence
- const char * elem0_cstr = "elem0";
- const char * elem1_cstr = "elem1";
- const char * elem2_cstr = "elem2";
- const char * elem3_cstr = "elem3";
-
- ::CORBA::StringSeq setup;;
- setup.length (4);
- setup[0] = CORBA::string_dup (elem0_cstr);
- setup[1] = CORBA::string_dup (elem1_cstr);
- setup[2] = CORBA::string_dup (elem2_cstr);
- setup[3] = CORBA::string_dup (elem3_cstr);
-
- const ::CORBA::StringSeq a = setup;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test iterator copy constructor
- REVERSE_ITERATOR_T a_it (a.rbegin ());
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test non const dereferencing
- typename REVERSE_ITERATOR_T::const_element_type value0 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem3_cstr) != 0);
-
- // test const dereferencing
- const char* const value1 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value1, elem3_cstr) != 0);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.rbegin());
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem2_cstr) != 0);
-
- // test < operator
- FAIL_RETURN_IF (!(a.rbegin () < a_it));
- FAIL_RETURN_IF (a_it < a.rbegin ());
-
- // test difference type
- int a_diff = a_it - a.rbegin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- REVERSE_ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- REVERSE_ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.rend ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem0_cstr) != 0);
-
- // test pre-decrement operator
- a_it = a.rend ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, elem0_cstr) != 0);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.rbegin ();
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[3]) != 0);
- a_it += 2;
- FAIL_RETURN_IF (ACE_OS::strcmp (a_it[0],a[1]) != 0);
-
- // test for loop behaviour
- ::CORBA::StringSeq b = a;
- REVERSE_ITERATOR_T b_it = b.rbegin ();
-
- for (a_it = a.rbegin ();
- a_it != a.rend ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*a_it, *b_it) != 0);
- }
-
- ::CORBA::StringSeq test;
- test.length (a.length ());
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- REVERSE_ITERATOR_T copytest_iter = test.rbegin ();
- for (REVERSE_ITERATOR_T copya_iter = a.rbegin ();
- copya_iter != a.rend ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (ACE_OS::strcmp (*copya_iter, *copytest_iter) != 0);
- }
-
- /// Testing - using ostream_iterator
- std::ostringstream ostream;
- std::copy (a.rbegin (),
- a.rend (),
- std::ostream_iterator<CORBA::StringSeq::const_element_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem3\nelem2\nelem1\nelem0\n") != 0);
-
- return 0;
-}
-
-#endif
-
-//-----------------------------------------------------------------------------
-
-int ACE_TMAIN(int,ACE_TCHAR*[])
-{
- int status = 0;
-
-#if defined TAO_HAS_SEQUENCE_ITERATORS && TAO_HAS_SEQUENCE_ITERATORS == 1
-
- // Test Generic_Sequence_Iterator.
- status += test_sequence< ::CORBA::StringSeq::iterator> ();
-
- // g++ seems to make the conversion from iterator to const_iterator
- // and Windows doesn't. Not sure why.
- // Test Const_Generic_Sequence_Iterator with non-const sequence.
- status += test_sequence_const_iterator <
- ::CORBA::StringSeq::const_iterator> ();
-
- // Test Const_Generic_Sequence_Iterator with const sequence.
- status += test_const_sequence< ::CORBA::StringSeq::const_iterator> ();
-
- // Test Generic_Sequence_Reverse_Iterator.
- status += test_sequence_reverse< ::CORBA::StringSeq::reverse_iterator> ();
-
- // Test Const_Generic_Sequence_Reverse_Iterator with non-const sequence.
- status += test_sequence_reverse_const_iterator<
- ::CORBA::StringSeq::const_reverse_iterator> ();
-
- // Test Const_Generic_Sequence_Reverse_Iterator with const sequence.
- status += test_const_sequence_reverse<
- ::CORBA::StringSeq::const_reverse_iterator> ();
-#endif
-
- return status;
-}
diff --git a/TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp b/TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp
deleted file mode 100644
index c951b6e90a1..00000000000
--- a/TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp
+++ /dev/null
@@ -1,667 +0,0 @@
-/**
- * @file Unbounded_Objectref.cpp
- *
- * @brief test for STL iterator behaviour of CORBA unbounded object reference
- * sequence
- *
- * @author Friedhelm Wolf (fwolf@dre.vanderbilt.edu)
- */
-
-#include "ace/Log_Msg.h"
-
-#include <iostream>
-#include <iterator>
-#include <sstream>
-
-#include "tao/Object_Reference_Traits_T.h"
-#include "mock_reference.hpp"
-#include "tao/Unbounded_Object_Reference_Sequence_T.h"
-
-#define FAIL_RETURN_IF(CONDITION) \
- if (CONDITION) \
- { \
- ACE_DEBUG ((LM_ERROR, ACE_TEXT ("\tFailed at %N:%l\n"))); \
- return 1; \
- }
-
-#if defined TAO_HAS_SEQUENCE_ITERATORS && TAO_HAS_SEQUENCE_ITERATORS == 1
-
-typedef TAO::unbounded_object_reference_sequence<mock_reference, mock_reference_var> tested_sequence;
-
-template <typename ITERATOR_T>
-int test_sequence ()
-{
- tested_sequence a;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test for correct behaviour for empty sequence
-
- FAIL_RETURN_IF (a.begin() != a.end ());
-
- mock_reference* elem0 = mock_reference::allocate (0);
- mock_reference* elem1 = mock_reference::allocate (1);
- mock_reference* elem2 = mock_reference::allocate (2);
- mock_reference* elem3 = mock_reference::allocate (3);
-
- // setup of an example sequence
- a.length (4);
-
- a[0] = elem0;
- a[1] = elem1;
- a[2] = elem2;
- a[3] = elem3;
-
- // test iterator copy constructor
- ITERATOR_T a_it (a.begin ());
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test assignment operator
- a_it = a.begin ();
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test non const dereferencing
- mock_reference* value0 = *a_it;
- FAIL_RETURN_IF (value0->id () != elem0->id ());
-
- // test const dereferencing
- const mock_reference* const value1 = *a_it;
- FAIL_RETURN_IF (value1->id () != elem0->id ());
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.begin());
- FAIL_RETURN_IF ((*a_it)->id () != elem1->id ());
-
- // test < operator
- FAIL_RETURN_IF (!(a.begin () < a_it));
- FAIL_RETURN_IF (a_it < a.begin ());
-
- // test difference type
- int a_diff = a_it - a.begin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.end ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF ((*a_it)->id () != elem3->id ());
-
- // test pre-decrement operator
- a_it = a.end ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF ((*a_it)->id () != elem3->id ());
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.begin ();
- FAIL_RETURN_IF (a_it[0]->id () != a[0]->id ());
- a_it += 2;
- FAIL_RETURN_IF (a_it[0]->id () != a[2]->id ());
-
- // test for loop behaviour
- tested_sequence b = a;
- ITERATOR_T b_it = b.begin ();
-
- for (a_it = a.begin ();
- a_it != a.end ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF ((*a_it)->id () != (*b_it)->id ());
- }
-
- tested_sequence test;
- test.length (a.length ());
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- ITERATOR_T copytest_iter = test.begin ();
- for (ITERATOR_T copya_iter = a.begin ();
- copya_iter != a.end ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF ((*copya_iter)->id () != (*copytest_iter)->id ());
- }
-
- /// Testing - using ostream_iterator
- /// JWH2 - I don't think the ostream test makes sense for object references.
- /*
- std::ostringstream ostream;
- std::copy (a.begin (),
- a.end (),
- std::ostream_iterator<tested_sequence::value_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem0\nelem1\nelem2\nelem3\n") != 0);
- */
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename ITERATOR_T>
-int test_const_sequence ()
-{
- // setup of an example sequence
- tested_sequence setup;
- setup.length (4);
-
- mock_reference* elem0 = mock_reference::allocate (0);
- mock_reference* elem1 = mock_reference::allocate (1);
- mock_reference* elem2 = mock_reference::allocate (2);
- mock_reference* elem3 = mock_reference::allocate (3);
-
- // setup of an example sequence
- setup[0] = elem0;
- setup[1] = elem1;
- setup[2] = elem2;
- setup[3] = elem3;
-
- const tested_sequence a = setup;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test iterator copy constructor
- ITERATOR_T a_it (a.begin ());
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test assignment operator
- a_it = a.begin ();
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test non const dereferencing
- mock_reference* value0 = *a_it;
- FAIL_RETURN_IF (value0->id () != elem0->id ());
-
- // test const dereferencing
- const mock_reference* const value1 = *a_it;
- FAIL_RETURN_IF (value1->id () != elem0->id ());
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.begin());
- FAIL_RETURN_IF ((*a_it)->id () != elem1->id ());
-
- // test < operator
- FAIL_RETURN_IF (!(a.begin () < a_it));
- FAIL_RETURN_IF (a_it < a.begin ());
-
- // test difference type
- int a_diff = a_it - a.begin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.end ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF ((*a_it)->id () != elem3->id ());
-
- // test pre-decrement operator
- a_it = a.end ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF ((*a_it)->id () != elem3->id ());
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.begin ();
- FAIL_RETURN_IF ((a_it[0])->id () != a[0]->id ());
- a_it += 2;
- FAIL_RETURN_IF ((a_it[0])->id () != a[2]->id ());
-
- // test for loop behaviour
- tested_sequence b = a;
- ITERATOR_T b_it = b.begin ();
-
- for (a_it = a.begin ();
- a_it != a.end ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF ((*a_it)->id () != (*b_it)->id ());
- }
-
- tested_sequence test;
- test.length (4);
-
- /*
- * The copy call below causes double deletes and seg faults.
- */
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- ITERATOR_T copytest_iter = test.begin ();
- for (ITERATOR_T copya_iter = a.begin ();
- copya_iter != a.end ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF ((*copya_iter)->id () != (*copytest_iter)->id ());
- }
-
- /// Testing - using ostream_iterator
- /// JWH2 - I don't think the ostream test makes sense for object references.
- /*
- std::ostringstream ostream;
- std::copy (a.begin (),
- a.end (),
- std::ostream_iterator<tested_sequence::value_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem0\nelem1\nelem2\nelem3\n") != 0);
- */
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename REVERSE_ITERATOR_T>
-int test_sequence_reverse ()
-{
- tested_sequence a;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test for correct behaviour for empty sequence
-
- FAIL_RETURN_IF (a.begin() != a.end ());
-
- // setup of an example sequence
- a.length (4);
-
- mock_reference* elem0 = mock_reference::allocate (0);
- mock_reference* elem1 = mock_reference::allocate (1);
- mock_reference* elem2 = mock_reference::allocate (2);
- mock_reference* elem3 = mock_reference::allocate (3);
-
- // setup of an example sequence
- a.length (4);
- a[0] = elem0;
- a[1] = elem1;
- a[2] = elem2;
- a[3] = elem3;
-
- // test iterator copy constructor
- REVERSE_ITERATOR_T a_it (a.rbegin ());
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test assignment operator
- a_it = a.rbegin ();
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test non const dereferencing
- mock_reference* value0 = *a_it;
- FAIL_RETURN_IF (value0->id () != elem3->id ());
-
- // test const dereferencing
- const mock_reference* const value1 = *a_it;
- FAIL_RETURN_IF (value1->id () != elem3->id ());
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.rbegin());
- FAIL_RETURN_IF ((*a_it)->id () != elem2->id ());
-
- // test < operator
- FAIL_RETURN_IF (!(a.rbegin () < a_it));
- FAIL_RETURN_IF (a_it < a.rbegin ());
-
- // test difference type
- int a_diff = a_it - a.rbegin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- REVERSE_ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- REVERSE_ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.rend ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF ((*a_it)->id () != elem0->id ());
-
- // test pre-decrement operator
- a_it = a.rend ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF ((*a_it)->id () != elem0->id ());
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.rbegin ();
- FAIL_RETURN_IF ((a_it[0])->id () != a[3]->id ());
- a_it += 2;
- FAIL_RETURN_IF ((a_it[0])->id () != a[1]->id ());
-
- // test for loop behaviour
- tested_sequence b = a;
- REVERSE_ITERATOR_T b_it = b.rbegin ();
-
- for (a_it = a.rbegin ();
- a_it != a.rend ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF ((*a_it)->id () != (*b_it)->id ());
- }
-
- tested_sequence test;
- test.length (a.length ());
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- REVERSE_ITERATOR_T copytest_iter = test.rbegin ();
- for (REVERSE_ITERATOR_T copya_iter = a.rbegin ();
- copya_iter != a.rend ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF ((*copya_iter)->id () != (*copytest_iter)->id ());
- }
-
- /// Testing - using ostream_iterator
- /// JWH2 - I don't think the ostream test makes sense for object references.
- /*
- std::ostringstream ostream;
- std::copy (a.rbegin (),
- a.rend (),
- std::ostream_iterator<tested_sequence::value_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem3\nelem2\nelem1\nelem0\n") != 0);
- */
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename REVERSE_ITERATOR_T>
-int test_const_sequence_reverse ()
-{
- // setup of an example sequence
- tested_sequence setup;
- setup.length (4);
-
- mock_reference* elem0 = mock_reference::allocate (0);
- mock_reference* elem1 = mock_reference::allocate (1);
- mock_reference* elem2 = mock_reference::allocate (2);
- mock_reference* elem3 = mock_reference::allocate (3);
-
- // setup of an example sequence
- setup[0] = elem0;
- setup[1] = elem1;
- setup[2] = elem2;
- setup[3] = elem3;
-
- const tested_sequence a = setup;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test iterator copy constructor
- REVERSE_ITERATOR_T a_it (a.rbegin ());
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test assignment operator
- a_it = a.rbegin ();
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test non const dereferencing
- mock_reference* value0 = *a_it;
- FAIL_RETURN_IF (value0->id () != elem3->id ());
-
- // test const dereferencing
- const mock_reference* const value1 = *a_it;
- FAIL_RETURN_IF (value1->id () != elem3->id ());
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.rbegin());
- FAIL_RETURN_IF ((*a_it)->id () != elem2->id ());
-
- // test < operator
- FAIL_RETURN_IF (!(a.rbegin () < a_it));
- FAIL_RETURN_IF (a_it < a.rbegin ());
-
- // test difference type
- int a_diff = a_it - a.rbegin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- REVERSE_ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- REVERSE_ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.rend ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF ((*a_it)->id () != elem0->id ());
-
- // test pre-decrement operator
- a_it = a.rend ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF ((*a_it)->id () != elem0->id ());
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.rbegin ();
- FAIL_RETURN_IF ((a_it[0])->id () != a[3]->id ());
- a_it += 2;
- FAIL_RETURN_IF ((a_it[0])->id () != a[1]->id ());
-
- // test operator[] write
- // NOTE: This now changes the sequence a.
- // this is not possible for const iterators
- // a_it[0] = CORBA::string_dup (elem0_cstr);
- // FAIL_RETURN_IF (ACE_OS::strcmp (a[1],elem0_cstr) != 0);
-
- // reset content of sequence a
- //a[1] = CORBA::string_dup (elem1_cstr);
-
- // test for loop behaviour
- tested_sequence b = a;
- REVERSE_ITERATOR_T b_it = b.rbegin ();
-
- for (a_it = a.rbegin ();
- a_it != a.rend ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF ((*a_it)->id () != (*b_it)->id ());
- }
-
- tested_sequence test;
- test.length (a.length ());
-
- /*
- * The copy call below causes double deletes and seg faults.
- */
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- REVERSE_ITERATOR_T copytest_iter = test.rbegin ();
- for (REVERSE_ITERATOR_T copya_iter = a.rbegin ();
- copya_iter != a.rend ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF ((*copya_iter)->id () != (*copytest_iter)->id ());
- }
-
- /// Testing - using ostream_iterator
- /// JWH2 - I don't think the ostream test makes sense for object references.
- /*
- std::ostringstream ostream;
- std::copy (a.rbegin (),
- a.rend (),
- std::ostream_iterator<tested_sequence::value_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("elem3\nelem2\nelem1\nelem0\n") != 0);
- */
-
- return 0;
-}
-
-#endif
-
-//-----------------------------------------------------------------------------
-
-int ACE_TMAIN(int,ACE_TCHAR*[])
-{
- int status = 0;
-
-#if defined TAO_HAS_SEQUENCE_ITERATORS && TAO_HAS_SEQUENCE_ITERATORS == 1
-
- // Test Generic_Sequence_Iterator.
- status += test_sequence< tested_sequence::iterator> ();
-
- // g++ seems to make the conversion from iterator to const_iterator
- // and Windows doesn't. Not sure why.
- // Test Const_Generic_Sequence_Iterator with non-const sequence.
- status += test_sequence< tested_sequence::const_iterator> ();
-
- // Test Const_Generic_Sequence_Iterator with const sequence.
- status += test_const_sequence< tested_sequence::const_iterator> ();
-
- // Test Generic_Sequence_Reverse_Iterator.
- status += test_sequence_reverse< tested_sequence::reverse_iterator> ();
-
- // Test Const_Generic_Sequence_Reverse_Iterator with non-const sequence.
- status += test_sequence_reverse< tested_sequence::const_reverse_iterator> ();
-
- // Test Const_Generic_Sequence_Reverse_Iterator with const sequence.
- status += test_const_sequence_reverse< tested_sequence::const_reverse_iterator> ();
-
-#endif /* TAO_HAS_SEQUENCE_ITERATORS == 1 */
-
- return status;
-}
diff --git a/TAO/tests/Sequence_Iterators/Unbounded_Value.cpp b/TAO/tests/Sequence_Iterators/Unbounded_Value.cpp
deleted file mode 100644
index 682c27bd025..00000000000
--- a/TAO/tests/Sequence_Iterators/Unbounded_Value.cpp
+++ /dev/null
@@ -1,690 +0,0 @@
-/**
- * @file Unbounded_Value.cpp
- *
- * @brief test for STL iterator behaviour of CORBA bounded string sequence
- *
- * @author Friedhelm Wolf (fwolf@dre.vanderbilt.edu)
- */
-
-#include "tao/Unbounded_Value_Sequence_T.h"
-#include "ace/Log_Msg.h"
-
-#include <iostream>
-#include <iterator>
-#include <sstream>
-
-#if defined TAO_HAS_SEQUENCE_ITERATORS && TAO_HAS_SEQUENCE_ITERATORS == 1
-
-typedef TAO::unbounded_value_sequence<int> v_sequence;
-
-#define FAIL_RETURN_IF(CONDITION) \
- if (CONDITION) \
- { \
- ACE_DEBUG ((LM_ERROR, ACE_TEXT ("\tFailed at %N:%l\n"))); \
- return 1; \
- }
-
-template <typename ITERATOR_T>
-int test_sequence ()
-{
- v_sequence a;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test for correct behaviour for empty sequence
- FAIL_RETURN_IF (a.begin() != a.end ());
-
- // setup of an example sequence
- a.length (4);
-
- int elem0 = 0;
- int elem1 = 1;
- int elem2 = 2;
- int elem3 = 3;
-
- a[0] = elem0;
- a[1] = elem1;
- a[2] = elem2;
- a[3] = elem3;
-
- // test iterator copy constructor
- ITERATOR_T a_it (a.begin ());
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test assignment operator
- a_it = a.begin ();
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test non const dereferencing
- // JWH2 - I don't think this test makes sense. I believe the compiler
- // will always return a const value since the dereference is on
- // the right hand side of the assignment (i.e., r value).
- //int value0 = *a_it;
- //FAIL_RETURN_IF (value0 != elem0);
-
- // test const dereferencing
- int value1 = *a_it;
- FAIL_RETURN_IF (value1 != elem0);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.begin());
- FAIL_RETURN_IF (*a_it != elem1);
-
- // test < operator
- FAIL_RETURN_IF (!(a.begin () < a_it));
- FAIL_RETURN_IF (a_it < a.begin ());
-
- // test difference type
- int a_diff = a_it - a.begin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.end ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (*a_it != elem3);
-
- // test pre-decrement operator
- a_it = a.end ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (*a_it != elem3);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.begin ();
- FAIL_RETURN_IF (a_it[0] != a[0]);
- a_it += 2;
- FAIL_RETURN_IF (a_it[0] != a[2]);
-
- // test operator[] write
- // NOTE: This now changes the sequence a.
- // NOTE: This does not work for const_iterators
- // a_it[0] = elem0;
- // FAIL_RETURN_IF (a[2] != elem0);
-
- // reset content of sequence a
- //a[2] = elem2;
-
- // test for loop behaviour
- v_sequence b = a;
- ITERATOR_T b_it = b.begin ();
-
- for (a_it = a.begin ();
- a_it != a.end ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (*a_it != *b_it);
- }
-
- v_sequence test;
- test.length (4);
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- ITERATOR_T copytest_iter = test.begin ();
- for (ITERATOR_T copya_iter = a.begin ();
- copya_iter != a.end ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (*copya_iter != *copytest_iter);
- }
-
- /// Testing - using ostream_iterator
-
- std::ostringstream ostream;
- std::copy (a.begin (),
- a.end (),
- // JWH2 - I changed value_type to const_value_type. Is that
- // the correct approach?
- std::ostream_iterator<v_sequence::const_value_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("0\n1\n2\n3\n") != 0);
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename ITERATOR_T>
-int test_const_sequence ()
-{
- // setup of an example sequence
- v_sequence setup;
- setup.length (4);
-
- int elem0 = 0;
- int elem1 = 1;
- int elem2 = 2;
- int elem3 = 3;
-
- setup[0] = elem0;
- setup[1] = elem1;
- setup[2] = elem2;
- setup[3] = elem3;
-
- const v_sequence a = setup;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test iterator copy constructor
- ITERATOR_T a_it (a.begin ());
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test assignment operator
- a_it = a.begin ();
- FAIL_RETURN_IF (a_it != a.begin ());
-
- // test non const dereferencing
- // JWH2 - I don't think this test makes sense. I believe the compiler
- // will always return a const value since the dereference is on
- // the right hand side of the assignment (i.e., r value).
- //char* value0 = *a_it;
- //FAIL_RETURN_IF (value0 != elem0);
-
- // test const dereferencing
- int value1 = *a_it;
- FAIL_RETURN_IF (value1 != elem0);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.begin());
- FAIL_RETURN_IF (*a_it != elem1);
-
- // test < operator
- FAIL_RETURN_IF (!(a.begin () < a_it));
- FAIL_RETURN_IF (a_it < a.begin ());
-
- // test difference type
- int a_diff = a_it - a.begin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.end ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (*a_it != elem3);
-
- // test pre-decrement operator
- a_it = a.end ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.end ());
- FAIL_RETURN_IF ((a.end () - a_it) != 1);
- FAIL_RETURN_IF (*a_it != elem3);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.begin ();
- FAIL_RETURN_IF (a_it[0] != a[0]);
- a_it += 2;
- FAIL_RETURN_IF (a_it[0] != a[2]);
-
- // test operator[] write
- // NOTE: This now changes the sequence a.
- // NOTE: This does not work for const_iterators
- // a_it[0] = elem0;
- // FAIL_RETURN_IF (a[2] != elem0);
-
- // reset content of sequence a
- //a[2] = elem2;
-
- // test for loop behaviour
- v_sequence b = a;
- ITERATOR_T b_it = b.begin ();
-
- for (a_it = a.begin ();
- a_it != a.end ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (*a_it != *b_it);
- }
-
- v_sequence test;
- test.length (4);
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- ITERATOR_T copytest_iter = test.begin ();
- for (ITERATOR_T copya_iter = a.begin ();
- copya_iter != a.end ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (*copya_iter != *copytest_iter);
- }
-
- /// Testing - using ostream_iterator
-
- std::ostringstream ostream;
- std::copy (a.begin (),
- a.end (),
- // JWH2 - I changed value_type to const_value_type. Is that
- // the correct approach?
- std::ostream_iterator<v_sequence::const_value_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("0\n1\n2\n3\n") != 0);
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename REVERSE_ITERATOR_T>
-int test_sequence_reverse ()
-{
- v_sequence a;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test for correct behaviour for empty sequence
-
- FAIL_RETURN_IF (a.begin() != a.end ());
-
- // setup of an example sequence
- a.length (4);
-
- int elem0 = 0;
- int elem1 = 1;
- int elem2 = 2;
- int elem3 = 3;
-
- a[0] = elem0;
- a[1] = elem1;
- a[2] = elem2;
- a[3] = elem3;
-
- // test iterator copy constructor
- REVERSE_ITERATOR_T a_it (a.rbegin ());
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test assignment operator
- a_it = a.rbegin ();
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test non const dereferencing
- // JWH2 - I don't think this test makes sense. I believe the compiler
- // will always return a const value since the dereference is on
- // the right hand side of the assignment (i.e., r value).
- //int value0 = *a_it;
- //FAIL_RETURN_IF (value0 != elem3);
-
- // test const dereferencing
- int value1 = *a_it;
- FAIL_RETURN_IF (value1 != elem3);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.rbegin());
- FAIL_RETURN_IF (*a_it != elem2);
-
- // test < operator
- FAIL_RETURN_IF (!(a.rbegin () < a_it));
- FAIL_RETURN_IF (a_it < a.rbegin ());
-
- // test difference type
- int a_diff = a_it - a.rbegin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- REVERSE_ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- REVERSE_ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.rend ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (*a_it != elem0);
-
- // test pre-decrement operator
- a_it = a.rend ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (*a_it != elem0);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.rbegin ();
- FAIL_RETURN_IF (a_it[0] != a[3]);
- a_it += 2;
- FAIL_RETURN_IF (a_it[0] != a[1]);
-
- // test operator[] write
- // NOTE: This now changes the sequence a.
- // this is not possible for const iterators
- // a_it[0] = elem0;
- // FAIL_RETURN_IF (a[1] != elem0);
-
- // reset content of sequence a
- //a[1] = elem1;
-
- // test for loop behaviour
- v_sequence b = a;
- REVERSE_ITERATOR_T b_it = b.rbegin ();
-
- for (a_it = a.rbegin ();
- a_it != a.rend ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (*a_it != *b_it);
- }
-
- v_sequence test;
- test.length (a.length ());
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- REVERSE_ITERATOR_T copytest_iter = test.rbegin ();
- for (REVERSE_ITERATOR_T copya_iter = a.rbegin ();
- copya_iter != a.rend ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (*copya_iter != *copytest_iter);
- }
-
- /// Testing - using ostream_iterator
-
- std::ostringstream ostream;
- std::copy (a.rbegin (),
- a.rend (),
- // JWH2 - I changed value_type to const_value_type. Is that
- // the correct approach?
- std::ostream_iterator<v_sequence::const_value_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("3\n2\n1\n0\n") != 0);
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-template <typename REVERSE_ITERATOR_T>
-int test_const_sequence_reverse ()
-{
- // setup of an example sequence
- v_sequence setup;
- setup.length (4);
-
- int elem0 = 0;
- int elem1 = 1;
- int elem2 = 2;
- int elem3 = 3;
-
- setup[0] = elem0;
- setup[1] = elem1;
- setup[2] = elem2;
- setup[3] = elem3;
-
- const v_sequence a = setup;
-
- // test equality operator
- FAIL_RETURN_IF (!(a.begin () == a.begin ()));
-
- // test non-equality operator
- FAIL_RETURN_IF (a.end () != a.end ());
-
- // test iterator copy constructor
- REVERSE_ITERATOR_T a_it (a.rbegin ());
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test assignment operator
- a_it = a.rbegin ();
- FAIL_RETURN_IF (a_it != a.rbegin ());
-
- // test non const dereferencing
- // JWH2 - I don't think this test makes sense. I believe the compiler
- // will always return a const value since the dereference is on
- // the right hand side of the assignment (i.e., r value).
- //int value0 = *a_it;
- //FAIL_RETURN_IF (value0 != elem3);
-
- // test const dereferencing
- int value1 = *a_it;
- FAIL_RETURN_IF (value1 != elem3);
-
- // test increment operation
- a_it++;
- FAIL_RETURN_IF (a_it == a.rbegin());
- FAIL_RETURN_IF (*a_it != elem2);
-
- // test < operator
- FAIL_RETURN_IF (!(a.rbegin () < a_it));
- FAIL_RETURN_IF (a_it < a.rbegin ());
-
- // test difference type
- int a_diff = a_it - a.rbegin ();
- FAIL_RETURN_IF (a_diff != 1);
-
- // test copy constructor
- REVERSE_ITERATOR_T a_it1 (a_it);
- FAIL_RETURN_IF (a_it1 != a_it);
-
- // test preincrement operator
- ++a_it1;
- FAIL_RETURN_IF ((a_it1 - a_it) != 1);
-
- // test = and += operator
- REVERSE_ITERATOR_T a_it2 = a_it += 3;
- FAIL_RETURN_IF (a_it2 != a_it);
- FAIL_RETURN_IF ((a_it - a_it1) != 2);
-
- // test + operator
- a_it2 = a_it1 + 3;
- FAIL_RETURN_IF ((a_it2 - a_it1) != 3);
-
- // test post-decrement operation
- a_it = a.rend ();
- a_it--;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (*a_it != elem0);
-
- // test pre-decrement operator
- a_it = a.rend ();
- --a_it;
- FAIL_RETURN_IF (a_it == a.rend ());
- FAIL_RETURN_IF ((a.rend () - a_it) != 1);
- FAIL_RETURN_IF (*a_it != elem0);
-
- // test -= operator
- a_it -= 3;
- FAIL_RETURN_IF ((a_it1 - a_it) != 2);
-
- // test - operator
- a_it2 = a_it1 - 2;
- FAIL_RETURN_IF ((a_it1 - a_it2) != 2);
-
- // test operator[] read
- a_it = a.rbegin ();
- FAIL_RETURN_IF (a_it[0] != a[3]);
- a_it += 2;
- FAIL_RETURN_IF (a_it[0] != a[1]);
-
- // test operator[] write
- // NOTE: This now changes the sequence a.
- // this is not possible for const iterators
- // a_it[0] = elem0;
- // FAIL_RETURN_IF (a[1] != elem0);
-
- // reset content of sequence a
- //a[1] = elem1;
-
- // test for loop behaviour
- v_sequence b = a;
- REVERSE_ITERATOR_T b_it = b.rbegin ();
-
- for (a_it = a.rbegin ();
- a_it != a.rend ();
- a_it++, b_it++)
- {
- FAIL_RETURN_IF (*a_it != *b_it);
- }
-
- v_sequence test;
- test.length (a.length ());
-
- std::copy (a.begin (),
- a.end (),
- test.begin ());
-
- FAIL_RETURN_IF (test.length () != a.length ());
-
- REVERSE_ITERATOR_T copytest_iter = test.rbegin ();
- for (REVERSE_ITERATOR_T copya_iter = a.rbegin ();
- copya_iter != a.rend ();
- ++copya_iter, ++copytest_iter)
- {
- FAIL_RETURN_IF (*copya_iter != *copytest_iter);
- }
-
- /// Testing - using ostream_iterator
-
- std::ostringstream ostream;
- std::copy (a.rbegin (),
- a.rend (),
- // JWH2 - I changed value_type to const_value_type. Is that
- // the correct approach?
- std::ostream_iterator<v_sequence::const_value_type> (ostream,
- "\n"));
-
- FAIL_RETURN_IF (
- ostream.str ().compare ("3\n2\n1\n0\n") != 0);
-
- return 0;
-}
-
-#endif
-
-//-----------------------------------------------------------------------------
-
-int ACE_TMAIN(int,ACE_TCHAR*[])
-{
- int status = 0;
-
-#if defined TAO_HAS_SEQUENCE_ITERATORS && TAO_HAS_SEQUENCE_ITERATORS == 1
-
- // Test Generic_Sequence_Iterator.
- status += test_sequence<v_sequence::iterator> ();
-
- // g++ seems to make the conversion from iterator to const_iterator
- // and Windows doesn't. Not sure why.
- // Test Const_Generic_Sequence_Iterator with non-const sequence.
- status += test_sequence<v_sequence::const_iterator> ();
-
- // Test Const_Generic_Sequence_Iterator with const sequence.
- status += test_const_sequence<v_sequence::const_iterator> ();
-
- // Test Generic_Sequence_Reverse_Iterator.
- status += test_sequence_reverse<v_sequence::reverse_iterator> ();
-
- // Test Const_Generic_Sequence_Reverse_Iterator with non-const sequence.
- status += test_sequence_reverse<v_sequence::const_reverse_iterator> ();
-
- // Test Const_Generic_Sequence_Reverse_Iterator with const sequence.
- status += test_const_sequence_reverse<v_sequence::const_reverse_iterator> ();
-#endif
-
- return status;
-}
diff --git a/TAO/tests/Sequence_Iterators/mock_reference.cpp b/TAO/tests/Sequence_Iterators/mock_reference.cpp
deleted file mode 100644
index 02f2e999f85..00000000000
--- a/TAO/tests/Sequence_Iterators/mock_reference.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * @file
- *
- * @author Carlos O'Ryan <coryan@atdesk.com>
- */
-#include "mock_reference.hpp"
-
-TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-
-mock_reference::
-~mock_reference()
-{
-}
-
-mock_reference * mock_reference::
-allocate(int id)
-{
- return new mock_reference(id);
-}
-
-mock_reference * mock_reference::
-_nil()
-{
- return 0;
-}
-
-mock_reference * mock_reference::
-_duplicate(mock_reference * rhs)
-{
- if (rhs == 0)
- {
- return 0;
- }
- return new mock_reference(*rhs);
-}
-
-void mock_reference::
-_tao_release(mock_reference * rhs)
-{
- delete rhs;
-}
-
-void CORBA::release(mock_reference * r)
-{
- mock_reference::_tao_release(r);
-}
-
-mock_reference *
-TAO::Objref_Traits<mock_reference>::duplicate (
- mock_reference_ptr p
- )
-{
- return mock_reference::_duplicate (p);
-}
-
-void
-TAO::Objref_Traits<mock_reference>::release (
- mock_reference_ptr p
- )
-{
- CORBA::release (p);
-}
-
-mock_reference_ptr
-TAO::Objref_Traits<mock_reference>::nil (void)
-{
- return mock_reference::_nil ();
-}
-
-CORBA::Boolean
-TAO::Objref_Traits<mock_reference>::marshal (
- const mock_reference_ptr,
- TAO_OutputCDR &
- )
-{
- return true;
-}
-
-CORBA::Boolean operator<< (TAO_OutputCDR &, const mock_reference *)
-{
- return true;
-}
-CORBA::Boolean operator>> (TAO_InputCDR &, mock_reference *&)
-{
- return true;
-}
-
-TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tests/Sequence_Iterators/mock_reference.hpp b/TAO/tests/Sequence_Iterators/mock_reference.hpp
deleted file mode 100644
index 31ed319199c..00000000000
--- a/TAO/tests/Sequence_Iterators/mock_reference.hpp
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef guard_mock_reference_hpp
-#define guard_mock_reference_hpp
-/**
- * @file
- *
- * @brief Mock an object reference so we can test the sequences in
- * isolation.
- *
- * @author Carlos O'Ryan
- */
-#include "ace/config-all.h"
-
-#include "tao/Basic_Types.h"
-
-TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-// Forward declare the class a CORBA::release function for it. That
-// avoids having to introduce CORBA::Object into the tests.
-// Ideally the T_var and T_out types should accept mock objects
-// too, but that is too much to bite in the current iteration.
-class mock_reference;
-namespace CORBA
-{
-void release(mock_reference*);
-}
-
-class mock_stream;
-
-TAO_END_VERSIONED_NAMESPACE_DECL
-
-#include "tao/Objref_VarOut_T.h"
-
-TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-
-typedef mock_reference *mock_reference_ptr;
-typedef TAO_Objref_Var_T<mock_reference> mock_reference_var;
-typedef TAO_Objref_Out_T<mock_reference> mock_reference_out;
-
-/**
- * @class mock_reference
- *
- * @brief Implement a concrete class with the right interface for an
- * object reference.
- */
-class mock_reference
-{
-public:
- virtual ~mock_reference();
-
- typedef mock_reference_var _var_type;
- typedef mock_reference_out _out_type;
-
- static mock_reference * allocate(int id);
- static mock_reference * _nil();
-
- static mock_reference * _duplicate(mock_reference * rhs);
- static void _tao_release(mock_reference * rhs);
-
- inline bool operator==(mock_reference const & rhs) const
- {
- return id_ == rhs.id_;
- }
-
- inline bool operator!=(mock_reference const & rhs) const
- {
- return !(*this == rhs);
- }
-
- inline int id() const
- {
- return id_;
- }
-
-private:
- mock_reference ();
-
- inline mock_reference(int id)
- : id_(id)
- {}
-
-private:
- int id_;
-};
-
-CORBA::Boolean operator<< (TAO_OutputCDR &, const mock_reference *);
-CORBA::Boolean operator>> (TAO_InputCDR &, mock_reference *&);
-
-namespace TAO
-{
- template<>
- struct Objref_Traits< mock_reference>
- {
- static mock_reference_ptr duplicate (mock_reference_ptr);
- static void release (mock_reference_ptr);
- static mock_reference_ptr nil (void);
- static CORBA::Boolean marshal (const mock_reference_ptr p, TAO_OutputCDR & cdr);
- };
-}
-
-TAO_END_VERSIONED_NAMESPACE_DECL
-#endif // guard_mock_reference_hpp
diff --git a/TAO/tests/Sequence_Iterators/run_test.pl b/TAO/tests/Sequence_Iterators/run_test.pl
deleted file mode 100755
index e9cb5343e72..00000000000
--- a/TAO/tests/Sequence_Iterators/run_test.pl
+++ /dev/null
@@ -1,45 +0,0 @@
-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
- & eval 'exec perl -S $0 $argv:q'
- if 0;
-
-# -*- perl -*-
-
-use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::TestTarget;
-use strict;
-
-my $final_result = 0;
-
-my @testsToRun = qw(
- StringSeq
- Bounded_String
- Unbounded_Value
- Unbounded_Objectref
- );
-
-foreach my $process (@testsToRun) {
-
- my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
- my $P = $server->CreateProcess ($process);
- print "Running $process ...\n";
- my $result = $P->Spawn;
- if ($result != 0) {
- print "FAILED $process\n";
- $final_result = 1;
- next;
- }
- $result = $P->WaitKill($server->ProcessStartWaitInterval());
- if ($result != 0) {
- print "FAILED $process\n";
- $final_result = 1;
- next;
- }
- print "SUCCESS\n";
-}
-
-exit $final_result;
-
-
-
-
-
diff --git a/TAO/tests/Sequence_Iterators/testing_counters.hpp b/TAO/tests/Sequence_Iterators/testing_counters.hpp
deleted file mode 100644
index fd190f2ec47..00000000000
--- a/TAO/tests/Sequence_Iterators/testing_counters.hpp
+++ /dev/null
@@ -1,104 +0,0 @@
-#ifndef guard_testing_counters_hpp
-#define guard_testing_counters_hpp
-/**
- * @file
- *
- * @brief Some unit tests need to count how many times a function is
- * called. Here we implement some simple helper classes for that
- * purpose.
- *
- * @author Carlos O'Ryan
- */
-
-#include "testing_exception.hpp"
-
-#include <boost/utility.hpp>
-
-#include <iostream>
-
-/**
- * @brief Used to count how many times a function gets called. The
- * unit test should create one instance per function.
- */
-class call_counter
-{
-public:
- inline call_counter()
- : count_(0)
- , failure_countdown_(0)
- {}
-
- inline long current_count() const
- {
- return count_;
- }
-
- inline void failure_countdown(long countdown)
- {
- failure_countdown_ = countdown;
- }
-
- inline void operator()()
- {
- ++count_;
- if (--failure_countdown_ == 0)
- {
- throw testing_exception();
- }
- }
-
-private:
- long count_;
- long failure_countdown_;
-};
-
-/**
- * @brief Used to detect if a testing_counter is "called" the right
- * number of times.
- */
-class expected_calls
- : private boost::noncopyable
-{
-public:
- inline expected_calls(call_counter const & counter)
- : current_count_(counter.current_count())
- , previous_count_(counter.current_count())
- , counter_(counter)
- { }
-
- inline bool expect(long n)
- {
- reset();
- return (previous_count_ + n == current_count_);
- }
-
- inline void reset()
- {
- previous_count_ = current_count_;
- current_count_ = counter_.current_count();
- }
-
- inline long current_count() const
- {
- return current_count_;
- }
-
- inline long previous_count() const
- {
- return previous_count_;
- }
-
-private:
- long current_count_;
- long previous_count_;
- call_counter const & counter_;
-};
-
-inline std::ostream & operator<<(std::ostream & os, expected_calls const & x)
-{
- return os << "current=" << x.current_count()
- << ",previous=" << x.previous_count();
-
-}
-
-#endif // guard_testing_counters_hpp
diff --git a/TAO/tests/Sequence_Iterators/testing_exception.hpp b/TAO/tests/Sequence_Iterators/testing_exception.hpp
deleted file mode 100644
index 8423204bfbb..00000000000
--- a/TAO/tests/Sequence_Iterators/testing_exception.hpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef guard_testing_exception_hpp
-#define guard_testing_exception_hpp
-/**
- * @file
- *
- * @brief Simple exception to raise in the tests.
- *
- * @author Carlos O'Ryan
- */
-
-struct testing_exception {};
-
-#endif // guard_testing_exception_hpp
diff --git a/TAO/tests/Stack_Recursion/README b/TAO/tests/Stack_Recursion/README
index e0434613745..6f0eb8495dd 100644
--- a/TAO/tests/Stack_Recursion/README
+++ b/TAO/tests/Stack_Recursion/README
@@ -44,7 +44,7 @@ End Comment added August 14, 2007 <wilsond@ociweb.com>
A stress test for the stack recursion outlined in the bugzilla
under id 1125. Here is the link for the bug
-http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=1125
+http://bugzilla.dre.vanderbilt.edu/show_bug.cgi?id=1125
This test is designed to show the bug. The test has a server running 4
threads and clients running 16 threads requesting around 30 MB of
diff --git a/TAO/tests/TransportCurrent/lib/Server_Request_Interceptor.h b/TAO/tests/TransportCurrent/lib/Server_Request_Interceptor.h
index bbcd2f7d8e1..3830c787546 100644
--- a/TAO/tests/TransportCurrent/lib/Server_Request_Interceptor.h
+++ b/TAO/tests/TransportCurrent/lib/Server_Request_Interceptor.h
@@ -84,16 +84,13 @@ namespace Test
//@}
protected:
-
/// The number of requests intercepted by this interceptor.
CORBA::ULong request_count_;
CORBA::String_var orb_id_;
TEST test_;
-
};
-
}
#endif /* SERVER_REQUEST_INTERCEPTOR_H */