summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhuangming <huangminghuang@users.noreply.github.com>2003-11-30 04:04:18 +0000
committerhuangming <huangminghuang@users.noreply.github.com>2003-11-30 04:04:18 +0000
commitbde1f6d73d8f61df5b905720efd71f81da02ab90 (patch)
tree93596b085c0e733cfbcd2a4156183cfb0fc736a0
parent7e028127eaf88f75d886aad86f8c10cb96bbb528 (diff)
downloadATCD-bde1f6d73d8f61df5b905720efd71f81da02ab90.tar.gz
*** empty log message ***
-rw-r--r--TAO/orbsvcs/tests/FtRtEvent/FtRtEvent_Test.cpp8
-rw-r--r--TAO/orbsvcs/tests/FtRtEvent/FtRtEvent_Test.h1
-rw-r--r--TAO/orbsvcs/tests/FtRtEvent/PushConsumer.cpp8
-rw-r--r--TAO/orbsvcs/tests/FtRtEvent/PushConsumer.h2
4 files changed, 17 insertions, 2 deletions
diff --git a/TAO/orbsvcs/tests/FtRtEvent/FtRtEvent_Test.cpp b/TAO/orbsvcs/tests/FtRtEvent/FtRtEvent_Test.cpp
index 65abe159a01..3909e3838b5 100644
--- a/TAO/orbsvcs/tests/FtRtEvent/FtRtEvent_Test.cpp
+++ b/TAO/orbsvcs/tests/FtRtEvent/FtRtEvent_Test.cpp
@@ -23,6 +23,7 @@ FtRtEvent_Test_Base::FtRtEvent_Test_Base()
: gateway_(0)
, use_gateway_(1)
{
+ options_.num_events = -1;
options_.num_iterations=100;
options_.timer_interval.set(1,0);
options_.proxy_consumer_file="consumer.ior";
@@ -36,7 +37,7 @@ FtRtEvent_Test_Base::~FtRtEvent_Test_Base()
int
FtRtEvent_Test_Base::parse_args(int argc, ACE_TCHAR** argv ACE_ENV_ARG_DECL)
{
- ACE_Get_Opt get_opt (argc, argv, ACE_LIB_TEXT("d:f:hi:k:np:?"));
+ ACE_Get_Opt get_opt (argc, argv, ACE_LIB_TEXT("d:e:f:hi:k:np:?"));
int opt;
while ((opt = get_opt ()) != EOF)
@@ -46,6 +47,10 @@ FtRtEvent_Test_Base::parse_args(int argc, ACE_TCHAR** argv ACE_ENV_ARG_DECL)
case 'd':
TAO_FTRTEC::Log::level(ACE_OS::atoi(get_opt.opt_arg ()));
break;
+ case 'e':
+ options_.num_events = ACE_OS::atoi(get_opt.opt_arg ());
+ options_.num_iterations= INT_MAX;
+ break;
case 'i':
{
CORBA::Object_var obj = orb_->string_to_object(get_opt.opt_arg ()
@@ -57,6 +62,7 @@ FtRtEvent_Test_Base::parse_args(int argc, ACE_TCHAR** argv ACE_ENV_ARG_DECL)
}
break;
case 'k':
+ options_.num_events = INT_MAX;
options_.num_iterations = atoi(get_opt.opt_arg ());
break;
case 'n':
diff --git a/TAO/orbsvcs/tests/FtRtEvent/FtRtEvent_Test.h b/TAO/orbsvcs/tests/FtRtEvent/FtRtEvent_Test.h
index b7f2b423e39..907ceb162af 100644
--- a/TAO/orbsvcs/tests/FtRtEvent/FtRtEvent_Test.h
+++ b/TAO/orbsvcs/tests/FtRtEvent/FtRtEvent_Test.h
@@ -23,6 +23,7 @@ struct Options
{
ACE_Time_Value timer_interval;
int num_iterations;
+ int num_events;
ACE_CString proxy_consumer_file;
};
diff --git a/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.cpp b/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.cpp
index d36e60951f9..c247f0ee8a3 100644
--- a/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.cpp
+++ b/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.cpp
@@ -14,6 +14,7 @@ ACE_RCSID (FtRtEvent,
PushConsumer_impl::PushConsumer_impl()
+: num_events_recevied_(0)
{
}
@@ -23,6 +24,8 @@ int PushConsumer_impl::init(CORBA::ORB_ptr orb,
{
orb_ = orb;
num_iterations_ = options.num_iterations;
+ num_events_to_end_ = options.num_events;
+
run_times_.assign(options.num_iterations, -1);
RtecEventChannelAdmin::ConsumerQOS qos;
@@ -74,7 +77,10 @@ PushConsumer_impl::push (const RtecEventComm::EventSet & event
time_val.sec () * 10000000 + time_val.usec ()* 10 - event[0].header.ec_send_time;
event[0].data.any_value >>= x;
- if ( num_iterations_ > static_cast<int>(x) ) {
+ num_events_recevied_ ++;
+
+ if ( num_iterations_ > static_cast<int>(x) &&
+ num_events_recevied_ < num_events_to_end_ ) {
run_times_[x] = static_cast<int>(elaps/10);
TAO_FTRTEC::Log(3, "received event %d\n", x);
}
diff --git a/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.h b/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.h
index d1f93c7fab2..3c034d87ef5 100644
--- a/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.h
+++ b/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.h
@@ -46,6 +46,8 @@ private:
void output_result();
CORBA::ORB_var orb_;
int num_iterations_;
+ int num_events_to_end_;
+ int num_events_recevied_;
RtecEventChannelAdmin::ProxyPushSupplier_var supplier_;
std::vector<int> run_times_;