summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2020-12-09 12:18:58 +0100
committerJohnny Willemsen <jwillemsen@remedy.nl>2020-12-09 12:18:58 +0100
commitc84a7d460a4b48011af7fd044442991cb69f910b (patch)
tree7f3a408cbbca0b5cb990ea740ed730a585b8258e
parent396f0d4b04a3d4c89c009013ca20cf4d4e5e32f7 (diff)
downloadATCD-c84a7d460a4b48011af7fd044442991cb69f910b.tar.gz
Added result which is propagated to the interceptors so that errors are reported back to the test script instead of a manual log check
* TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp: * TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h: * TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp: * TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.h: * TAO/tests/Portable_Interceptors/Dynamic/client.cpp: * TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp: * TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h: * TAO/tests/Portable_Interceptors/Dynamic/run_test.pl: * TAO/tests/Portable_Interceptors/Dynamic/server.cpp: * TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp: * TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h: * TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp: * TAO/tests/Portable_Interceptors/Dynamic/test_i.h:
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp6
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h5
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp6
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.h5
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/client.cpp6
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp15
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h4
-rwxr-xr-xTAO/tests/Portable_Interceptors/Dynamic/run_test.pl2
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/server.cpp5
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp8
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h4
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp3
-rw-r--r--TAO/tests/Portable_Interceptors/Dynamic/test_i.h16
13 files changed, 55 insertions, 30 deletions
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp
index 709afbce4a5..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,7 +25,7 @@ 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
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h
index 0cb32f35ee9..4a6ed849fed 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h
+++ b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h
@@ -27,9 +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 df9a27cff39..c611cdf28eb 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.h
+++ b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.h
@@ -27,9 +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/client.cpp b/TAO/tests/Portable_Interceptors/Dynamic/client.cpp
index 3c0f7f4e3e5..0917bb12eaf 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/client.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/client.cpp
@@ -79,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
@@ -86,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;
@@ -126,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 fa6b5ec4e1e..5249375a979 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp
@@ -8,15 +8,15 @@
#include "ace/Log_Msg.h"
#include <cstring>
-Echo_Client_Request_Interceptor::Echo_Client_Request_Interceptor ()
- : myname_ ("Echo_Client_Interceptor")
+Echo_Client_Request_Interceptor::Echo_Client_Request_Interceptor (int& result)
+ : result_ (result)
{
}
char *
Echo_Client_Request_Interceptor::name ()
{
- return CORBA::string_dup (this->myname_);
+ return CORBA::string_dup ("Echo_Client_Interceptor");
}
void
@@ -47,6 +47,7 @@ Echo_Client_Request_Interceptor::send_request (PortableInterceptor::ClientReques
if (!catched_exception)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR, no exception when getting reply status\n"));
}
@@ -65,6 +66,7 @@ Echo_Client_Request_Interceptor::send_request (PortableInterceptor::ClientReques
if (paramlist->length () != 2)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) All parameters not available\n"));
}
@@ -84,6 +86,7 @@ Echo_Client_Request_Interceptor::send_request (PortableInterceptor::ClientReques
if (param != 10)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR in send_request while checking "
"the value of the extracted "
@@ -93,6 +96,7 @@ Echo_Client_Request_Interceptor::send_request (PortableInterceptor::ClientReques
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"
@@ -140,6 +144,7 @@ Echo_Client_Request_Interceptor::receive_reply (PortableInterceptor::ClientReque
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"));
}
@@ -149,6 +154,7 @@ Echo_Client_Request_Interceptor::receive_reply (PortableInterceptor::ClientReque
if (param != 10)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR in send_request while checking "
"the value of the extracted "
@@ -163,6 +169,7 @@ Echo_Client_Request_Interceptor::receive_reply (PortableInterceptor::ClientReque
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 "
@@ -195,7 +202,7 @@ Echo_Client_Request_Interceptor::receive_reply (PortableInterceptor::ClientReque
{
CORBA::Any_var a = ri->result ();
- const Test_Interceptors::Visual::VarLenStruct * v = 0;
+ const Test_Interceptors::Visual::VarLenStruct * v = nullptr;
(a.in ()) >>= v;
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h b/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h
index 47fa87db7bc..939e199f681 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h
+++ b/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h
@@ -21,7 +21,7 @@ class Echo_Client_Request_Interceptor
public virtual ::CORBA::LocalObject
{
public:
- Echo_Client_Request_Interceptor ();
+ Echo_Client_Request_Interceptor (int& result);
// Canonical name of the interceptor.
char * name () override;
@@ -42,7 +42,7 @@ protected:
~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 824a5773e98..809cd868d40 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/server.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/server.cpp
@@ -34,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
@@ -41,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;
@@ -114,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 fa5f7f1a060..94732fb8af7 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp
+++ b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp
@@ -8,15 +8,15 @@
#include "ace/Log_Msg.h"
#include <cstring>
-Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor ()
- : myname_ ("Echo_Server_Interceptor")
+Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (int& result)
+ : result_ (result)
{
}
char *
Echo_Server_Request_Interceptor::name ()
{
- return CORBA::string_dup (this->myname_);
+ return CORBA::string_dup ("Echo_Server_Interceptor");
}
void
@@ -48,6 +48,7 @@ Echo_Server_Request_Interceptor::receive_request (
if (!catched_exception)
{
+ ++this->result_;
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR, no exception when getting reply status\n"));
}
@@ -76,6 +77,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"
diff --git a/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h
index d7f728aab4f..b0a99af2ab6 100644
--- a/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h
+++ b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h
@@ -21,7 +21,7 @@ class Echo_Server_Request_Interceptor
public virtual ::CORBA::LocalObject
{
public:
- Echo_Server_Request_Interceptor ();
+ Echo_Server_Request_Interceptor (int& result);
// Canonical name of the interceptor.
char * name () override;
@@ -42,7 +42,7 @@ protected:
~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 fa50e082f1c..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,
@@ -25,7 +24,7 @@ Visual_i::calculate (CORBA::Long one,
Test_Interceptors::Visual::VarLenStruct *
Visual_i::the_structure ()
{
- Test_Interceptors::Visual::VarLenStruct * s;
+ Test_Interceptors::Visual::VarLenStruct * s = nullptr;
ACE_NEW_THROW_EX (s,
Test_Interceptors::Visual::VarLenStruct,
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 */