diff options
Diffstat (limited to 'TAO/tests/Param_Test/helper.cpp')
-rw-r--r-- | TAO/tests/Param_Test/helper.cpp | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/TAO/tests/Param_Test/helper.cpp b/TAO/tests/Param_Test/helper.cpp deleted file mode 100644 index 5e22ba3a49f..00000000000 --- a/TAO/tests/Param_Test/helper.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Param_Test -// -// = FILENAME -// helper.cpp -// -// = DESCRIPTION -// Defines a helper class that can generate values for the parameters used -// for the Param_Test example -// -// = AUTHORS -// Aniruddha Gokhale -// -// ============================================================================ - -#include "helper.h" - -Generator::Generator (void) -{ -} - -Generator::~Generator (void) -{ -} - -CORBA::Short -Generator::gen_short (void) -{ - return (CORBA::Short) (ACE_OS::rand () % TEST_BUFSIZE); -} - -CORBA::Long -Generator::gen_long (void) -{ - return ::ACE_OS::rand () % TEST_BUFSIZE; -} - -char * -Generator::gen_string (void) -{ - CORBA::ULong len = (CORBA::ULong) (::ACE_OS::rand () % TEST_BUFSIZE); - char *buf = CORBA::string_alloc (len); - CORBA::ULong i = 0; - - while (i < len) - { - int c = ACE_OS::rand () % 128; - if (isprint (c) && !isspace (c)) - { - buf [i] = c; - i++; - } - } - buf[i] = 0; - return buf; -} - -const Param_Test::Fixed_Struct -Generator::gen_fixed_struct (void) -{ - this->fixed_struct_.l = ACE_OS::rand (); - this->fixed_struct_.c = ACE_OS::rand () % 128; - this->fixed_struct_.s = (CORBA::Short) ACE_OS::rand (); - this->fixed_struct_.o = ACE_OS::rand () % 128; - this->fixed_struct_.f = (CORBA::Float) (ACE_OS::rand () * 1.0); - this->fixed_struct_.b = (CORBA::Boolean) ACE_OS::rand () % 2; - this->fixed_struct_.d = (ACE_OS::rand () * 1.0); - return this->fixed_struct_; -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Singleton<Generator, ACE_SYNCH_RECURSIVE_MUTEX>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Singleton<Generator, ACE_SYNCH_RECURSIVE_MUTEX> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ |