summaryrefslogtreecommitdiff
path: root/TAO/tests/Sequence_Unit_Tests/Bounded_Simple_Types.cpp
blob: 0365a9b57c3d79ec34e086ebc3636d9f2ba9ad52 (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
33
34
35
36
37
38
39
40
41
42
43
44
/**
 * @file
 *
 * @brief Smoke test (basically just compile) the unbounded sequences
 * for primitive and other self-managed types.
 *
 * $Id$
 *
 * @author Carlos O'Ryan
 */
#include "sequence.hpp"

struct Foo
{
  int x;
};

CORBA::ULong const TEST_INT_MAX = 32;
CORBA::ULong const TEST_FOO_MAX = 64;

int main(int,char*[])
{
  typedef TAO::bounded_sequence<int,TEST_INT_MAX> int_sequence;

  int_sequence a;
  int_sequence b(a);

  a = b;

  typedef TAO::bounded_sequence<Foo,TEST_FOO_MAX> Foo_sequence;

  Foo_sequence c;
  Foo_sequence d(c);
  d = c;

  return 0;
}

// We use explicit template instantiation to force the instantiation
// of all member function and thus tests the full class.  This should
// work across all platforms, even on platforms that do not *require*
// explicit instantiation of templates.
template class TAO::bounded_sequence<int,TEST_INT_MAX>;
template class TAO::bounded_sequence<Foo,TEST_FOO_MAX>;