This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #include <config.h>
19
20 #include "gl_set.hh"
21 #include "gl_array_set.h"
22
23 #include <string.h>
24
25 #include "macros.h"
26
27 static const char A[] = "A";
28 static const char C[] = "C";
29 static const char D[] = "D";
30
31 int
32 main (int argc, char *argv[])
33 {
34 gl_Set<const char *> set1;
35
36 set1 = gl_Set<const char *> (GL_ARRAY_SET, NULL, NULL, NULL);
37 set1.add (A);
38 set1.add (C);
39 set1.add (D);
40 set1.add (C);
41 ASSERT (set1.size () == 3);
42
43 gl_Set<const char *>::iterator iter1 = set1.begin ();
44 const char *elt;
45 ASSERT (iter1.next (elt));
46 ASSERT (strcmp (elt, "A") == 0 || strcmp (elt, "D") == 0 || strcmp (elt, "C") == 0);
47 ASSERT (iter1.next (elt));
48 ASSERT (strcmp (elt, "A") == 0 || strcmp (elt, "D") == 0 || strcmp (elt, "C") == 0);
49 ASSERT (iter1.next (elt));
50 ASSERT (strcmp (elt, "A") == 0 || strcmp (elt, "D") == 0 || strcmp (elt, "C") == 0);
51 ASSERT (!iter1.next (elt));
52
53 set1.free ();
54
55 return 0;
56 }