summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2012-03-28 11:11:52 +0000
committersma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2012-03-28 11:11:52 +0000
commita5fa17a14bcb88a48a03f507b98abc7237a69cba (patch)
tree087d85ce1bbc02092f6b3516a190a622e356e317
parent606bb7fbf1776cfa61f3d71eb0c9b7bbd7b19723 (diff)
downloadATCD-a5fa17a14bcb88a48a03f507b98abc7237a69cba.tar.gz
Wed Mar 28 12:12:00 UTC 2012 Simon Massey <simon dot massey at prismtech dot com>
Initialise all bytes being send by client and server and ensure they will readily compress. Valgrind kept reporting that there were uninitialized bytes being compressed, the client didn't initialise it's big request octet sequence, and Hello.cpp was being too complex in it's initialization of Big_reply, leaving holes in it's octet sequence init.
-rw-r--r--TAO/ChangeLog10
-rw-r--r--TAO/tests/ZIOP/Hello.cpp13
-rw-r--r--TAO/tests/ZIOP/client.cpp13
3 files changed, 23 insertions, 13 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index d9dc9ba2fe1..0f9d0232489 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,13 @@
+Wed Mar 28 12:12:00 UTC 2012 Simon Massey <simon dot massey at prismtech dot com>
+
+ * tests/ZIOP/Hello.cpp:
+ * tests/ZIOP/client.cpp:
+ Initialise all bytes being send by client and server and ensure they will
+ readily compress. Valgrind kept reporting that there were unitialized
+ bytes being compressed, the client didn't initialise it's big request
+ octet sequence, and Hello.cpp was being too complex in it's initalization
+ of Big_reply, leaving holes in it's octet sequence init.
+
Wed Mar 28 10:40:00 UTC 2012 Simon Massey <simon dot massey at prismtech dot com>
* tests/ZIOP/client.cpp:
diff --git a/TAO/tests/ZIOP/Hello.cpp b/TAO/tests/ZIOP/Hello.cpp
index e22724f5b73..a9d7af19f6e 100644
--- a/TAO/tests/ZIOP/Hello.cpp
+++ b/TAO/tests/ZIOP/Hello.cpp
@@ -4,9 +4,9 @@
#include "Hello.h"
Hello::Hello (CORBA::ORB_ptr orb)
- : orb_ (CORBA::ORB::_duplicate (orb))
+ : length_ (40000u)
+ , orb_ (CORBA::ORB::_duplicate (orb))
{
- length_ = 4000000;
}
char *
@@ -16,7 +16,6 @@ Hello::get_string (const char * mystring)
return CORBA::string_dup ("Hello there!Hello there!Hello there!Hello there!Hello there!Hello there!Hello there!Hello there!Hello there!");
}
-
Test::Octet_Seq *
Hello::get_big_reply ()
{
@@ -25,11 +24,9 @@ Hello::get_big_reply ()
reply_mesg->length (this->length_);
- for (unsigned int i = 0; i < this->length_; ++i)
+ for (unsigned int i = 0u; i < this->length_; ++i)
{
- int size = 128;
- for (int ch = 0; ch < size && i < this->length_ - 1; ++ch)
- reply_mesg[++i] = ACE_OS::rand() % size--;
+ reply_mesg[i]= static_cast<CORBA::Octet> (i & 0xff);
}
return reply_mesg._retn ();
}
@@ -49,8 +46,6 @@ Hello::big_request (const ::Test::Octet_Seq & octet_in)
}
}
-
-
void
Hello::shutdown (void)
{
diff --git a/TAO/tests/ZIOP/client.cpp b/TAO/tests/ZIOP/client.cpp
index bca03553925..b2fdcef6e1a 100644
--- a/TAO/tests/ZIOP/client.cpp
+++ b/TAO/tests/ZIOP/client.cpp
@@ -9,7 +9,6 @@
#include "common.h"
static const ACE_TCHAR *ior = ACE_TEXT("file://") DEFAULT_IOR_FILENAME;
-
static ::Compression::CompressionManager_var compression_manager = 0;
int start_tests (Test::Hello_ptr hello, CORBA::ORB_ptr orb);
@@ -173,10 +172,11 @@ create_policies (CORBA::ORB_ptr orb, bool add_zlib_compressor)
Test::Hello_var
prepare_tests (CORBA::ORB_ptr orb, bool create_factories=true)
{
-
#if defined TAO_HAS_ZIOP && TAO_HAS_ZIOP == 1
if (create_factories)
- register_factories(orb);
+ {
+ register_factories(orb);
+ }
return create_policies (orb, !create_factories);
#else
@@ -352,10 +352,15 @@ run_big_reply_test (Test::Hello_ptr hello)
int
run_big_request_test (Test::Hello_ptr hello)
{
- int length = 40000;
+ const int length = 40000;
Test::Octet_Seq send_msg(length);
send_msg.length (length);
+ for (int i= 0; i<length; ++i)
+ {
+ send_msg[i]= static_cast<CORBA::Octet> (i & 0xff);
+ }
+
ACE_DEBUG((LM_DEBUG,
ACE_TEXT("run_big_request_test, send = %d bytes\n"), length));