~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to results/plugins/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/typehierarchy/CTypeHierarchyTest.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2011-10-06 21:15:04 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111006211504-8dutmljjih0zikfv
Tags: 8.0.1-1
* New upstream release.
* Split the JNI packages into a separate architecture dependent
  package and made eclipse-cdt architecture independent.
* Install JNI libraries into multiarch aware location
* Bumped Standards-Version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*******************************************************************************
2
 
 * Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
3
 
 * All rights reserved. This program and the accompanying materials
4
 
 * are made available under the terms of the Eclipse Public License v1.0
5
 
 * which accompanies this distribution, and is available at
6
 
 * http://www.eclipse.org/legal/epl-v10.html
7
 
 *
8
 
 * Contributors:
9
 
 *    Markus Schorn - initial API and implementation
10
 
 *******************************************************************************/ 
11
 
package org.eclipse.cdt.ui.tests.typehierarchy;
12
 
 
13
 
import junit.framework.Test;
14
 
 
15
 
import org.eclipse.core.resources.IFile;
16
 
import org.eclipse.swt.widgets.Tree;
17
 
import org.eclipse.swt.widgets.TreeItem;
18
 
 
19
 
import org.eclipse.cdt.internal.ui.editor.CEditor;
20
 
 
21
 
 
22
 
public class CTypeHierarchyTest extends TypeHierarchyBaseTest {
23
 
        
24
 
        public CTypeHierarchyTest(String name) {
25
 
                super(name);
26
 
        }
27
 
 
28
 
        public static Test suite() {
29
 
                return suite(CTypeHierarchyTest.class);
30
 
        }
31
 
 
32
 
        // enum E1 {e1, e2};
33
 
        // typedef enum E2 {e3, e4} TE2;
34
 
        // enum E3 {e5, e6};
35
 
        // typedef enum E3 TE3;
36
 
        public void testEnumC() throws Exception {
37
 
                String content= getContentsForTest(1)[0].toString();
38
 
                IFile file= createFile(getProject(), "enum.c", content);
39
 
                waitForIndexer(fIndex, file, INDEXER_WAIT_TIME);
40
 
                CEditor editor= openEditor(file);
41
 
                Tree tree;
42
 
                TreeItem item;
43
 
                
44
 
                editor.selectAndReveal(content.indexOf("E1"), 1);
45
 
                openTypeHierarchy(editor);
46
 
                tree = getHierarchyViewer().getTree();
47
 
                item= checkTreeNode(tree, 0, "E1");
48
 
                assertEquals(0, item.getItemCount());
49
 
                checkMethodTable(new String[] {"e1", "e2"});
50
 
 
51
 
                editor.selectAndReveal(content.indexOf("E2"), 1);
52
 
                openTypeHierarchy(editor);
53
 
                tree = getHierarchyViewer().getTree();
54
 
                item= checkTreeNode(tree, 0, "E2");
55
 
                item= checkTreeNode(item, 0, "TE2");
56
 
                assertEquals(0, item.getItemCount());
57
 
                checkMethodTable(new String[] {"e3", "e4"});
58
 
 
59
 
                editor.selectAndReveal(content.indexOf("E3"), 1);
60
 
                openTypeHierarchy(editor);
61
 
                tree = getHierarchyViewer().getTree();
62
 
                item= checkTreeNode(tree, 0, "E3");
63
 
                item= checkTreeNode(item, 0, "TE3");
64
 
                assertEquals(0, item.getItemCount());
65
 
                checkMethodTable(new String[] {"e5", "e6"});
66
 
        }
67
 
 
68
 
        // enum E1 {e1, e2};
69
 
        // typedef enum E2 {e3, e4} TE2;
70
 
        // enum E3 {e5, e6};
71
 
        // typedef enum E3 TE3;
72
 
