2 //=============================================================================
6 * Verifies that octet sequence marshaling does not affect
9 * @author Carlos O'Ryan (coryan@cs.wustl.edu)
11 //=============================================================================
16 #include "ace/Log_Msg.h"
18 int ACE_TMAIN (int, ACE_TCHAR
*[])
22 for (CORBA::ULong i
= 16; i
!= 64; ++i
)
24 ACE_Message_Block
mb (i
+ ACE_CDR::MAX_ALIGNMENT
);
25 ACE_CDR::mb_align (&mb
);
28 CORBA::Double dbl
= i
;
31 cdr
.write_ulong (i
); // length
32 cdr
.write_octet_array_mb (&mb
);
33 cdr
.write_double (dbl
);
34 cdr
.write_double (dbl
);
36 TAO_InputCDR
input (cdr
);
40 input
.read_ulong (len
);
45 "ERROR: mismatched lengths,"
46 " got %d, expected %d\n",
50 ACE_Message_Block
read_mb (len
+ ACE_CDR::MAX_ALIGNMENT
);
51 ACE_CDR::mb_align (&mb
);
53 input
.read_char_array (mb
.rd_ptr (), len
);
55 CORBA::Double read_dbl
;
56 if (input
.read_double (read_dbl
) == 0)
57 ACE_DEBUG ((LM_DEBUG
, "Failure reading double...\n"));
59 if (!ACE::is_equal (read_dbl
, dbl
))
63 "ERROR: mismatched doubles,"
64 " got %f, expected %f\n",
66 for (const ACE_Message_Block
*j
= cdr
.begin ();
70 ACE_HEX_DUMP ((LM_DEBUG
,
73 ACE_TEXT("Output CDR stream")));
75 TAO_InputCDR
debug (cdr
);
76 ACE_HEX_DUMP ((LM_DEBUG
,
79 ACE_TEXT("Input CDR stream")));