summaryrefslogtreecommitdiff
path: root/trunk/TAO/tests/Bug_2201_Regression/test.cpp
blob: 1508d989950b9fb50fa8f86bb4c1e84047867a91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// $Id$

#include "ace/Log_Msg.h"
#include "TestDataC.h"

int
main (int argc, char *argv[])
{
  int retval = 0;

  CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);

  SeqTest::NodeSeq ns;
  ns.length (1);
  ns[0].ls.length (1);
  ns[0].ls[0] = 42;

  ns.length (0); // Shrink sequence
  ns.length (1); // Re-grow sequence; should re-initialize meber sequence
                 // "as if" default constructed. I.e., the "ls" member
                 // should have a length of zero.

  if (ns[0].ls.length() == 0) {
    ACE_DEBUG ((LM_DEBUG, "Test passed\n"));
  }
  else {
    ACE_ERROR ((LM_ERROR, "Test failed\n"));
    retval = 1;
  }

  return retval;
}