diff options
author | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-12-08 17:04:35 +0000 |
---|---|---|
committer | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-12-08 17:04:35 +0000 |
commit | 4c6ddc1a4b93823232bb80000866ae2b65c0569c (patch) | |
tree | 64db59ea80d70c111017945a807f9f7b6a1c2075 | |
parent | 011d9aef9b8ea541ce210140547a0b5bdf9ddac1 (diff) | |
download | ATCD-4c6ddc1a4b93823232bb80000866ae2b65c0569c.tar.gz |
Wed Dec 8 17:03:29 UTC 2010 Martin Corino <corino_m@remedy.nl>
* connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h:
* connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp:
Fuzz fix.
-rw-r--r-- | CIAO/ChangeLog | 6 | ||||
-rw-r--r-- | CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp | 298 | ||||
-rw-r--r-- | CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h | 94 |
3 files changed, 202 insertions, 196 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 8573b953fc8..49cbdd44679 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,9 @@ +Wed Dec 8 17:03:29 UTC 2010 Martin Corino <corino_m@remedy.nl> + + * connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h: + * connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp: + Fuzz fix. + Wed Dec 8 17:34:33 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl> * tests/Bug_3936_Regression: diff --git a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp b/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp index e5ad85b2169..5fe5a420d94 100644 --- a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp +++ b/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp @@ -2,28 +2,28 @@ // $Id$ /** - * Code generated by the The ACE ORB (TAO) IDL Compiler v1.8.3 - * TAO and the TAO IDL Compiler have been developed by: - * Center for Distributed Object Computing - * Washington University - * St. Louis, MO - * USA - * http://www.cs.wustl.edu/~schmidt/doc-center.html - * and - * Distributed Object Computing Laboratory - * University of California at Irvine - * Irvine, CA - * USA - * and - * Institute for Software Integrated Systems - * Vanderbilt University - * Nashville, TN - * USA - * http://www.isis.vanderbilt.edu/ - * - * Information about TAO is available at: - * http://www.cs.wustl.edu/~schmidt/TAO.html - **/ +* Code generated by the The ACE ORB (TAO) IDL Compiler v1.8.3 +* TAO and the TAO IDL Compiler have been developed by: +* Center for Distributed Object Computing +* Washington University +* St. Louis, MO +* USA +* http://www.cs.wustl.edu/~schmidt/doc-center.html +* and +* Distributed Object Computing Laboratory +* University of California at Irvine +* Irvine, CA +* USA +* and +* Institute for Software Integrated Systems +* Vanderbilt University +* Nashville, TN +* USA +* http://www.isis.vanderbilt.edu/ +* +* Information about TAO is available at: +* http://www.cs.wustl.edu/~schmidt/TAO.html +**/ #include "AsynchT_Sender_exec.h" #include "ace/OS_NS_unistd.h" @@ -31,134 +31,134 @@ namespace CIAO_AsynchT_Sender_Impl { - CORBA::Boolean asynch = false; - - //============================================================ - // Worker thread for asynchronous invocations for MyFoo - //============================================================ - asynch_foo_generator::asynch_foo_generator ( - ::AsynchT::CCM_Sender_Context_ptr context, - Atomic_UShort &nr_of_sent, - Atomic_UShort &nr_of_rec) - : context_(::AsynchT::CCM_Sender_Context::_duplicate (context)), - nr_of_sent_(nr_of_sent), - nr_of_rec_(nr_of_rec) - { - } - - int asynch_foo_generator::svc () - { - ::AsynchT::AMI4CCM_MyFoo_var my_foo_ami_ = - context_->get_connection_sendc_run_my_foo(); - - ACE_OS::sleep(2); - - ::AsynchT::AMI4CCM_MyFooReplyHandler_var cb = - new CIAO_AsynchT_Sender_Impl::AMI4CCM_MyFooReplyHandler_run_my_foo_i ( - this->nr_of_sent_, - this->nr_of_rec_); - - if (CORBA::is_nil (my_foo_ami_)) - { - ACE_ERROR ((LM_ERROR, "ERROR Sender (ASYNCH) :" - "\tfoo_ami is NIL !\n")); - return 1; - } - //Invoke Asynchronous calls to test - ++this->nr_of_sent_; - my_foo_ami_->sendc_foo ( cb.in(),"Hi ", 1); - ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL foo.\n")); - - ++this->nr_of_sent_; - my_foo_ami_->sendc_bar ( cb.in(), 1); - ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL bar.\n")); - - ++this->nr_of_sent_; - my_foo_ami_->sendc_get_rw_attrib( cb.in()); - ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL get_rw_attrib.\n")); - - ++this->nr_of_sent_; - my_foo_ami_->sendc_set_rw_attrib( cb.in(),2); - ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL set_rw_attrib.\n")); - - ++this->nr_of_sent_; - ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL get_ro_attrib.\n")); - my_foo_ami_->sendc_get_ro_attrib( cb.in()); - - //there is more than 1 message sent, without receiving callbacks, - //so it is asynchronous - if (this->nr_of_sent_.value() > 1) - { - asynch = true; - } - return 0; - } - //============================================================ - // Worker thread for synchronous invocations for MyFoo - //============================================================ - synch_foo_generator::synch_foo_generator ( - ::AsynchT::CCM_Sender_Context_ptr context) - : context_(::AsynchT::CCM_Sender_Context::_duplicate (context)) - { - } - - int synch_foo_generator::svc () - { - ::AsynchT::MyFoo_var my_foo_ami_ = - context_->get_connection_run_my_foo (); - - ACE_OS::sleep(1); - CORBA::Boolean wait = false; - for (int i = 0; i < 3; ++i) - { - // Run some synch calls, answer has to come before the next step. - CORBA::String_var answer; - try - { - if( wait==true) - { - ACE_ERROR ((LM_ERROR, - "ERROR: NOT RECEIVED SYNCHRONOUS answer.\n")); - } - wait = true; - ACE_DEBUG ((LM_DEBUG, "OK: SEND SYNCHRONOUS CALL foo.\n")); - CORBA::Long result = my_foo_ami_->foo ("Do something synchronous", - 2 , - answer.out ()); - if ( result == 2) - { - ACE_DEBUG ((LM_DEBUG, "OK: RECEIVED SYNCHRONOUS answer <%C>\n", - answer.in ())); - wait = false; - } - if ( wait==true) - { - ACE_ERROR ((LM_ERROR, - "ERROR: NOT RECEIVED SYNCHRONOUS answer.\n")); - } - wait = true; - CORBA::Long l_cmd = 0; - ACE_DEBUG ((LM_DEBUG, "OK: SEND SYNCHRONOUS CALL bar.\n")); - my_foo_ami_->bar (2,l_cmd); - if ( l_cmd == 2) - { - ACE_DEBUG ((LM_DEBUG, "OK: RECEIVED SYNCHRONOUS answer <%C>\n", - answer.in ())); - wait = false; - } - } - catch (const AsynchT::InternalError&) - { - ACE_ERROR ((LM_ERROR, "ERROR: synch_foo_generator::foo: " - "Unexpected exception.\n")); - } - } - return 0; - } + CORBA::Boolean asynch = false; + + //============================================================ + // Worker thread for asynchronous invocations for MyFoo + //============================================================ + asynch_foo_generator::asynch_foo_generator ( + ::AsynchT::CCM_Sender_Context_ptr context, + Atomic_UShort &nr_of_sent, + Atomic_UShort &nr_of_rec) + : context_(::AsynchT::CCM_Sender_Context::_duplicate (context)), + nr_of_sent_(nr_of_sent), + nr_of_rec_(nr_of_rec) + { + } + + int asynch_foo_generator::svc () + { + ::AsynchT::AMI4CCM_MyFoo_var my_foo_ami_ = + context_->get_connection_sendc_run_my_foo(); + + ACE_OS::sleep(2); + + ::AsynchT::AMI4CCM_MyFooReplyHandler_var cb = + new CIAO_AsynchT_Sender_Impl::AMI4CCM_MyFooReplyHandler_run_my_foo_i ( + this->nr_of_sent_, + this->nr_of_rec_); + + if (CORBA::is_nil (my_foo_ami_)) + { + ACE_ERROR ((LM_ERROR, "ERROR Sender (ASYNCH) :" + "\tfoo_ami is NIL !\n")); + return 1; + } + //Invoke Asynchronous calls to test + ++this->nr_of_sent_; + my_foo_ami_->sendc_foo ( cb.in(),"Hi ", 1); + ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL foo.\n")); + + ++this->nr_of_sent_; + my_foo_ami_->sendc_bar ( cb.in(), 1); + ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL bar.\n")); + + ++this->nr_of_sent_; + my_foo_ami_->sendc_get_rw_attrib( cb.in()); + ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL get_rw_attrib.\n")); + + ++this->nr_of_sent_; + my_foo_ami_->sendc_set_rw_attrib( cb.in(),2); + ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL set_rw_attrib.\n")); + + ++this->nr_of_sent_; + ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL get_ro_attrib.\n")); + my_foo_ami_->sendc_get_ro_attrib( cb.in()); + + //there is more than 1 message sent, without receiving callbacks, + //so it is asynchronous + if (this->nr_of_sent_.value() > 1) + { + asynch = true; + } + return 0; + } + //============================================================ + // Worker thread for synchronous invocations for MyFoo + //============================================================ + synch_foo_generator::synch_foo_generator ( + ::AsynchT::CCM_Sender_Context_ptr context) + : context_(::AsynchT::CCM_Sender_Context::_duplicate (context)) + { + } + + int synch_foo_generator::svc () + { + ::AsynchT::MyFoo_var my_foo_ami_ = + context_->get_connection_run_my_foo (); + + ACE_OS::sleep(1); + CORBA::Boolean wait = false; + for (int i = 0; i < 3; ++i) + { + // Run some synch calls, answer has to come before the next step. + CORBA::String_var answer; + try + { + if( wait==true) + { + ACE_ERROR ((LM_ERROR, + "ERROR: NOT RECEIVED SYNCHRONOUS answer.\n")); + } + wait = true; + ACE_DEBUG ((LM_DEBUG, "OK: SEND SYNCHRONOUS CALL foo.\n")); + CORBA::Long result = my_foo_ami_->foo ("Do something synchronous", + 2 , + answer.out ()); + if ( result == 2) + { + ACE_DEBUG ((LM_DEBUG, "OK: RECEIVED SYNCHRONOUS answer <%C>\n", + answer.in ())); + wait = false; + } + if ( wait==true) + { + ACE_ERROR ((LM_ERROR, + "ERROR: NOT RECEIVED SYNCHRONOUS answer.\n")); + } + wait = true; + CORBA::Long l_cmd = 0; + ACE_DEBUG ((LM_DEBUG, "OK: SEND SYNCHRONOUS CALL bar.\n")); + my_foo_ami_->bar (2,l_cmd); + if ( l_cmd == 2) + { + ACE_DEBUG ((LM_DEBUG, "OK: RECEIVED SYNCHRONOUS answer <%C>\n", + answer.in ())); + wait = false; + } + } + catch (const AsynchT::InternalError&) + { + ACE_ERROR ((LM_ERROR, "ERROR: synch_foo_generator::foo: " + "Unexpected exception.\n")); + } + } + return 0; + } /** - * Component Executor Implementation Class: Sender_exec_i - */ + * Component Executor Implementation Class: Sender_exec_i + */ Sender_exec_i::Sender_exec_i (void) : nr_of_sent_ (0), @@ -240,7 +240,7 @@ namespace CIAO_AsynchT_Sender_Impl Atomic_UShort &nr_of_sent, Atomic_UShort &nr_of_rec) : nr_of_sent_ (nr_of_sent), - nr_of_rec_ (nr_of_rec) + nr_of_rec_ (nr_of_rec) { } diff --git a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h b/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h index 3e6757816f4..6969f48969c 100644 --- a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h +++ b/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h @@ -2,28 +2,28 @@ // $Id$ /** - * Code generated by the The ACE ORB (TAO) IDL Compiler v1.8.3 - * TAO and the TAO IDL Compiler have been developed by: - * Center for Distributed Object Computing - * Washington University - * St. Louis, MO - * USA - * http://www.cs.wustl.edu/~schmidt/doc-center.html - * and - * Distributed Object Computing Laboratory - * University of California at Irvine - * Irvine, CA - * USA - * and - * Institute for Software Integrated Systems - * Vanderbilt University - * Nashville, TN - * USA - * http://www.isis.vanderbilt.edu/ - * - * Information about TAO is available at: - * http://www.cs.wustl.edu/~schmidt/TAO.html - **/ +* Code generated by the The ACE ORB (TAO) IDL Compiler v1.8.3 +* TAO and the TAO IDL Compiler have been developed by: +* Center for Distributed Object Computing +* Washington University +* St. Louis, MO +* USA +* http://www.cs.wustl.edu/~schmidt/doc-center.html +* and +* Distributed Object Computing Laboratory +* University of California at Irvine +* Irvine, CA +* USA +* and +* Institute for Software Integrated Systems +* Vanderbilt University +* Nashville, TN +* USA +* http://www.isis.vanderbilt.edu/ +* +* Information about TAO is available at: +* http://www.cs.wustl.edu/~schmidt/TAO.html +**/ #ifndef CIAO_ASYNCHT_SENDER_EXEC_LZKPQ3_H_ #define CIAO_ASYNCHT_SENDER_EXEC_LZKPQ3_H_ @@ -41,39 +41,39 @@ namespace CIAO_AsynchT_Sender_Impl { - typedef ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::UShort> Atomic_UShort; + typedef ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::UShort> Atomic_UShort; - /// Worker thread for asynchronous invocations - class asynch_foo_generator: public virtual ACE_Task_Base - { - public: - asynch_foo_generator(::AsynchT::CCM_Sender_Context_ptr context, - Atomic_UShort &nr_of_sent, Atomic_UShort &nr_of_rec); + /// Worker thread for asynchronous invocations + class asynch_foo_generator: public virtual ACE_Task_Base + { + public: + asynch_foo_generator(::AsynchT::CCM_Sender_Context_ptr context, + Atomic_UShort &nr_of_sent, Atomic_UShort &nr_of_rec); - virtual int svc(void); + virtual int svc(void); - private: - ::AsynchT::CCM_Sender_Context_var context_; - Atomic_UShort &nr_of_sent_; - Atomic_UShort &nr_of_rec_; + private: + ::AsynchT::CCM_Sender_Context_var context_; + Atomic_UShort &nr_of_sent_; + Atomic_UShort &nr_of_rec_; - }; + }; - /// Worker thread for synchronous invocations - class synch_foo_generator: public virtual ACE_Task_Base - { - public: - synch_foo_generator(::AsynchT::CCM_Sender_Context_ptr context); + /// Worker thread for synchronous invocations + class synch_foo_generator: public virtual ACE_Task_Base + { + public: + synch_foo_generator(::AsynchT::CCM_Sender_Context_ptr context); - virtual int svc(void); + virtual int svc(void); - private: - ::AsynchT::CCM_Sender_Context_var context_; - }; + private: + ::AsynchT::CCM_Sender_Context_var context_; + }; /** - * Component Executor Implementation Class: Sender_exec_i - */ + * Component Executor Implementation Class: Sender_exec_i + */ class Sender_exec_i : public virtual Sender_Exec, @@ -133,7 +133,7 @@ namespace CIAO_AsynchT_Sender_Impl { public: AMI4CCM_MyFooReplyHandler_run_my_foo_i (Atomic_UShort &nr_of_sent, - Atomic_UShort &nr_of_rec); + Atomic_UShort &nr_of_rec); virtual ~AMI4CCM_MyFooReplyHandler_run_my_foo_i (void); virtual void |