summaryrefslogtreecommitdiff
path: root/TAO/tests
diff options
context:
space:
mode:
authorcleeland <cleeland@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-02-26 21:04:17 +0000
committercleeland <cleeland@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-02-26 21:04:17 +0000
commit12a7cc0476128faf148c159fc4837f13e5abe429 (patch)
treee0be35e5872dc8fb410bd09d799138f97ed93b0e /TAO/tests
parent8750bcaf6bd3a5de5088ff527bf988d155ffb71a (diff)
downloadATCD-12a7cc0476128faf148c159fc4837f13e5abe429.tar.gz
* tests/NestedUpcall/client.cpp: Added calls to invoke the new
decrement operation. * tests/NestedUpcall/Reactor.idl: Added a new operation, decrement, to test multi-nested upcalls. * tao/connect.cpp (send_request): Fixed to return appropriate return values, especially in case of errors.
Diffstat (limited to 'TAO/tests')
-rw-r--r--TAO/tests/NestedUpcall/Reactor.idl10
-rw-r--r--TAO/tests/NestedUpcall/client.cpp4
-rw-r--r--TAO/tests/NestedUpcall/eh_i.cpp18
-rw-r--r--TAO/tests/NestedUpcall/eh_i.h6
-rw-r--r--TAO/tests/NestedUpcall/reactor_i.cpp17
-rw-r--r--TAO/tests/NestedUpcall/reactor_i.h6
6 files changed, 60 insertions, 1 deletions
diff --git a/TAO/tests/NestedUpcall/Reactor.idl b/TAO/tests/NestedUpcall/Reactor.idl
index 015ed72bec1..50dc56a61de 100644
--- a/TAO/tests/NestedUpcall/Reactor.idl
+++ b/TAO/tests/NestedUpcall/Reactor.idl
@@ -21,11 +21,17 @@
//
// ============================================================================
+interface Reactor;
+
interface EventHandler
{
Long peer ();
// Returns an integer corresponding to the event handler's file
// descriptor.
+
+ UShort decrement (in Reactor r, in UShort num);
+ // Decrements <num> by invoking the <decrement> operation on <r>
+ // and returning that value, finally stopping when it gets to zero.
};
interface Reactor
@@ -35,4 +41,8 @@ interface Reactor
oneway void set_value ();
// do-nothing oneway to check for proper operation.
+
+ UShort decrement (in EventHandler eh, in UShort num);
+ // Decrements <num> by invoking the <decrement> operation on <eh>
+ // and returning that value, finally stopping when it gets to zero.
};
diff --git a/TAO/tests/NestedUpcall/client.cpp b/TAO/tests/NestedUpcall/client.cpp
index 03dfb40b76f..9a0aae552ec 100644
--- a/TAO/tests/NestedUpcall/client.cpp
+++ b/TAO/tests/NestedUpcall/client.cpp
@@ -155,7 +155,9 @@ main (int argc, char *argv[])
remote_reactor->set_value (TAO_TRY_ENV);
TAO_CHECK_ENV;
-
+
+ remote_reactor->decrement (eh, 5, TAO_TRY_ENV);
+ TAO_CHECK_ENV;
}
TAO_CATCHANY
{
diff --git a/TAO/tests/NestedUpcall/eh_i.cpp b/TAO/tests/NestedUpcall/eh_i.cpp
index 493f0622882..8066d840ce8 100644
--- a/TAO/tests/NestedUpcall/eh_i.cpp
+++ b/TAO/tests/NestedUpcall/eh_i.cpp
@@ -26,3 +26,21 @@ EventHandler_i::peer (CORBA::Environment &env)
return val;
}
+
+CORBA::UShort
+EventHandler_i::decrement (Reactor_ptr eh,
+ CORBA::UShort num,
+ CORBA::Environment &env)
+{
+ CORBA::UShort ret;
+ if (--num <= 0)
+ ret = 0;
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) EventHandler::decrement() invoking Reactor::decrement(%d)\n", num));
+ ret = eh->decrement (_this (env), num, env);
+ }
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) EventHandler::decrement() returning %d\n", ret));
+ return ret;
+}
+
diff --git a/TAO/tests/NestedUpcall/eh_i.h b/TAO/tests/NestedUpcall/eh_i.h
index 79464871ed2..3be2aa8f3ca 100644
--- a/TAO/tests/NestedUpcall/eh_i.h
+++ b/TAO/tests/NestedUpcall/eh_i.h
@@ -19,6 +19,12 @@ public:
virtual CORBA::Long peer (CORBA::Environment &env);
// Return some value...doesn't matter what.
+
+ virtual CORBA::UShort decrement (Reactor_ptr eh,
+ CORBA::UShort num,
+ CORBA::Environment &env);
+ // deccrement <num> by calling decrement thru <eh> until zero is
+ // reached, then return.
};
#endif /* EVENTHANDLER_I_H */
diff --git a/TAO/tests/NestedUpcall/reactor_i.cpp b/TAO/tests/NestedUpcall/reactor_i.cpp
index 5e3ec28bf37..7b0f16a97f0 100644
--- a/TAO/tests/NestedUpcall/reactor_i.cpp
+++ b/TAO/tests/NestedUpcall/reactor_i.cpp
@@ -50,3 +50,20 @@ Reactor_i::set_value (CORBA::Environment &env)
"(%P|%t) doing Reactor_i::set_value()\n"));
}
+CORBA::UShort
+Reactor_i::decrement (EventHandler_ptr eh,
+ CORBA::UShort num,
+ CORBA::Environment &env)
+{
+ CORBA::UShort ret;
+ if (--num <= 0)
+ ret = 0;
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reactor::decrement() invoking EventHandler::decrement(%d)\n", num));
+ ret = eh->decrement (_this (env), num, env);
+ }
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reactor_i::decrement() returning %d\n", ret));
+ return ret;
+}
+
diff --git a/TAO/tests/NestedUpcall/reactor_i.h b/TAO/tests/NestedUpcall/reactor_i.h
index e6a8e130a0f..ac4ca1e6b06 100644
--- a/TAO/tests/NestedUpcall/reactor_i.h
+++ b/TAO/tests/NestedUpcall/reactor_i.h
@@ -22,6 +22,12 @@ public:
// Register (with nothing...it's an example!)
virtual void set_value (CORBA::Environment &env);
+
+ virtual CORBA::UShort decrement (EventHandler_ptr eh,
+ CORBA::UShort num,
+ CORBA::Environment &env);
+ // deccrement <num> by calling decrement thru <eh> until zero is
+ // reached, then return.
};
#endif /* REACTOR_I_H */