Repository navigation
Expand file tree
/
Copy pathunittest.cpp
More file actions
118 lines (85 loc) · 1.61 KB
/
Copy pathunittest.cpp
File metadata and controls
118 lines (85 loc) · 1.61 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
#include <vector>
class A
{
public:
int test;
};
A a;
a.test;
std::vector<A> v;
v.front().test;
typedef std::vector<A> AV;
AV av;
av.front().test;
class B
{
public:
AV variable;
std::vector<A> variable2;
};
B b;
b.variable.front().test;
b.variable2.front().test;
class B2
{
public:
std::vector<AV> variable;
std::vector<std::vector<A> > variable2;
};
B2 b2;
b2.variable.front().back().test;
b2.variable2.front().back().test;
class B3
{
public:
std::vector<std::vector<AV> > variable;
std::vector<std::vector<std::vector<A> > > variable2;
};
B3 b3;
b3.variable.front().back().front().test;
b3.variable2.front().back().front().test;
template <typename T>
class TempA
{
public:
T& GetT() { return mT;}
T mT;
};
template <typename T>
class TempB
{
public:
T& GetTB() { return mT; }
T mTB;
};
TempA<A> ta;
ta.GetT().test;
TempA<TempB<TempA<TempB<A> > > > ta2;
ta2.GetT().GetTB().GetT().GetTB().test;
ta2.mT.mTB.mT.mTB.test;
typedef TempA<TempB<TempA<TempB<A> > > > Tababa;
Tababa tababa;
tababa.GetT().GetTB().GetT().GetTB().test;
tababa.mT.mTB.mT.mTB.test;
class Tababa_class
{
public:
Tababa GetTababa();
Tababa mTababa;
TempA<TempB<TempA<TempB<A> > > > GetTababa2();
TempA<TempB<TempA<TempB<A> > > > mTababa2;
};
Tababa_class tababa2;
tababa2.GetTababa().GetT().GetTB().GetT().GetTB().test;
tababa2.mTababa.GetT().GetTB().GetT().GetTB().test;
#include <string>
#include <boost/shared_ptr.hpp>
std::string str;
str.c_str();
boost::shared_ptr<std::vector<std::string> > strtest;
strtest.reset();
strtest->back()->c_str();
int test(AV& v)
{
v.back().test;
}