summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2002-04-06 03:06:14 +0000
committerbala <balanatarajan@users.noreply.github.com>2002-04-06 03:06:14 +0000
commit92044af63f56201d010a10166549f14bd1f00e02 (patch)
tree7844b942630ce85ab4c22c0161fe36de8f2900cf
parent65e4581882fa792e540e215342c4a5be4b52ef42 (diff)
downloadATCD-92044af63f56201d010a10166549f14bd1f00e02.tar.gz
ChangeLogTag:Fri Apr 05 21:17:44 2002 Balachandran Natarajan <bala@cs.wustl.edu>
-rw-r--r--ChangeLog9
-rw-r--r--ChangeLogs/ChangeLog-02a9
-rw-r--r--ChangeLogs/ChangeLog-03a9
-rw-r--r--ace/CDR_Stream.cpp2
-rw-r--r--tests/CDR_Test.cpp34
5 files changed, 62 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ef19413ef9..d513d1f0384 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Fri Apr 05 21:17:44 2002 Balachandran Natarajan <bala@cs.wustl.edu>
+
+ * ace/CDR_Stream.cpp: Initialized a null wstring properly.
+ * tests/CDR_Test.cpp (test_get): Added a test case for a
+ marshalling and unmarshalling a zero length wstring.
+
+ The above changes fix [Bug 1169]. Thanks to Duane Binder
+ <duane.binder@veritas.com> for suggesting these fixes.
+
Fri Apr 5 19:20:39 2002 Steve Huston <shuston@riverace.com>
* ace/Proactor.h: Add #include "ace/OS.h" in the "non-AIO" section
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 7ef19413ef9..d513d1f0384 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,12 @@
+Fri Apr 05 21:17:44 2002 Balachandran Natarajan <bala@cs.wustl.edu>
+
+ * ace/CDR_Stream.cpp: Initialized a null wstring properly.
+ * tests/CDR_Test.cpp (test_get): Added a test case for a
+ marshalling and unmarshalling a zero length wstring.
+
+ The above changes fix [Bug 1169]. Thanks to Duane Binder
+ <duane.binder@veritas.com> for suggesting these fixes.
+
Fri Apr 5 19:20:39 2002 Steve Huston <shuston@riverace.com>
* ace/Proactor.h: Add #include "ace/OS.h" in the "non-AIO" section
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 7ef19413ef9..d513d1f0384 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,12 @@
+Fri Apr 05 21:17:44 2002 Balachandran Natarajan <bala@cs.wustl.edu>
+
+ * ace/CDR_Stream.cpp: Initialized a null wstring properly.
+ * tests/CDR_Test.cpp (test_get): Added a test case for a
+ marshalling and unmarshalling a zero length wstring.
+
+ The above changes fix [Bug 1169]. Thanks to Duane Binder
+ <duane.binder@veritas.com> for suggesting these fixes.
+
Fri Apr 5 19:20:39 2002 Steve Huston <shuston@riverace.com>
* ace/Proactor.h: Add #include "ace/OS.h" in the "non-AIO" section
diff --git a/ace/CDR_Stream.cpp b/ace/CDR_Stream.cpp
index e5dbdec4ba0..2747e808a59 100644
--- a/ace/CDR_Stream.cpp
+++ b/ace/CDR_Stream.cpp
@@ -937,7 +937,7 @@ ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x)
ACE_NEW_RETURN (x,
ACE_CDR::WChar[1],
0);
- ACE_OS::memcpy(x, "", 2);
+ x[0] = '\x00';
return 1;
}
diff --git a/tests/CDR_Test.cpp b/tests/CDR_Test.cpp
index 60e404b4775..e4242dc3967 100644
--- a/tests/CDR_Test.cpp
+++ b/tests/CDR_Test.cpp
@@ -37,6 +37,7 @@ struct CDR_Test_Types
ACE_CDR::Short s;
ACE_CDR::Long l;
const ACE_CDR::Char *str;
+ const ACE_CDR::WChar *wstr;
ACE_CDR::Double d;
int test_put (ACE_OutputCDR& cdr);
@@ -55,6 +56,7 @@ CDR_Test_Types::CDR_Test_Types (void)
s (2),
l (4),
str ("abc"),
+ wstr (0),
d (8)
{
for (int i = 0;
@@ -76,6 +78,8 @@ short_stream (void)
ACE_CDR::Char ch = 'A';
ACE_CDR::Char wchtmp[] = {"\xF3"};
ACE_CDR::WChar wch = *wchtmp;
+ ACE_CDR::WChar wchar2[] = {'\x00'}; // empty wide string
+ ACE_CDR::WChar *wstr = wchar2;
ACE_CString str ("Test String");
ACE_CDR::Short s = -123;
ACE_CDR::UShort us = 123;
@@ -95,6 +99,7 @@ short_stream (void)
ACE_OutputCDR::from_wchar fwc (wch);
os << fwc;
os << str;
+ os << wstr;
os << s;
os << us;
os << l;
@@ -135,6 +140,7 @@ short_stream (void)
// Basic types for input
ACE_CDR::Char ch1 = '\0';
ACE_CDR::WChar wch1 = '\x00';
+ ACE_CDR::WChar *wstr1 = 0;
ACE_CString str1;
ACE_CDR::Short s1 = 0;
ACE_CDR::UShort us1 = 0;
@@ -157,6 +163,7 @@ short_stream (void)
ACE_InputCDR::to_wchar twc (wch1);
is >> twc;
is >> str1;
+ is >> wstr1;
is >> s1;
is >> us1;
is >> l1;
@@ -186,6 +193,13 @@ short_stream (void)
ACE_TEXT ("string transfer error")),
1);
+ if (ACE_OS::wscmp(wstr1, wstr))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("%p\n"),
+ ACE_TEXT ("wide string transfer error")),
+ 1);
+
+
if (s1 != s)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
@@ -290,6 +304,12 @@ CDR_Test_Types::test_put (ACE_OutputCDR &cdr)
i),
1);
+ if (cdr.write_wstring (this->wstr) == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("write_wstring[%d] failed\n"),
+ i),
+ 1);
+
}
return 0;
@@ -366,6 +386,20 @@ CDR_Test_Types::test_get (ACE_InputCDR &cdr) const
ACE_TEXT ("string[%d] differs\n"),
i),
1);
+
+ ACE_CDR::WChar *wstr1;
+ if (cdr.read_wstring (wstr1) == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("read_wstring2[%d] failed\n"),
+ i),
+ 1);
+ // zero length
+ ACE_Auto_Basic_Array_Ptr<ACE_CDR::WChar> auto_xwstr (wstr1);
+ if (ACE_OS::wslen(auto_xwstr.get () ))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("wstring[%d] differs\n"),
+ i),
+ 1);
}
return 0;
}