summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-04-22 09:09:02 +0000
committervzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-04-22 09:09:02 +0000
commit5f6c2ebd621f484fbb6713de912b396f887fc15c (patch)
tree619a82492c0f727951a0a0f1dcac8e3a5da77f79
parentef690dec8575e4926d5617d4685383e1b821bd21 (diff)
downloadATCD-5f6c2ebd621f484fbb6713de912b396f887fc15c.tar.gz
ChangeLogTag: Wed Apr 22 09:07:44 UTC 2009 Vladimir Zykov <vz@prismtech.com>
-rw-r--r--TAO/ChangeLog23
-rw-r--r--TAO/bin/tao_orb_tests.lst1
-rw-r--r--TAO/tao/Bounded_Array_Sequence_T.h5
-rw-r--r--TAO/tao/Bounded_Basic_String_Sequence_T.h5
-rw-r--r--TAO/tao/Bounded_Object_Reference_Sequence_T.h5
-rw-r--r--TAO/tao/Bounded_Value_Sequence_T.h5
-rw-r--r--TAO/tao/Valuetype/Bounded_Valuetype_Sequence_T.h5
-rw-r--r--TAO/tests/Bug_3632_Regression/Bug_3632_Regression.mpc16
-rw-r--r--TAO/tests/Bug_3632_Regression/README10
-rwxr-xr-xTAO/tests/Bug_3632_Regression/run_test.pl22
-rw-r--r--TAO/tests/Bug_3632_Regression/test.cpp13
-rw-r--r--TAO/tests/Bug_3632_Regression/test.idl6
12 files changed, 111 insertions, 5 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 17c5e02d69b..08436762ba0 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,26 @@
+Wed Apr 22 09:07:44 UTC 2009 Vladimir Zykov <vz@prismtech.com>
+
+ * tests/Bug_3632_Regression/test.cpp:
+ * tests/Bug_3632_Regression/test.idl:
+ * tests/Bug_3632_Regression/Bug_3632_Regression.mpc:
+ * tests/Bug_3632_Regression/run_test.pl:
+ * tests/Bug_3632_Regression/README:
+
+ Added a regression test.
+
+ * bin/tao_orb_tests.lst:
+
+ Scheduled the test for run.
+
+ * tao/Bounded_Array_Sequence_T.h:
+ * tao/Bounded_Basic_String_Sequence_T.h:
+ * tao/Valuetype/Bounded_Valuetype_Sequence_T.h:
+ * tao/Bounded_Value_Sequence_T.h:
+ * tao/Bounded_Object_Reference_Sequence_T.h:
+
+ Fixed bug#3632. Now user cannot change a maximum value
+ of a bounded sequence.
+
Wed Apr 22 09:32:37 UTC 2009 Marcel Smit <msmit@remedy.nl>
* tests/RTCORBA/Bug_3643_Regression/client.cpp:
diff --git a/TAO/bin/tao_orb_tests.lst b/TAO/bin/tao_orb_tests.lst
index eb2ba93a4ad..758c621a098 100644
--- a/TAO/bin/tao_orb_tests.lst
+++ b/TAO/bin/tao_orb_tests.lst
@@ -155,6 +155,7 @@ TAO/tests/Bug_3575_Regression/run_test.pl:
TAO/tests/Bug_3597_Regression/run_test.pl:
TAO/tests/Bug_3598a_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS
TAO/tests/Bug_3630_Regression/run_test.pl: !FIXED_BUGS_ONLY
+TAO/tests/Bug_3632_Regression/run_test.pl:
TAO/tests/Bug_3636_Regression/run_test.pl: !FIXED_BUGS_ONLY
TAO/tests/DIOP/run_test.pl: !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_MICRO !LabVIEW_RT !WinCE !FUZZ
TAO/tests/DIOP/run_test_ipv6.pl: IPV6 !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_MICRO !LabVIEW_RT !WinCE !FUZZ
diff --git a/TAO/tao/Bounded_Array_Sequence_T.h b/TAO/tao/Bounded_Array_Sequence_T.h
index 1702cd41dfe..f5e22bbf93d 100644
--- a/TAO/tao/Bounded_Array_Sequence_T.h
+++ b/TAO/tao/Bounded_Array_Sequence_T.h
@@ -53,7 +53,10 @@ public:
return impl_.length();
}
inline void length(CORBA::ULong length) {
- impl_.length(length);
+ if (MAX >= length)
+ {
+ impl_.length(length);
+ }
}
inline value_type const & operator[](CORBA::ULong i) const {
return impl_[i];
diff --git a/TAO/tao/Bounded_Basic_String_Sequence_T.h b/TAO/tao/Bounded_Basic_String_Sequence_T.h
index 14ca643f6e3..c36dcb19587 100644
--- a/TAO/tao/Bounded_Basic_String_Sequence_T.h
+++ b/TAO/tao/Bounded_Basic_String_Sequence_T.h
@@ -65,7 +65,10 @@ public:
/// @copydoc details::generic_sequence::length
inline void length(CORBA::ULong length) {
implementation_type::range::check_length(length, MAX);
- impl_.length(length);
+ if (MAX >= length)
+ {
+ impl_.length(length);
+ }
}
/// @copydoc details::generic_sequence::operator[]
inline const_element_type operator[](CORBA::ULong i) const {
diff --git a/TAO/tao/Bounded_Object_Reference_Sequence_T.h b/TAO/tao/Bounded_Object_Reference_Sequence_T.h
index 1a7860d0efa..77f266f727d 100644
--- a/TAO/tao/Bounded_Object_Reference_Sequence_T.h
+++ b/TAO/tao/Bounded_Object_Reference_Sequence_T.h
@@ -67,7 +67,10 @@ public:
/// @copydoc details::generic_sequence::length
inline void length(CORBA::ULong length) {
implementation_type::range::check_length(length, MAX);
- impl_.length(length);
+ if (MAX >= length)
+ {
+ impl_.length(length);
+ }
}
/// @copydoc details::generic_sequence::operator[]
inline const_element_type operator[](CORBA::ULong i) const {
diff --git a/TAO/tao/Bounded_Value_Sequence_T.h b/TAO/tao/Bounded_Value_Sequence_T.h
index 991b282a2e0..8d9c1a8d8fd 100644
--- a/TAO/tao/Bounded_Value_Sequence_T.h
+++ b/TAO/tao/Bounded_Value_Sequence_T.h
@@ -60,7 +60,10 @@ public:
/// @copydoc details::generic_sequence::length
inline void length(CORBA::ULong length) {
implementation_type::range::check_length(length, MAX);
- impl_.length(length);
+ if (MAX >= length)
+ {
+ impl_.length(length);
+ }
}
/// @copydoc details::generic_sequence::operator[]
inline value_type const & operator[](CORBA::ULong i) const {
diff --git a/TAO/tao/Valuetype/Bounded_Valuetype_Sequence_T.h b/TAO/tao/Valuetype/Bounded_Valuetype_Sequence_T.h
index a4656160425..539b226c511 100644
--- a/TAO/tao/Valuetype/Bounded_Valuetype_Sequence_T.h
+++ b/TAO/tao/Valuetype/Bounded_Valuetype_Sequence_T.h
@@ -61,7 +61,10 @@ public:
inline void length(CORBA::ULong length) {
implementation_type::range::check_length(length, MAX);
- impl_.length(length);
+ if (MAX >= length)
+ {
+ impl_.length(length);
+ }
}
inline value_type const & operator[](CORBA::ULong i) const {
return impl_[i];
diff --git a/TAO/tests/Bug_3632_Regression/Bug_3632_Regression.mpc b/TAO/tests/Bug_3632_Regression/Bug_3632_Regression.mpc
new file mode 100644
index 00000000000..fb8d07ee600
--- /dev/null
+++ b/TAO/tests/Bug_3632_Regression/Bug_3632_Regression.mpc
@@ -0,0 +1,16 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ test.idl
+ }
+ custom_only = 1
+}
+
+project(*test): taoclient {
+ Source_Files {
+ test.cpp
+ testC.cpp
+ }
+}
diff --git a/TAO/tests/Bug_3632_Regression/README b/TAO/tests/Bug_3632_Regression/README
new file mode 100644
index 00000000000..918ba5096a3
--- /dev/null
+++ b/TAO/tests/Bug_3632_Regression/README
@@ -0,0 +1,10 @@
+# $Id$
+
+C++ mapping says that "For bounded sequences, the maximum length is part of the
+type and cannot be set or modified..." and later "For a bounded sequence,
+maximum() always returns the bound of the sequence as given in its OMG IDL type
+declaration."
+
+Also it says that "For a bounded sequence, attempting to set the current length
+to a value larger than the maximum length given in the OMG IDL specification
+produces undefined behavior". \ No newline at end of file
diff --git a/TAO/tests/Bug_3632_Regression/run_test.pl b/TAO/tests/Bug_3632_Regression/run_test.pl
new file mode 100755
index 00000000000..c7521144e9d
--- /dev/null
+++ b/TAO/tests/Bug_3632_Regression/run_test.pl
@@ -0,0 +1,22 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::TestTarget;
+
+my $client = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+
+$CL = $client->CreateProcess ("client");
+
+$test = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
+
+if ($test != 0) {
+ print STDERR "ERROR: test returned $test\n";
+ exit 1;
+}
+
+exit 0;
diff --git a/TAO/tests/Bug_3632_Regression/test.cpp b/TAO/tests/Bug_3632_Regression/test.cpp
new file mode 100644
index 00000000000..d560ad838ed
--- /dev/null
+++ b/TAO/tests/Bug_3632_Regression/test.cpp
@@ -0,0 +1,13 @@
+// $Id$
+
+#include "testC.h"
+
+int
+ACE_TMAIN (int, ACE_TCHAR *[])
+{
+ Test::bounded_string_seq seq;
+ seq.length (11);
+ ACE_TEST_ASSERT (seq.maximum () == 10);
+
+ return 0;
+}
diff --git a/TAO/tests/Bug_3632_Regression/test.idl b/TAO/tests/Bug_3632_Regression/test.idl
new file mode 100644
index 00000000000..7f95d1147e2
--- /dev/null
+++ b/TAO/tests/Bug_3632_Regression/test.idl
@@ -0,0 +1,6 @@
+// $Id$
+
+module Test
+{
+ typedef sequence <string, 10> bounded_string_seq;
+};