summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2006-10-26 11:47:27 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2006-10-26 11:47:27 +0000
commit351146d4983d966f42449913d6b8649dde4b728a (patch)
treeecdeb49baa67fe38931f00db89261f43e2b5d8d7
parent84fbe54fd368012af0ac1831bd288ec4061a4e3a (diff)
downloadATCD-351146d4983d966f42449913d6b8649dde4b728a.tar.gz
-rw-r--r--TAO/orbsvcs/tests/Event/UDP/Consumer.cpp10
-rw-r--r--TAO/orbsvcs/tests/Event/UDP/Consumer.h1
-rw-r--r--TAO/orbsvcs/tests/Event/UDP/Supplier.cpp4
-rw-r--r--TAO/orbsvcs/tests/Event/UDP/Supplier.h2
-rw-r--r--TAO/orbsvcs/tests/Event/UDP/receiver.cpp4
-rwxr-xr-xTAO/orbsvcs/tests/Event/UDP/run_test.pl8
-rw-r--r--TAO/orbsvcs/tests/Event/UDP/sender.cpp4
7 files changed, 22 insertions, 11 deletions
diff --git a/TAO/orbsvcs/tests/Event/UDP/Consumer.cpp b/TAO/orbsvcs/tests/Event/UDP/Consumer.cpp
index 596acc11938..a4152a7aae8 100644
--- a/TAO/orbsvcs/tests/Event/UDP/Consumer.cpp
+++ b/TAO/orbsvcs/tests/Event/UDP/Consumer.cpp
@@ -16,6 +16,12 @@ Consumer::Consumer (bool valuetype)
{
}
+CORBA::ULong
+Consumer::event_count (void) const
+{
+ return this->event_count_;
+}
+
void
Consumer::connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin
ACE_ENV_ARG_DECL)
@@ -90,10 +96,10 @@ Consumer::push (const RtecEventComm::EventSet& events
return;
}
- this->event_count_ += events.length ();
-
for (size_t i = 0; i < events.length (); ++i)
{
+ ++this->event_count_;
+
if (this->valuetype_)
{
ValueTypeData * test_data = 0;
diff --git a/TAO/orbsvcs/tests/Event/UDP/Consumer.h b/TAO/orbsvcs/tests/Event/UDP/Consumer.h
index 8d00da9a766..84de97e1df1 100644
--- a/TAO/orbsvcs/tests/Event/UDP/Consumer.h
+++ b/TAO/orbsvcs/tests/Event/UDP/Consumer.h
@@ -53,6 +53,7 @@ public:
ACE_THROW_SPEC ((CORBA::SystemException));
// The skeleton methods.
+ CORBA::ULong event_count (void) const;
private:
CORBA::ULong event_count_;
// Keep track of the number of events received.
diff --git a/TAO/orbsvcs/tests/Event/UDP/Supplier.cpp b/TAO/orbsvcs/tests/Event/UDP/Supplier.cpp
index b12ce21200e..6fff5e241a8 100644
--- a/TAO/orbsvcs/tests/Event/UDP/Supplier.cpp
+++ b/TAO/orbsvcs/tests/Event/UDP/Supplier.cpp
@@ -10,7 +10,7 @@ ACE_RCSID (EC_Examples,
Supplier,
"$Id$")
-Supplier::Supplier (bool valuetype) : valuetype_ (valuetype)
+Supplier::Supplier (bool valuetype) : valuetype_ (valuetype), event_count_ (0)
{
}
@@ -72,6 +72,8 @@ Supplier::perform_push (ACE_ENV_SINGLE_ARG_DECL)
ACE_TRY
{
// The event type and source must match our publications
+ ++event_count_;
+ ACE_DEBUG ((LM_DEBUG, "Sending event %d\n", event_count_));
RtecEventComm::EventSet event (1);
event.length (1);
event[0].header.type = ACE_ES_EVENT_UNDEFINED;
diff --git a/TAO/orbsvcs/tests/Event/UDP/Supplier.h b/TAO/orbsvcs/tests/Event/UDP/Supplier.h
index f773b9f9237..eae15e57257 100644
--- a/TAO/orbsvcs/tests/Event/UDP/Supplier.h
+++ b/TAO/orbsvcs/tests/Event/UDP/Supplier.h
@@ -59,6 +59,8 @@ private:
// The proxy
bool valuetype_;
+
+ CORBA::ULong event_count_;
};
#endif /* SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Event/UDP/receiver.cpp b/TAO/orbsvcs/tests/Event/UDP/receiver.cpp
index 440ec66bb30..fa0be235577 100644
--- a/TAO/orbsvcs/tests/Event/UDP/receiver.cpp
+++ b/TAO/orbsvcs/tests/Event/UDP/receiver.cpp
@@ -245,7 +245,7 @@ main (int argc, char* argv[])
// Wait for events, including incoming multicast data.
// We could also use orb->run(), but that will not let us
// terminate the application in a nice way.
- for (int i = 0; i != 1000; ++i)
+ for (int i = 0; i != 100; ++i)
{
CORBA::Boolean there_is_work =
orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER);
@@ -275,7 +275,7 @@ main (int argc, char* argv[])
receiver->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- int r = mcast_eh.shutdown ();
+ int const r = mcast_eh.shutdown ();
if (r == -1)
{
diff --git a/TAO/orbsvcs/tests/Event/UDP/run_test.pl b/TAO/orbsvcs/tests/Event/UDP/run_test.pl
index fd33d4ee5ad..ad98e46a979 100755
--- a/TAO/orbsvcs/tests/Event/UDP/run_test.pl
+++ b/TAO/orbsvcs/tests/Event/UDP/run_test.pl
@@ -20,13 +20,13 @@ $S = new PerlACE::Process ("sender",
$R = new PerlACE::Process ("receiver",
"$valuetype");
-print STDOUT "Starting sender\n";
-$S->Spawn ();
+print STDOUT "Starting receiver\n";
+$R->Spawn ();
sleep 1;
-print STDOUT "Starting receiver\n";
-$R->Spawn ();
+print STDOUT "Starting sender\n";
+$S->Spawn ();
sleep 1;
diff --git a/TAO/orbsvcs/tests/Event/UDP/sender.cpp b/TAO/orbsvcs/tests/Event/UDP/sender.cpp
index ccec0abef4f..6f3f7e3ddee 100644
--- a/TAO/orbsvcs/tests/Event/UDP/sender.cpp
+++ b/TAO/orbsvcs/tests/Event/UDP/sender.cpp
@@ -196,7 +196,7 @@ main (int argc, char* argv[])
// Wait for events, including incoming multicast data.
// We could also use orb->run(), but that will not let us
// terminate the application in a nice way.
- for (int i = 0; i != 1000; ++i)
+ for (int i = 0; i != 25; ++i)
{
CORBA::Boolean there_is_work =
orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER);
@@ -267,7 +267,7 @@ main (int argc, char* argv[])
// **************** THAT COMPLETES THE CLEANUP CODE
ACE_DEBUG ((LM_DEBUG,
- "MCast example terminated\n"));
+ "MCast example ready\n"));
}
ACE_CATCHANY
{