        public void testEnumCFromMember() throws Exception {
73
 
                String content= getContentsForTest(1)[0].toString();
74
 
                IFile file= createFile(getProject(), "enummem.c", content);
75
 
                waitForIndexer(fIndex, file, INDEXER_WAIT_TIME);
76
 
                CEditor editor= openEditor(file);
77
 
                Tree tree;
78
 
                TreeItem item;
79
 
                
80
 
                editor.selectAndReveal(content.indexOf("e1"), 1);
81
 
                openTypeHierarchy(editor);
82
 
                tree = getHierarchyViewer().getTree();
83
 
                item= checkTreeNode(tree, 0, "E1");
84
 
                assertEquals(0, item.getItemCount());
85
 
                checkMethodTable(new String[] {"e1", "e2"});
86
 
 
87
 
                editor.selectAndReveal(content.indexOf("e3"), 1);
88
 
                openTypeHierarchy(editor);
89
 
                tree = getHierarchyViewer().getTree();
90
 
                item= checkTreeNode(tree, 0, "E2");
91
 
                item= checkTreeNode(item, 0, "TE2");
92
 
                assertEquals(0, item.getItemCount());
93
 
                checkMethodTable(new String[] {"e3", "e4"});
94
 
 
95
 
                editor.selectAndReveal(content.indexOf("e6"), 1);
96
 
                openTypeHierarchy(editor);
97
 
                tree = getHierarchyViewer().getTree();
98
 
                item= checkTreeNode(tree, 0, "E3");
99
 
                item= checkTreeNode(item, 0, "TE3");
100
 
                assertEquals(0, item.getItemCount());
101
 
                checkMethodTable(new String[] {"e5", "e6"});
102
 
        }
103
 
 
104
 
        // enum E1 {e1, e2};
105
 
        // typedef enum E2 {e3, e4} TE2;
106
 
        // enum E3 {e5, e6};
107
 
        // typedef E3 TE3;
108
 
        public void testEnumCPP() throws Exception {
109
 
                String content= getContentsForTest(1)[0].toString();
110
 
                IFile file= createFile(getProject(), "enum.cpp", content);
111
 
                waitForIndexer(fIndex, file, INDEXER_WAIT_TIME);
112
 
                CEditor editor= openEditor(file);
113
 
                Tree tree;
114
 
                TreeItem item;
115
 
                
116
 
                editor.selectAndReveal(content.indexOf("E1"), 1);
117
 
                openTypeHierarchy(editor);
118
 
                tree = getHierarchyViewer().getTree();
119
 
                item= checkTreeNode(tree, 0, "E1");
120
 
                assertEquals(0, item.getItemCount());
121
 
                checkMethodTable(new String[] {"e1", "e2"});
122
 
 
123
 
                editor.selectAndReveal(content.indexOf("E2"), 1);
124
 
                openTypeHierarchy(editor);
125
 
                tree = getHierarchyViewer().getTree();
126
 
                item= checkTreeNode(tree, 0, "E2");
127
 
                item= checkTreeNode(item, 0, "TE2");
128
 
                assertEquals(0, item.getItemCount());
129
 
                checkMethodTable(new String[] {"e3", "e4"});
130
 
 
131
 
                editor.selectAndReveal(content.indexOf("E3"), 1);
132
 
                openTypeHierarchy(editor);
133
 
                tree = getHierarchyViewer().getTree();
134
 
                item= checkTreeNode(tree, 0, "E3");
135
 
                item= checkTreeNode(item, 0, "TE3");
136
 
                assertEquals(0, item.getItemCount());
137
 
                checkMethodTable(new String[] {"e5", "e6"});
138
 
        }
139
 
 
140
 
        // enum E1 {e1, e2};
141
 
        // typedef enum E2 {e3, e4} TE2;
142
 
        // enum E3 {e5, e6};
143
 
        // typedef E3 TE3;
144
 
        public void testEnumCPPFromMember() throws Exception {
145
 
                String content= getContentsForTest(1)[0].toString();
146
 
                IFile file= createFile(getProject(), "enummem.cpp", content);
147
 
                waitForIndexer(fIndex, file, INDEXER_WAIT_TIME);
148
 
                CEditor editor= openEditor(file);
149
 
                Tree tree;
150
 
                TreeItem item;
151
 
                
152
 
                editor.selectAndReveal(content.indexOf("e1"), 1);
153
 
                openTypeHierarchy(editor);
154
 
                tree = getHierarchyViewer().getTree();
155
 
                item= checkTreeNode(tree, 0, "E1");
156
 
                assertEquals(0, item.getItemCount());
157
 
                checkMethodTable(new String[] {"e1", "e2"});
158
 
 
159
 
                editor.selectAndReveal(content.indexOf("e4"), 1);
160
 
                openTypeHierarchy(editor);
161
 
                tree = getHierarchyViewer().getTree();
162
 
                item= checkTreeNode(tree, 0, "E2");
163
 
                item= checkTreeNode(item, 0, "TE2");
164
 
                assertEquals(0, item.getItemCount());
165
 
                checkMethodTable(new String[] {"e3", "e4"});
166
 
 
167
 
                editor.selectAndReveal(content.indexOf("e6"), 1);
168
 
                openTypeHierarchy(editor);
169
 
                tree = getHierarchyViewer().getTree();
170
 
                item= checkTreeNode(tree, 0, "E3");
171
 
                item= checkTreeNode(item, 0, "TE3");
172
 
                assertEquals(0, item.getItemCount());
173
 
                checkMethodTable(new String[] {"e5", "e6"});
174
 
        }
175
 
 
176
 
        // struct S1 {
177
 
        //    int a1;
178
 
        //    int b1;
179
 
        // };
180
 
        // typedef struct S2 {
181
 
        //    int a2;
182
 
        //    int b2;
183
 
        // } S2;
184
 
        // typedef struct S3 {
185
 
        //    int a3;
186
 
        //    int b3;
187
 
        // } T3;
188
 
        public void testStructC() throws Exception {
189
 
                String content= getContentsForTest(1)[0].toString();
190
 
                IFile file= createFile(getProject(), "struct.c", content);
191
 
                waitForIndexer(fIndex, file, INDEXER_WAIT_TIME);
192
 
                CEditor editor= openEditor(file);
193
 
 
194
 
                editor.selectAndReveal(content.indexOf("S1"), 1);
195
 
                openTypeHierarchy(editor);
196
 
                Tree tree = getHierarchyViewer().getTree();
197
 
                TreeItem item= checkTreeNode(tree, 0, "S1");
198
 
                assertEquals(0, item.getItemCount());
199
 
                checkMethodTable(new String[] {"a1", "b1"});
200
 
                
201
 
                editor.selectAndReveal(content.indexOf("S2"), 1);
202
 
                openTypeHierarchy(editor);
203
 
                tree = getHierarchyViewer().getTree();
204
 
                item = checkTreeNode(tree, 0, "S2");
205
 
                item= checkTreeNode(item, 0, "S2");
206
 
                assertEquals(0, item.getItemCount());
207
 
                checkMethodTable(new String[] {"a2", "b2"});
208
 
 
209
 
                editor.selectAndReveal(content.indexOf("S2;"), 1);
210
 
                openTypeHierarchy(editor);
211
 
                tree = getHierarchyViewer().getTree();
212
 
                item= checkTreeNode(tree, 0, "S2");
213
 
                item= checkTreeNode(item, 0, "S2");
214
 
                assertEquals(0, item.getItemCount());
215
 
                checkMethodTable(new String[0]);
216
 
 
217
 
                editor.selectAndReveal(content.indexOf("S3"), 1);
218
 
                openTypeHierarchy(editor);
219
 
                tree = getHierarchyViewer().getTree();
220
 
                item= checkTreeNode(tree, 0, "S3");
221
 
                item= checkTreeNode(item, 0, "T3");
222
 
                assertEquals(0, item.getItemCount());
223
 
                checkMethodTable(new String[] {"a3", "b3"});
224
 
 
225
 
                editor.selectAndReveal(content.indexOf("T3"), 1);
226
 
                openTypeHierarchy(editor);
227
 
                tree = getHierarchyViewer().getTree();
228
 
                item= checkTreeNode(tree, 0, "S3");
229
 
                item= checkTreeNode(item, 0, "T3");
230
 
                assertEquals(0, item.getItemCount());
231
 
                checkMethodTable(new String[0]);
232
 
        }
233
 
 
234
 
        // struct S1 {
235
 
        //    int a1;
236
 
        //    int b1;
237
 
        // };
238
 
        // typedef struct S3 {
239
 
        //    int a3;
240
 
        //    int b3;
241
 
        // } T3;
242
 
        public void testStructCFromMember() throws Exception {
243
 
                String content= getContentsForTest(1)[0].toString();
244
 
                IFile file= createFile(getProject(), "structmem.c", content);
245
 
                waitForIndexer(fIndex, file, INDEXER_WAIT_TIME);
246
 
                CEditor editor= openEditor(file);
247
 
 
248
 
                editor.selectAndReveal(content.indexOf("a1"), 1);
249
 
                openTypeHierarchy(editor);
250
 
                Tree tree = getHierarchyViewer().getTree();
251
 
                TreeItem item= checkTreeNode(tree, 0, "S1");
252
 
                assertEquals(0, item.getItemCount());
253
 
                checkMethodTable(new String[] {"a1", "b1"});
254
 
                
255
 
                editor.selectAndReveal(content.indexOf("b3"), 1);
256
 
                openTypeHierarchy(editor);
257
 
                tree = getHierarchyViewer().getTree();
258
 
                item= checkTreeNode(tree, 0, "S3");
259
 
                item= checkTreeNode(item, 0, "T3");
260
 
                assertEquals(0, item.getItemCount());
261
 
                checkMethodTable(new String[] {"a3", "b3"});
262
 
        }
263
 
 
264
 
        // struct S1 {
265
 
        //    int a1;
266
 
        //    int b1;
267
 
        // };
268
 
        // typedef struct S2 {
269
 
        //    int a2;
270
 
        //    int b2;
271
 
        // } S2;
272
 
        // typedef struct S3 {
273
 
        //    int a3;
274
 
        //    int b3;
275
 
        // } T3;
276
 
        public void testStructCPP() throws Exception {
277
 
                String content= getContentsForTest(1)[0].toString();
278
 
                IFile file= createFile(getProject(), "struct.cpp", content);
279
 
                waitForIndexer(fIndex, file, INDEXER_WAIT_TIME);
280
 
                CEditor editor= openEditor(file);
281
 
 
282
 
                editor.selectAndReveal(content.indexOf("S1"), 1);
283
 
                openTypeHierarchy(editor);
284
 
                Tree tree = getHierarchyViewer().getTree();
285
 
                TreeItem item= checkTreeNode(tree, 0, "S1");
286
 
                assertEquals(0, item.getItemCount());
287
 
                checkMethodTable(new String[] {"a1", "b1"});
288
 
 
289
 
                editor.selectAndReveal(content.indexOf("S2"), 1);
290
 
                openTypeHierarchy(editor);
291
 
                tree = getHierarchyViewer().getTree();
292
 
                item= checkTreeNode(tree, 0, "S2");
293
 
                item= checkTreeNode(item, 0, "S2");
294
 
                assertEquals(0, item.getItemCount());
295
 
                checkMethodTable(new String[] {"a2", "b2"});
296
 
 
297
 
                editor.selectAndReveal(content.indexOf("S2;"), 1);
298
 
                openTypeHierarchy(editor);
299
 
                tree = getHierarchyViewer().getTree();
300
 
                item = checkTreeNode(tree, 0, "S2");
301
 
                item= checkTreeNode(item, 0, "S2");
302
 
                assertEquals(0, item.getItemCount());
303
 
                checkMethodTable(new String[0]);
304
 
 
305
 
                editor.selectAndReveal(content.indexOf("S3"), 1);
306
 
                openTypeHierarchy(editor);
307
 
                tree = getHierarchyViewer().getTree();
308
 
                item= checkTreeNode(tree, 0, "S3");
309
 
                item= checkTreeNode(item, 0, "T3");
310
 
                assertEquals(0, item.getItemCount());
311
 
                checkMethodTable(new String[] {"a3", "b3"});
312
 
                
313
 
                editor.selectAndReveal(content.indexOf("T3"), 1);
314
 
                openTypeHierarchy(editor);
315
 
                tree = getHierarchyViewer().getTree();
316
 
                item= checkTreeNode(tree, 0, "S3");
317
 
                item= checkTreeNode(item, 0, "T3");
318
 
                assertEquals(0, item.getItemCount());
319
 
                checkMethodTable(new String[0]);
320
 
        }
321
 
        
322
 
 
323
 
        // struct S1 {
324
 
        //    int a1;
325
 
        //    int b1;
326
 
        // };
327
 
        // typedef struct S3 {
328
 
        //    int a3;
329
 
        //    int b3;
330
 
        // } T3;
331
 
        public void testStructCPPFromMember() throws Exception {
332
 
                String content= getContentsForTest(1)[0].toString();
333
 
                IFile file= createFile(getProject(), "structmem.cpp", content);
334
 
                waitForIndexer(fIndex, file, INDEXER_WAIT_TIME);
335
 
                CEditor editor= openEditor(file);
336
 
 
337
 
                editor.selectAndReveal(content.indexOf("a1"), 1);
338
 
                openTypeHierarchy(editor);
339
 
                Tree tree = getHierarchyViewer().getTree();
340
 
                TreeItem item= checkTreeNode(tree, 0, "S1");
341
 
                assertEquals(0, item.getItemCount());
342
 
                checkMethodTable(new String[] {"a1", "b1"});
343
 
 
344
 
                editor.selectAndReveal(content.indexOf("a3"), 1);
345
 
                openTypeHierarchy(editor);
346
 
                tree = getHierarchyViewer().getTree();
347
 
                item= checkTreeNode(tree, 0, "S3");
348
 
                item= checkTreeNode(item, 0, "T3");
349
 
                assertEquals(0, item.getItemCount());
350
 
                checkMethodTable(new String[] {"a3", "b3"});
351
 
        }
352
 
 
353
 
        // union U1 {
354
 
        //    int a1;
355
 
        //    char b1;
356
 
        // };
357
 
        // typedef union U2 {
358
 
        //    int a2;
359
 
        //    int b2;
360
 
        // } U2;
361
 
        // typedef union U3 {
362
 
        //    int a3;
363
 
        //    int b3;
364
 
        // } T3;
365
 
        public void testUnionC() throws Exception {
366
 
                String content= getContentsForTest(1)[0].toString();
367
 
                IFile file= createFile(getProject(), "union.c", content);
368
 
                waitForIndexer(fIndex, file, INDEXER_WAIT_TIME);
369
 
                CEditor editor= openEditor(file);
370
 
 
371
 
                editor.selectAndReveal(content.indexOf("U1"), 1);
372
 
                openTypeHierarchy(editor);
373
 
                Tree tree = getHierarchyViewer().getTree();
374
 
                TreeItem item= checkTreeNode(tree, 0, "U1");
375
 
                assertEquals(0, item.getItemCount());
376
 
                checkMethodTable(new String[] {"a1", "b1"});
377
 
 
378
 
                editor.selectAndReveal(content.indexOf("U2"), 1);
379
 
                openTypeHierarchy(editor);
380
 
                tree = getHierarchyViewer().getTree();
381
 
                item = checkTreeNode(tree, 0, "U2");
382
 
                item= checkTreeNode(item, 0, "U2");
383
 
                assertEquals(0, item.getItemCount());
384
 
                checkMethodTable(new String[] {"a2", "b2"});
385
 
 
386
 
                editor.selectAndReveal(content.indexOf("U2;"), 1);
387
 
                openTypeHierarchy(editor);
388
 
                tree = getHierarchyViewer().getTree();
389
 
                item= checkTreeNode(tree, 0, "U2");
390
 
                item= checkTreeNode(item, 0, "U2");
391
 
                assertEquals(0, item.getItemCount());
392
 
                checkMethodTable(new String[0]);
393
 
                
394
 
                editor.selectAndReveal(content.indexOf("U3"), 1);
395
 
                openTypeHierarchy(editor);
396
 
                tree = getHierarchyViewer().getTree();
397
 
                item= checkTreeNode(tree, 0, "U3");
398
 
                item= checkTreeNode(item, 0, "T3");
399
 
                assertEquals(0, item.getItemCount());
400
 
                checkMethodTable(new String[] {"a3", "b3"});
401
 
 
402
 
                editor.selectAndReveal(content.indexOf("T3"), 1);
403
 
                openTypeHierarchy(editor);
404
 
                tree = getHierarchyViewer().getTree();
405
 
                item= checkTreeNode(tree, 0, "U3");
406
 
                item= checkTreeNode(item, 0, "T3");
407
 
                assertEquals(0, item.getItemCount());
408
 
                checkMethodTable(new String[0]);
409
 
        }
410
 
 
411
 
        // union U1 {
412
 
        //    int a1;
413
 
        //    char b1;
414
 
        // };
415
 
        public void testUnionCFromMember() throws Exception {
416
 
                String content= getContentsForTest(1)[0].toString();
417
 
                IFile file= createFile(getProject(), "unionmem.c", content);
418
 
                waitForIndexer(fIndex, file, INDEXER_WAIT_TIME);
419
 
                CEditor editor= openEditor(file);
420
 
 
421
 
                editor.selectAndReveal(content.indexOf("a1"), 1);
422
 
                openTypeHierarchy(editor);
423
 
                Tree tree = getHierarchyViewer().getTree();
424
 
                TreeItem item= checkTreeNode(tree, 0, "U1");
425
 
                assertEquals(0, item.getItemCount());
426
 
                checkMethodTable(new String[] {"a1", "b1"});
427
 
        }
428
 
 
429
 
        // union U1 {
430
 
        //    int a1;
431
 
        //    int b1;
432
 
        // };
433
 
