-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathTestSampleClass.h
More file actions
794 lines (676 loc) · 12.1 KB
/
TestSampleClass.h
File metadata and controls
794 lines (676 loc) · 12.1 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
#include <vector>
#include <string>
using namespace std;
class SampleClass: public BaseSampleClass
{
public:
enum Elephant
{
EL_ONE = 1,
EL_TWO = 2,
EL_NINE = 9,
EL_TEN,
};
SampleClass();
/*!
* Method 1
*/
string meth1();
///
/// Method 2 description
///
/// @param v1 Variable 1
///
int meth2(int v1);
/**
* Method 3 description
*
* \param v1 Variable 1 with a really long
* wrapping description
* \param v2 Variable 2
*/
void meth3(const string & v1, vector<string> & v2);
/**********************************
* Method 4 description
*
* @return Return value
*********************************/
unsigned int meth4();
private:
void * meth5(){return NULL;}
/// prop1 description
string prop1;
//! prop5 description
int prop5;
bool prop6; /*!< prop6 description */
double prop7; //!< prop7 description
//!< with two lines
/// prop8 description
int prop8;
};
namespace Alpha
{
class AlphaClass
{
public:
AlphaClass();
void alphaMethod();
string alphaString;
protected:
typedef enum
{
Z_A,
Z_B = 0x2B,
Z_C = 'j',
Z_D,
} Zebra;
};
namespace Omega
{
class OmegaClass
{
public:
OmegaClass();
string omegaString;
protected:
///
/// @brief Rino Numbers, not that that means anything
///
typedef enum
{
RI_ZERO, /// item zero
RI_ONE, /** item one */
RI_TWO, //!< item two
RI_THREE,
/// item four
RI_FOUR,
} Rino;
};
};
}
//Sample class for bug 3488053
class Bug_3488053
{
public:
class Bug_3488053_Nested
{
public:
int x;
};
};
// Bug 3488360
namespace Citrus
{
class BloodOrange { };
}
class Bananna: public Citrus::BloodOrange
{
};
class ExcellentCake: private Citrus::BloodOrange, Convoluted::Nested::Mixin
{
};
// Bug 3487551
class Bug_3487551
{
public:
virtual int method();
};
// Feature Request 3488051
struct SampleStruct
{
unsigned int meth();
private:
int prop;
};
// Bug 3488049 & Feature Request 3488050
const int MAX_ITEM = 7;
class Bird
{
int items[MAX_ITEM];
int otherItems[7];
int oneItem;
};
// Bug 3488054
class Monkey {
private:
static void Create();
};
inline void Monkey::Create() { }
// Bug 3488275
class Chicken
{
template <typename T> static T Get();
};
template <typename T> T Chicken::Get() { return T(); }
// Bug 3491240
class Lizzard {
Lizzard();
explicit Lizzard( int a );
};
// Bug 3491178
class Owl {
private:
template <typename T> int* tFunc( int count );
};
template <typename T> int* Owl::tFunc( int count ) {
if (count == 0) {
return NULL;
}
return NULL;
}
// Bug 3491232
class GrapeClass {
private:
struct GrapeStruct { };
int x;
void f();
};
// Bug 3491319
struct AnonHolderClass {
struct {
int x;
} a;
};
// Feature Request 3491220
class CowClass {};
struct CowStruct {};
// Bug 3491334
class BaseMangoClass { };
class MangoClass: virtual public BaseMangoClass { };
// Bug 3492237
const long MAX_LEN = 7;
class EagleClass {
int a[(int)MAX_LEN];
};
// Bug 3497164
class FrogClass {
struct {
int a;
} x;
struct {
int b;
} y;
struct {
int c;
} z;
};
// Bug 3497160
class DogClass;
class CatClass {
friend DogClass;
};
// Bug 3497155
extern "C" {
int FishA( const char* strA );
int FishB( const char* strB );
}
// Bug 3497168
class PandaClass {
static const int CONST_A = (1 << 7) - 1;
static const int CONST_B = sizeof(int);
};
// Bug 3497166
class PotatoClass {
struct FwdStruct;
FwdStruct* ptr;
struct FwdStruct {
int a;
};
};
// Bug 3497162
class HogClass {
union HogUnion {
int a;
float b;
} u;
};
// Bug 3497158
class CherryClass {
template< int ID >
public:
void CherryClass ();
struct NestStruct {
void FuncA();
int val;
};
};
// Bug 3517308
template<class T>
class GarlicClass
{
public:
GarlicClass();
int fun1(T);
int fun2(T);
};
// Bug 3514728
class CarrotClass
{
int var1;
#define FIRSTLINE \
SECONDLINE
void fun1();
};
// Bug 3517289
extern "C" void f(int i, char c, float x);
extern "C" {
int fun1(SP1, SP2);
int fun2(SP1, SP2);
class ExternClass
{
ExternClass();
}
};
// Bug 3514671
struct OliveStruct{
struct other* a;
void* b;
boolean c;
int d;
};
// Bug 3515330
namespace RoosterNamespace
{
class RoosterOuterClass
{
public:
int member1;
class RoosterSubClass1
{
public:
int publicMember1;
private:
int privateMember1;
};
private:
int member2;
class RoosterSubClass2
{
public:
int publicMember2;
private:
int privateMember2;
};
};
}
// Bug 3514672
class OperatorClass
{
public:
void operator= (const Sample25Class&);
void operator-= (const Sample25Class&);
void operator+=();
void operator[]();
bool operator == (const int &b);
operator+();
void operator-();
void operator*();
void operator\();
void operator%();
void operator^();
void operator|();
void operator&();
void operator~();
void operator<<();
void operator>>();
void operator!=();
void operator<();
void operator>();
void operator>=();
void operator<=();
void operator!();
void operator&&();
void operator||();
void operator+=();
void operator-=();
void operator*=();
void operator\=();
void operator%=();
void operator&=();
void operator|=();
void operator^=();
void operator<<=();
void operator>>=();
void operator++();
void operator--();
void operator()();
void operator->();
void operator,();
};
// Feature request 3519502 & 3523010
class CrowClass
{
public:
int meth();
public slots:
void testSlot(int i);
};
// Bug 3497170
struct DriverFuncs {
void* (*init) ();
void (*write) (void *buf, int buflen);
};
// Bug 3519178
template<class T> SnailTemplateClass
{
};
namespace SnailNamespace2
{
class SnailClass
{
};
}
class Snail2Class
{
public:
SnailNamespace::SnailClass meth(tr1::shared_ptr<SnailTemplateClass<SnailNamespace::SnailClass> >);
};
// Feature Request 3523198
class QualeClass : public QObject
{
Q_OBJECT
void func();
};
// Feature Request 3523235
class RockClass
{
int getNum() const;
int getNum2();
};
// Bug 3523196
class AlmondClass
{
public:
std::map<unsigned, std::pair<unsigned, SnailTemplateClass<SnailNamespace::SnailClass> > > meth(bool flag,
std::map<unsigned, std::pair<unsigned, SnailTemplateClass<SnailNamespace::SnailClass> > > bigArg);
};
// Bug 3524327
class StoneClass
{
virtual int getNum2() const = 0;
int getNum3();
};
// Bug 3531219
class Kangaroo
{
public:
Kangaroo() {
}
class Joey
{
public:
Joey();
};
};
// Bug 3535465
class Ant
{
public:
Ant(uint index, const FiniteElement& element, const ufc::cell& cell)
: index(index), element(element), cell(cell) {}
Ant(MeshEntity& entity) : MeshEntity(entity.mesh(), 1, entity.index())
{}
};
// Bug 3536069
template <typename Plant> struct Onion<Red,Plant>
{
int i;
};
template <typename Plant> struct Onion<Sweet,Plant>
{
int i;
};
// Bug 3536067
class BlueJay : public Bird, public virtual Food
{
public:
BlueJay() {}
};
// Bug 3536071
class Pea : public Vegetable<Green>
{
int i;
}
// Bug 3567172
class Pear
{
enum Stem stem_property;
}
// Bug 3567854 and 3568241
struct Beans
{
UINT16 hdr;
union
{
UINT16 typeA;
UINT16 typeB;
UINT16 raw[3];
};
UINT32 data[204];
union
{
UINT16 typeC;
UINT16 typeD;
UINT16 raw[3];
};
};
// Bug 3568629
void termite(void)
{
return ((structA*) (Func())->element);
}
// Bug 3569622
class Japyx
{
public:
enum enum1
{
e1, // 00
e2, // 01
};
UINT32 a;
};
void japyxFunc(struct s1 *pS, Japyx::enum1 x, MYTYPE myVar);
// Bug 3570105
enum Author
{
NAME = ('J' << 24 | \
'A' << 16 | \
'S' << 8 | \
'H'),
};
// Bug 3577484
template <> class FruitFly<int>: public Fly { };
// Bug BitBucket #2
MAGIC_BEGIN_MACRO(glitter, int)
NOT_FINISHED,
FINISHED
MAGIC_END_MACRO(glitter)
class ClassAfterMagicMacro
{
public:
ClassAfterMagicMacro();
}
// Bug BitBucket #4
typedef unsigned int uint;
typedef char ** string_array;
typedef std::tr1::shared_ptr< ObjPtr > SmartObjPtr;
typedef std::map<std::string, std::string> StrStrMap;
class AfterTypedefClass
{
public:
}
// Bug BitBucket #5
class Herb
{
};
class Herb::Cilantro : public Plant
{
};
// Bug BitBucket #7
#include <iostream>
int print_statement() {
cout << "Heyyy" << endl;
}
// Bug BitBucket #8
class Garlic {
public:
friend int genNum(C& a)
{
return obj.meth().num();
}
};
// Bug SourceForge #54
enum Wheat
{
w1,
w2,
w3,
} __attribute__((packed));
// Bug SourceForge #55
class Peach
{
int abc;
};
class Plumb
{
class Peach * doSomethingGreat( class Peach * pInCurPtr );
class Peach * var;
};
class Peach * Plumb::myMethod( class Peach * pInPtr )
{
return pInPtr;
}
// Bug BitBucket #9
class Grape
{
public:
int a, b,c;
map<string, int> d;
map<string, int> e, f;
const int* g, const& h, const* i, j;
};
// Bug BitBucket #14
struct Avacado {
uint8_t foo() { return 4;}
::uint8_t bar() { return 0; }
};
// Bug BitBucket #13
typedef struct
{
int anon_struct_variable;
};
typedef struct
{
int a;
} Raspberry;
// Bug BitBucket #15 & 16
class Hen
{
public:
void add(int a=100, b=0xfd, float c=1.7e-3, float d=3.14);
void join(string s1="", string s2="nothing");
}
// Bug BitBucket #19
template<typename VALUE,
typename VALUE_SET_ITERATOR,
typename ACCESOR=Raddish::SimpleAccessor<VALUE,VALUE_SET_ITERATOR> >
class Raddish_SetIterator : public Raddish_Iterator<VALUE>
{
protected:
VALUE_SET_ITERATOR _beg, _end;
public:
Raddish_SetIterator(const VALUE_SET_ITERATOR & begin,
const VALUE_SET_ITERATOR & end)
{ init ( begin, end ); }
};
// Bug 57
typedef enum{StarFruit = (2 + 2) / 2} Carambola;
// Add support for globals
extern int externVar;
int globalVar;
// BitBucket bug 22
typedef char TenCharArray[10];
// Support typedef structs
typedef struct SUPER_MAGIC_FILE MAGIC_FILE;
typedef struct _IO_FILE FILE;
// Sourceforge issue #10: Multi dimensional array sizes
struct Picture
{
char name[25];
unsigned int pdata[128][128];
};
// SourceForge bug 58
typedef union apricot_t
{
int i;
float f;
char s[20];
}Apricot;
// SourcForge bug 59
struct Lemon
{
virtual void foo() final;
virtual void foo2();
};
struct Lime final : Lemon
{
void abc();
void foo2() override;
};
// BitBucket bug 24
namespace MouseNS
{
class MouseClass
{
public:
typedef std::vector<int> mouse_typedef;
void meth(mouse_typedef *tptr) {};
};
};
// BitBucket bug 26
typedef struct Fig {
int a;
} Fig;
// BitBucket bug 27
union olive {
int x;
};
// Sourceforge bug 61
typedef struct
{
enum BeetEnum : int
{
FAIL = 0,
PASS = 1
};
} BeetStruct;
void set_callback(int* b, long (*callback) (struct test_st *, int, const char*, int long, long, long));
// Bitbucket bug 35
struct Grackle
{
void no_noexcept();
void just_noexcept() noexcept;
void const_noexcept() const noexcept;
void noexcept_bool() noexcept(true);
void const_noexcept_bool() const noexcept(true);
void noexcept_noexceptOperator() noexcept(noexcept(Grackle()));
void const_noexcept_noexceptOperator() const noexcept(noexcept(Grackle()));
};
// Two prototypes that are the same apart from the ...
int vararg_func(int foo, const char* fmt, ...);
int non_vararg_func(int foo, const char* fmt);
// Sample class for testing default constructor destructor
class DefaultConstDest {
public:
DefaultConstDest() =default ; // spacing check
DefaultConstDest() = default ; // spacing check
};
// default constructor on a class containing "default" as name (edge case check)
class default_class_tricky {
public:
default_class_tricky();
default_class_tricky();
void randomMethod1_default();
void defaultrandomMethod2();
};