diff options
author | bala <balanatarajan@users.noreply.github.com> | 2002-12-07 05:05:56 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2002-12-07 05:05:56 +0000 |
commit | aa8bbc36d72dd9a059fee64a33944fc30b4fa819 (patch) | |
tree | a496cbbf7625db3cd8bfce159e54e4a295393968 | |
parent | 5dcce6aeb28cf7f53846ca87582b59905908cd7f (diff) | |
download | ATCD-aa8bbc36d72dd9a059fee64a33944fc30b4fa819.tar.gz |
ChangeLogTag: Fri Dec 6 23:58:47 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 11 | ||||
-rw-r--r-- | ace/CDR_Stream.cpp | 7 | ||||
-rw-r--r-- | ace/CDR_Stream.i | 355 | ||||
-rw-r--r-- | tests/CDR_Array_Test.cpp | 12 |
5 files changed, 234 insertions, 162 deletions
diff --git a/ChangeLog b/ChangeLog index 6986f5dac47..1df814db9cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Fri Dec 6 23:58:47 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * ace/CDR_Stream.cpp: + * ace/CDR_Stream.i: Set good_bit_ to zero whenever the sanity + check for remaining length in the stream fails. Thanks to Jerry + D. De Master <jdemaste@rite-solutions.com> for pointing out the + problem. + + * ace/CDR_Array_Test.cpp: Extended the test to include test for + checking the value of good_bit () by forcing an erroneous read. + Fri Dec 6 16:26:49 2002 Krishnakumar B <kitty@cs.wustl.edu> * ace/FILE_Addr.cpp (set): Windows appends ASCII 'a' - 'z' and diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 6986f5dac47..1df814db9cc 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,14 @@ +Fri Dec 6 23:58:47 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * ace/CDR_Stream.cpp: + * ace/CDR_Stream.i: Set good_bit_ to zero whenever the sanity + check for remaining length in the stream fails. Thanks to Jerry + D. De Master <jdemaste@rite-solutions.com> for pointing out the + problem. + + * ace/CDR_Array_Test.cpp: Extended the test to include test for + checking the value of good_bit () by forcing an erroneous read. + Fri Dec 6 16:26:49 2002 Krishnakumar B <kitty@cs.wustl.edu> * ace/FILE_Addr.cpp (set): Windows appends ASCII 'a' - 'z' and diff --git a/ace/CDR_Stream.cpp b/ace/CDR_Stream.cpp index 3ac6985356a..8b056cf544b 100644 --- a/ace/CDR_Stream.cpp +++ b/ace/CDR_Stream.cpp @@ -791,7 +791,7 @@ ACE_InputCDR::read_wchar (ACE_CDR::WChar& x) ACE_CDR::Octet len; if (this->read_1 (&len)) - return this->read_octet_array + return this->read_octet_array (ACE_reinterpret_cast (ACE_CDR::Octet*, &x), ACE_static_cast (ACE_CDR::ULong, len)); } @@ -983,7 +983,10 @@ ACE_InputCDR::read_boolean_array (ACE_CDR::Boolean *x, // Make sure the length of the array isn't greater than the length of // the stream. if (length > this->length()) - return 0; + { + this->good_bit_ = 0; + return 0; + } // It is hard to optimize this, the spec requires that on the wire // booleans be represented as a byte with value 0 or 1, but in diff --git a/ace/CDR_Stream.i b/ace/CDR_Stream.i index 73dfb5e69f7..7221888408a 100644 --- a/ace/CDR_Stream.i +++ b/ace/CDR_Stream.i @@ -54,8 +54,8 @@ ACE_InputCDR::to_wchar::to_wchar (ACE_CDR::WChar &wc) ACE_INLINE ACE_OutputCDR::from_string::from_string (ACE_CDR::Char *s, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy) + ACE_CDR::ULong b, + ACE_CDR::Boolean nocopy) : val_ (s), bound_ (b), nocopy_ (nocopy) @@ -64,8 +64,8 @@ ACE_OutputCDR::from_string::from_string (ACE_CDR::Char *s, ACE_INLINE ACE_OutputCDR::from_string::from_string (const ACE_CDR::Char *s, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy) + ACE_CDR::ULong b, + ACE_CDR::Boolean nocopy) : val_ (ACE_const_cast (ACE_CDR::Char *, s)), bound_ (b), nocopy_ (nocopy) @@ -74,7 +74,7 @@ ACE_OutputCDR::from_string::from_string (const ACE_CDR::Char *s, ACE_INLINE ACE_InputCDR::to_string::to_string (ACE_CDR::Char *&s, - ACE_CDR::ULong b) + ACE_CDR::ULong b) : val_ (ACE_const_cast (const ACE_CDR::Char *&, s)), bound_ (b) { @@ -82,7 +82,7 @@ ACE_InputCDR::to_string::to_string (ACE_CDR::Char *&s, ACE_INLINE ACE_InputCDR::to_string::to_string (const ACE_CDR::Char *&s, - ACE_CDR::ULong b) + ACE_CDR::ULong b) : val_ (s), bound_ (b) { @@ -90,8 +90,8 @@ ACE_InputCDR::to_string::to_string (const ACE_CDR::Char *&s, ACE_INLINE ACE_OutputCDR::from_wstring::from_wstring (ACE_CDR::WChar *ws, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy) + ACE_CDR::ULong b, + ACE_CDR::Boolean nocopy) : val_ (ws), bound_ (b), nocopy_ (nocopy) @@ -100,8 +100,8 @@ ACE_OutputCDR::from_wstring::from_wstring (ACE_CDR::WChar *ws, ACE_INLINE ACE_OutputCDR::from_wstring::from_wstring (const ACE_CDR::WChar *ws, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy) + ACE_CDR::ULong b, + ACE_CDR::Boolean nocopy) : val_ (ACE_const_cast (ACE_CDR::WChar *, ws)), bound_ (b), nocopy_ (nocopy) @@ -110,7 +110,7 @@ ACE_OutputCDR::from_wstring::from_wstring (const ACE_CDR::WChar *ws, ACE_INLINE ACE_InputCDR::to_wstring::to_wstring (ACE_CDR::WChar *&ws, - ACE_CDR::ULong b) + ACE_CDR::ULong b) : val_ (ACE_const_cast (const ACE_CDR::WChar *&, ws)), bound_ (b) { @@ -118,7 +118,7 @@ ACE_InputCDR::to_wstring::to_wstring (ACE_CDR::WChar *&ws, ACE_INLINE ACE_InputCDR::to_wstring::to_wstring (const ACE_CDR::WChar *&ws, - ACE_CDR::ULong b) + ACE_CDR::ULong b) : val_ (ws), bound_ (b) { @@ -264,19 +264,19 @@ ACE_OutputCDR::write_wstring (const ACE_CDR::WChar *x) ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_char_array (const ACE_CDR::Char *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { if (this->char_translator_ == 0) return this->write_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); + ACE_CDR::OCTET_SIZE, + ACE_CDR::OCTET_ALIGN, + length); return this->char_translator_->write_char_array (*this, x, length); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_wchar_array (const ACE_CDR::WChar* x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { if (this->wchar_translator_ == 0) return this->write_array (x, @@ -284,109 +284,109 @@ ACE_OutputCDR::write_wchar_array (const ACE_CDR::WChar* x, sizeof (ACE_CDR::WChar) == 2 ? ACE_CDR::SHORT_ALIGN : ACE_CDR::LONG_ALIGN, - length); + length); return this->wchar_translator_->write_wchar_array (*this, x, length); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_octet_array (const ACE_CDR::Octet* x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { return this->write_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); + ACE_CDR::OCTET_SIZE, + ACE_CDR::OCTET_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_short_array (const ACE_CDR::Short *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { return this->write_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); + ACE_CDR::SHORT_SIZE, + ACE_CDR::SHORT_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_ushort_array (const ACE_CDR::UShort *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { return this->write_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); + ACE_CDR::SHORT_SIZE, + ACE_CDR::SHORT_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_long_array (const ACE_CDR::Long *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { return this->write_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); + ACE_CDR::LONG_SIZE, + ACE_CDR::LONG_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_ulong_array (const ACE_CDR::ULong *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { return this->write_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); + ACE_CDR::LONG_SIZE, + ACE_CDR::LONG_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_longlong_array (const ACE_CDR::LongLong *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { return this->write_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); + ACE_CDR::LONGLONG_SIZE, + ACE_CDR::LONGLONG_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_ulonglong_array (const ACE_CDR::ULongLong *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { return this->write_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); + ACE_CDR::LONGLONG_SIZE, + ACE_CDR::LONGLONG_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_float_array (const ACE_CDR::Float *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { return this->write_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); + ACE_CDR::LONG_SIZE, + ACE_CDR::LONG_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_double_array (const ACE_CDR::Double *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { return this->write_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); + ACE_CDR::LONGLONG_SIZE, + ACE_CDR::LONGLONG_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_longdouble_array (const ACE_CDR::LongDouble* x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { return this->write_array (x, - ACE_CDR::LONGDOUBLE_SIZE, - ACE_CDR::LONGDOUBLE_ALIGN, - length); + ACE_CDR::LONGDOUBLE_SIZE, + ACE_CDR::LONGDOUBLE_ALIGN, + length); } ACE_INLINE int @@ -397,8 +397,8 @@ ACE_OutputCDR::good_bit (void) const ACE_INLINE int ACE_OutputCDR::adjust (size_t size, - size_t align, - char*& buf) + size_t align, + char*& buf) { if (!this->current_is_writable_) return this->grow_and_adjust (size, align, buf); @@ -437,7 +437,7 @@ ACE_OutputCDR::set_version (ACE_CDR::Octet major, ACE_CDR::Octet minor) ACE_INLINE int ACE_OutputCDR::get_version (ACE_CDR::Octet &major, - ACE_CDR::Octet &minor) + ACE_CDR::Octet &minor) { major = this->major_version_; minor = this->minor_version_; @@ -616,189 +616,224 @@ ACE_InputCDR::length (void) const ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_char_array (ACE_CDR::Char* x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { // Make sure the length of the array isn't greater than the length of // the stream. if (length > this->length()) - return 0; + { + this->good_bit_ = 0; + return 0; + } if (this->char_translator_ == 0) return this->read_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); + ACE_CDR::OCTET_SIZE, + ACE_CDR::OCTET_ALIGN, + length); return this->char_translator_->read_char_array (*this, x, length); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_wchar_array (ACE_CDR::WChar* x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { // Make sure the length of the array isn't greater than the length of // the stream. if (length * sizeof (ACE_CDR::WChar) > this->length()) - return 0; + { + this->good_bit_ = 0; + return 0; + } if (this->wchar_translator_ == 0) return this->read_array (x, - sizeof (ACE_CDR::WChar), - sizeof (ACE_CDR::WChar) == 2 + sizeof (ACE_CDR::WChar), + sizeof (ACE_CDR::WChar) == 2 ? ACE_CDR::SHORT_ALIGN : ACE_CDR::LONG_ALIGN, - length); + length); return this->wchar_translator_->read_wchar_array (*this, x, length); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_octet_array (ACE_CDR::Octet* x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { // Make sure the length of the array isn't greater than the length of // the stream. if (length * ACE_CDR::OCTET_SIZE > this->length()) - return 0; + { + this->good_bit_ = 0; + return 0; + } return this->read_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); + ACE_CDR::OCTET_SIZE, + ACE_CDR::OCTET_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_short_array (ACE_CDR::Short *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { // Make sure the length of the array isn't greater than the length of // the stream. if (length * ACE_CDR::SHORT_SIZE > this->length()) - return 0; + { + this->good_bit_ = 0; + return 0; + } return this->read_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); + ACE_CDR::SHORT_SIZE, + ACE_CDR::SHORT_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_ushort_array (ACE_CDR::UShort *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { // Make sure the length of the array isn't greater than the length of // the stream. if (length * ACE_CDR::SHORT_SIZE > this->length()) - return 0; + { + this->good_bit_ = 0; + return 0; + } return this->read_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); + ACE_CDR::SHORT_SIZE, + ACE_CDR::SHORT_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_long_array (ACE_CDR::Long *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { // Make sure the length of the array isn't greater than the length of // the stream. if (length * ACE_CDR::LONG_SIZE > this->length()) - return 0; + { + this->good_bit_ = 0; + return 0; + } return this->read_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); + ACE_CDR::LONG_SIZE, + ACE_CDR::LONG_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_ulong_array (ACE_CDR::ULong *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { // Make sure the length of the array isn't greater than the length of // the stream. if (length * ACE_CDR::LONG_SIZE > this->length()) - return 0; + { + this->good_bit_ = 0; + return 0; + } return this->read_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); + ACE_CDR::LONG_SIZE, + ACE_CDR::LONG_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_longlong_array (ACE_CDR::LongLong *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { // Make sure the length of the array isn't greater than the length of // the stream. if (length * ACE_CDR::LONGLONG_SIZE > this->length()) - return 0; + { + this->good_bit_ = 0; + return 0; + } return this->read_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); + ACE_CDR::LONGLONG_SIZE, + ACE_CDR::LONGLONG_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_ulonglong_array (ACE_CDR::ULongLong *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { // Make sure the length of the array isn't greater than the length of // the stream. if (length * ACE_CDR::LONGLONG_SIZE > this->length()) - return 0; + { + this->good_bit_ = 0; + return 0; + } return this->read_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); + ACE_CDR::LONGLONG_SIZE, + ACE_CDR::LONGLONG_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_float_array (ACE_CDR::Float *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { // Make sure the length of the array isn't greater than the length of // the stream. if (length * ACE_CDR::LONG_SIZE > this->length()) - return 0; + { + this->good_bit_ = 0; + return 0; + } return this->read_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); + ACE_CDR::LONG_SIZE, + ACE_CDR::LONG_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_double_array (ACE_CDR::Double *x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { // Make sure the length of the array isn't greater than the length of // the stream. if (length * ACE_CDR::LONGLONG_SIZE > this->length()) - return 0; + { + this->good_bit_ = 0; + return 0; + } return this->read_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); + ACE_CDR::LONGLONG_SIZE, + ACE_CDR::LONGLONG_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_longdouble_array (ACE_CDR::LongDouble* x, - ACE_CDR::ULong length) + ACE_CDR::ULong length) { // Make sure the length of the array isn't greater than the length of // the stream. if (length * ACE_CDR::LONGDOUBLE_SIZE > this->length()) - return 0; - + { + this->good_bit_ = 0; + return 0; + } return this->read_array (x, - ACE_CDR::LONGDOUBLE_SIZE, - ACE_CDR::LONGDOUBLE_ALIGN, - length); + ACE_CDR::LONGDOUBLE_SIZE, + ACE_CDR::LONGDOUBLE_ALIGN, + length); } ACE_INLINE ACE_CDR::Boolean @@ -914,8 +949,8 @@ ACE_InputCDR::wr_ptr (void) ACE_INLINE int ACE_InputCDR::adjust (size_t size, - size_t align, - char*& buf) + size_t align, + char*& buf) { buf = ACE_ptr_align_binary (this->rd_ptr (), align); char *end = buf + size; @@ -931,7 +966,7 @@ ACE_InputCDR::adjust (size_t size, ACE_INLINE int ACE_InputCDR::adjust (size_t size, - char*& buf) + char*& buf) { return this->adjust (size, size, buf); } @@ -1204,7 +1239,7 @@ operator>> (ACE_InputCDR &is, ACE_InputCDR::to_string x) is.read_string (ACE_const_cast (char *&, x.val_)); // check if the bounds are satisfied return (is.good_bit () && - (ACE_OS::strlen (x.val_) <= x.bound_)); + (ACE_OS::strlen (x.val_) <= x.bound_)); } ACE_INLINE ACE_CDR::Boolean @@ -1213,7 +1248,7 @@ operator>> (ACE_InputCDR &is, ACE_InputCDR::to_wstring x) is.read_wstring (ACE_const_cast (ACE_CDR::WChar *&, x.val_)); // check if the bounds are satisfied return (is.good_bit () && - (ACE_OS::wslen (x.val_) <= x.bound_)); + (ACE_OS::wslen (x.val_) <= x.bound_)); } // *************************************************************************** @@ -1357,7 +1392,7 @@ ACE_INLINE int ACE_InputCDR::align_read_ptr (size_t alignment) { char *buf = ACE_ptr_align_binary (this->rd_ptr (), - alignment); + alignment); if (buf <= this->wr_ptr ()) { @@ -1371,7 +1406,7 @@ ACE_InputCDR::align_read_ptr (size_t alignment) ACE_INLINE int ACE_InputCDR::set_version (ACE_CDR::Octet major, - ACE_CDR::Octet minor) + ACE_CDR::Octet minor) { this->major_version_ = major; this->minor_version_ = minor; @@ -1380,7 +1415,7 @@ ACE_InputCDR::set_version (ACE_CDR::Octet major, ACE_INLINE int ACE_InputCDR::get_version (ACE_CDR::Octet &major, - ACE_CDR::Octet &minor) + ACE_CDR::Octet &minor) { major = this->major_version_; minor = this->minor_version_; @@ -1403,43 +1438,43 @@ ACE_InputCDR::wchar_translator (void) const ACE_INLINE ACE_CDR::Boolean ACE_Char_Codeset_Translator::read_1 (ACE_InputCDR& input, - ACE_CDR::Octet *x) + ACE_CDR::Octet *x) { return input.read_1 (x); } ACE_INLINE ACE_CDR::Boolean ACE_Char_Codeset_Translator::write_1 (ACE_OutputCDR& output, - const ACE_CDR::Octet *x) + const ACE_CDR::Octet *x) { return output.write_1 (x); } ACE_INLINE ACE_CDR::Boolean ACE_Char_Codeset_Translator::read_array (ACE_InputCDR& in, - void* x, - size_t size, - size_t align, - ACE_CDR::ULong length) + void* x, + size_t size, + size_t align, + ACE_CDR::ULong length) { return in.read_array (x, size, align, length); } ACE_INLINE ACE_CDR::Boolean ACE_Char_Codeset_Translator::write_array (ACE_OutputCDR& out, - const void *x, - size_t size, - size_t align, - ACE_CDR::ULong length) + const void *x, + size_t size, + size_t align, + ACE_CDR::ULong length) { return out.write_array(x, size, align, length); } ACE_INLINE int ACE_Char_Codeset_Translator::adjust (ACE_OutputCDR& out, - size_t size, - size_t align, - char *&buf) + size_t size, + size_t align, + char *&buf) { return out.adjust(size, align, buf); } @@ -1454,71 +1489,71 @@ ACE_Char_Codeset_Translator::good_bit (ACE_OutputCDR& out, int bit) ACE_INLINE ACE_CDR::Boolean ACE_WChar_Codeset_Translator::read_1 (ACE_InputCDR& input, - ACE_CDR::Octet *x) + ACE_CDR::Octet *x) { return input.read_1 (x); } ACE_INLINE ACE_CDR::Boolean ACE_WChar_Codeset_Translator::read_2 (ACE_InputCDR& input, - ACE_CDR::UShort *x) + ACE_CDR::UShort *x) { return input.read_2 (x); } ACE_INLINE ACE_CDR::Boolean ACE_WChar_Codeset_Translator::read_4 (ACE_InputCDR& input, - ACE_CDR::ULong *x) + ACE_CDR::ULong *x) { return input.read_4 (x); } ACE_INLINE ACE_CDR::Boolean ACE_WChar_Codeset_Translator::write_1 (ACE_OutputCDR& output, - const ACE_CDR::Octet *x) + const ACE_CDR::Octet *x) { return output.write_1 (x); } ACE_INLINE ACE_CDR::Boolean ACE_WChar_Codeset_Translator::write_2 (ACE_OutputCDR& output, - const ACE_CDR::UShort *x) + const ACE_CDR::UShort *x) { return output.write_2 (x); } ACE_INLINE ACE_CDR::Boolean ACE_WChar_Codeset_Translator::write_4 (ACE_OutputCDR& output, - const ACE_CDR::ULong *x) + const ACE_CDR::ULong *x) { return output.write_4 (x); } ACE_INLINE ACE_CDR::Boolean ACE_WChar_Codeset_Translator::read_array (ACE_InputCDR& in, - void* x, - size_t size, - size_t align, - ACE_CDR::ULong length) + void* x, + size_t size, + size_t align, + ACE_CDR::ULong length) { return in.read_array (x, size, align, length); } ACE_INLINE ACE_CDR::Boolean ACE_WChar_Codeset_Translator::write_array (ACE_OutputCDR& out, - const void *x, - size_t size, - size_t align, - ACE_CDR::ULong length) + const void *x, + size_t size, + size_t align, + ACE_CDR::ULong length) { return out.write_array(x, size, align, length); } ACE_INLINE int ACE_WChar_Codeset_Translator::adjust (ACE_OutputCDR& out, - size_t size, - size_t align, - char *&buf) + size_t size, + size_t align, + char *&buf) { return out.adjust(size, align, buf); } diff --git a/tests/CDR_Array_Test.cpp b/tests/CDR_Array_Test.cpp index d1cb547add3..b48fafbcc4e 100644 --- a/tests/CDR_Array_Test.cpp +++ b/tests/CDR_Array_Test.cpp @@ -532,6 +532,18 @@ CDR_Test<T, H>::do_test (int total, int niter, int use_array, H::read_array (is, idata, total); crono.stop (); secs = crono.read_seconds (); + + // Testing for good bit value. Try reading atleast 10 + // times the size of total. It should fail with good bit + // set to 0. + H::read_array (is, idata, 10 * total); + + if (is.good_bit () != 0) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Test for good bit failed in %s Array_test \n"), + H::name ())); + } } else { |