        // typedef union U2 {
434
 
        //    int a2;
435
 
        //    int b2;
436
 
        // } U2;
437
 
        // typedef union U3 {
438
 
        //    int a3;
439
 
        //    int b3;
440
 
        // } T3;
441
 
        public void testUnionCPP() throws Exception {
442
 
                String content= getContentsForTest(1)[0].toString();
443
 
                IFile file= createFile(getProject(), "union.cpp", content);
444
 
                waitForIndexer(fIndex, file, INDEXER_WAIT_TIME);
445
 
                CEditor editor= openEditor(file);
446
 
 
447
 
                editor.selectAndReveal(content.indexOf("U1"), 1);
448
 
                openTypeHierarchy(editor);
449
 
                Tree tree = getHierarchyViewer().getTree();
450
 
                TreeItem item= checkTreeNode(tree, 0, "U1");
451
 
                assertEquals(0, item.getItemCount());
452
 
                checkMethodTable(new String[] {"a1", "b1"});
453
 
 
454
 
                editor.selectAndReveal(content.indexOf("U2"), 1);
455
 
                openTypeHierarchy(editor);
456
 
                tree = getHierarchyViewer().getTree();
457
 
                item= checkTreeNode(tree, 0, "U2");
458
 
                item= checkTreeNode(item, 0, "U2");
459
 
                assertEquals(0, item.getItemCount());
460
 
                checkMethodTable(new String[] {"a2", "b2"});
461
 
 
462
 
 
463
 
                editor.selectAndReveal(content.indexOf("U2;"), 1);
464
 
                openTypeHierarchy(editor);
465
 
                tree = getHierarchyViewer().getTree();
466
 
                item = checkTreeNode(tree, 0, "U2");
467
 
                item= checkTreeNode(item, 0, "U2");
468
 
                assertEquals(0, item.getItemCount());
469
 
                checkMethodTable(new String[0]);
470
 
 
471
 
                editor.selectAndReveal(content.indexOf("U3"), 1);
472
 
                openTypeHierarchy(editor);
473
 
                tree = getHierarchyViewer().getTree();
474
 
                item= checkTreeNode(tree, 0, "U3");
475
 
                item= checkTreeNode(item, 0, "T3");
476
 
                assertEquals(0, item.getItemCount());
477
 
                checkMethodTable(new String[] {"a3", "b3"});
478
 
                
479
 
                editor.selectAndReveal(content.indexOf("T3"), 1);
480
 
                openTypeHierarchy(editor);
481
 
                tree = getHierarchyViewer().getTree();
482
 
                item= checkTreeNode(tree, 0, "U3");
483
 
                item= checkTreeNode(item, 0, "T3");
484
 
                assertEquals(0, item.getItemCount());
485
 
                checkMethodTable(new String[0]);
486
 
        }
487
 
 
488
 
        // union U1 {
489
 
        //    int a1;
490
 
        //    int b1;
491
 
        // };
492
 
        // typedef union U2 {
493
 
        //    int a2;
494
 
        //    int b2;
495
 
        // } U2;
496
 
        // typedef union U3 {
497
 
        //    int a3;
498
 
        //    int b3;
499
 
        // } T3;
500
 
        public void testUnionCPPFromMember() throws Exception {
501
 
                String content= getContentsForTest(1)[0].toString();
502
 
                IFile file= createFile(getProject(), "unionmem.cpp", content);
503
 
                waitForIndexer(fIndex, file, INDEXER_WAIT_TIME);
504
 
                CEditor editor= openEditor(file);
505
 
 
506
 
                editor.selectAndReveal(content.indexOf("a1"), 1);
507
 
                openTypeHierarchy(editor);
508
 
                Tree tree = getHierarchyViewer().getTree();
509
 
                TreeItem item= checkTreeNode(tree, 0, "U1");
510
 
                assertEquals(0, item.getItemCount());
511
 
                checkMethodTable(new String[] {"a1", "b1"});
512
 
 
513
 
                editor.selectAndReveal(content.indexOf("b3"), 1);
514
 
                openTypeHierarchy(editor);
515
 
                tree = getHierarchyViewer().getTree();
516
 
                item= checkTreeNode(tree, 0, "U3");
517
 
                item= checkTreeNode(item, 0, "T3");
518
 
                assertEquals(0, item.getItemCount());
519
 
                checkMethodTable(new String[] {"a3", "b3"});
520
 
        }
521
 
}