4 * @brief Smoke test (basically just compile) the bounded sequences
7 * @author Carlos O'Ryan
9 #include "tao/Bounded_Basic_String_Sequence_T.h"
10 #include "tao/CORBA_String.h"
11 #include "ace/Log_Msg.h"
13 CORBA::ULong
const MAXIMUM
= 42;
14 typedef TAO::bounded_basic_string_sequence
<char, MAXIMUM
> s_sequence
;
16 int ACE_TMAIN (int, ACE_TCHAR
*[])
23 s_sequence
c(0, s_sequence::allocbuf(), true);
26 a
.length(c
.maximum());
31 a
[0] = const_cast<char const*>("Hello");
34 s_sequence
const & d
= a
;
38 #if defined (TAO_CHECKED_SEQUENCE_INDEXING) && (TAO_CHECKED_SEQUENCE_INDEXING == 1)
42 catch (const ::CORBA::BAD_PARAM
&)
44 // c has length = 0, so there is an exception when we try
45 // to access element above length.
48 b
.replace(0, s_sequence::allocbuf(), true);
50 char const * const * x
= d
.get_buffer();
53 s_sequence::freebuf(a
.get_buffer(true));
59 s_sequence::freebuf(s_sequence::allocbuf());
64 CORBA::String_var
w(const_cast<char const*>("World"));
68 #if defined (TAO_CHECKED_SEQUENCE_INDEXING) && (TAO_CHECKED_SEQUENCE_INDEXING == 1)
72 catch (const ::CORBA::BAD_PARAM
&)
74 // e has length = 0, so there is an exception when we try
75 // to access element above length.
78 catch (const ::CORBA::Exception
&)
80 ACE_ERROR ((LM_ERROR
, "Caught unexpected exception\n"));