Go to the source code of this file.
|
template<typename Char , int M, int N> |
void | TestInitGoogleMock (const Char *(&argv)[M], const Char *(&new_argv)[N], const ::std::string &expected_gmock_verbose) |
|
| TEST (InitGoogleMockTest, ParsesInvalidCommandLine) |
|
| TEST (InitGoogleMockTest, ParsesEmptyCommandLine) |
|
| TEST (InitGoogleMockTest, ParsesSingleFlag) |
|
| TEST (InitGoogleMockTest, ParsesMultipleFlags) |
|
| TEST (InitGoogleMockTest, ParsesUnrecognizedFlag) |
|
| TEST (InitGoogleMockTest, ParsesGoogleMockFlagAndUnrecognizedFlag) |
|
| TEST (WideInitGoogleMockTest, ParsesInvalidCommandLine) |
|
| TEST (WideInitGoogleMockTest, ParsesEmptyCommandLine) |
|
| TEST (WideInitGoogleMockTest, ParsesSingleFlag) |
|
| TEST (WideInitGoogleMockTest, ParsesMultipleFlags) |
|
| TEST (WideInitGoogleMockTest, ParsesUnrecognizedFlag) |
|
| TEST (WideInitGoogleMockTest, ParsesGoogleMockFlagAndUnrecognizedFlag) |
|
| TEST (FlagTest, IsAccessibleInCode) |
|
◆ TEST() [1/13]
TEST |
( |
FlagTest | , |
|
|
IsAccessibleInCode | ) |
Definition at line 258 of file gmock_test.cc.
258 {
259 bool dummy = testing::GMOCK_FLAG(catch_leaked_mocks) &&
260 testing::GMOCK_FLAG(verbose) == "";
261 (void)dummy;
262}
constexpr enabler dummy
An instance to use in EnableIf.
◆ TEST() [2/13]
TEST |
( |
InitGoogleMockTest | , |
|
|
ParsesEmptyCommandLine | ) |
Definition at line 79 of file gmock_test.cc.
79 {
80 const char*
argv[] = {
81 "foo.exe",
82 NULL
83 };
84
85 const char* new_argv[] = {
86 "foo.exe",
87 NULL
88 };
89
91}
void TestInitGoogleMock(const Char *(&argv)[M], const Char *(&new_argv)[N], const ::std::string &expected_gmock_verbose)
◆ TEST() [3/13]
TEST |
( |
InitGoogleMockTest | , |
|
|
ParsesGoogleMockFlagAndUnrecognizedFlag | ) |
Definition at line 144 of file gmock_test.cc.
144 {
145 const char*
argv[] = {
146 "foo.exe",
147 "--non_gmock_flag=blah",
148 "--gmock_verbose=error",
149 NULL
150 };
151
152 const char* new_argv[] = {
153 "foo.exe",
154 "--non_gmock_flag=blah",
155 NULL
156 };
157
159}
◆ TEST() [4/13]
TEST |
( |
InitGoogleMockTest | , |
|
|
ParsesInvalidCommandLine | ) |
Definition at line 67 of file gmock_test.cc.
67 {
68 const char*
argv[] = {
69 NULL
70 };
71
72 const char* new_argv[] = {
73 NULL
74 };
75
77}
◆ TEST() [5/13]
TEST |
( |
InitGoogleMockTest | , |
|
|
ParsesMultipleFlags | ) |
Definition at line 108 of file gmock_test.cc.
108 {
109 int old_default_behavior =
GMOCK_FLAG(default_mock_behavior);
110 const wchar_t*
argv[] = {
111 L"foo.exe",
112 L"--gmock_verbose=info",
113 L"--gmock_default_mock_behavior=2",
114 NULL
115 };
116
117 const wchar_t* new_argv[] = {
118 L"foo.exe",
119 NULL
120 };
121
125 GMOCK_FLAG(default_mock_behavior) = old_default_behavior;
126}
#define EXPECT_EQ(val1, val2)
#define EXPECT_NE(val1, val2)
◆ TEST() [6/13]
TEST |
( |
InitGoogleMockTest | , |
|
|
ParsesSingleFlag | ) |
Definition at line 93 of file gmock_test.cc.
93 {
94 const char*
argv[] = {
95 "foo.exe",
96 "--gmock_verbose=info",
97 NULL
98 };
99
100 const char* new_argv[] = {
101 "foo.exe",
102 NULL
103 };
104
106}
◆ TEST() [7/13]
TEST |
( |
InitGoogleMockTest | , |
|
|
ParsesUnrecognizedFlag | ) |
Definition at line 128 of file gmock_test.cc.
128 {
129 const char*
argv[] = {
130 "foo.exe",
131 "--non_gmock_flag=blah",
132 NULL
133 };
134
135 const char* new_argv[] = {
136 "foo.exe",
137 "--non_gmock_flag=blah",
138 NULL
139 };
140
142}
◆ TEST() [8/13]
TEST |
( |
WideInitGoogleMockTest | , |
|
|
ParsesEmptyCommandLine | ) |
Definition at line 173 of file gmock_test.cc.
173 {
174 const wchar_t*
argv[] = {
175 L"foo.exe",
176 NULL
177 };
178
179 const wchar_t* new_argv[] = {
180 L"foo.exe",
181 NULL
182 };
183
185}
◆ TEST() [9/13]
TEST |
( |
WideInitGoogleMockTest | , |
|
|
ParsesGoogleMockFlagAndUnrecognizedFlag | ) |
Definition at line 238 of file gmock_test.cc.
238 {
239 const wchar_t*
argv[] = {
240 L"foo.exe",
241 L"--non_gmock_flag=blah",
242 L"--gmock_verbose=error",
243 NULL
244 };
245
246 const wchar_t* new_argv[] = {
247 L"foo.exe",
248 L"--non_gmock_flag=blah",
249 NULL
250 };
251
253}
◆ TEST() [10/13]
TEST |
( |
WideInitGoogleMockTest | , |
|
|
ParsesInvalidCommandLine | ) |
Definition at line 161 of file gmock_test.cc.
161 {
162 const wchar_t*
argv[] = {
163 NULL
164 };
165
166 const wchar_t* new_argv[] = {
167 NULL
168 };
169
171}
◆ TEST() [11/13]
TEST |
( |
WideInitGoogleMockTest | , |
|
|
ParsesMultipleFlags | ) |
Definition at line 202 of file gmock_test.cc.
202 {
203 int old_default_behavior =
GMOCK_FLAG(default_mock_behavior);
204 const wchar_t*
argv[] = {
205 L"foo.exe",
206 L"--gmock_verbose=info",
207 L"--gmock_default_mock_behavior=2",
208 NULL
209 };
210
211 const wchar_t* new_argv[] = {
212 L"foo.exe",
213 NULL
214 };
215
219 GMOCK_FLAG(default_mock_behavior) = old_default_behavior;
220}
◆ TEST() [12/13]
TEST |
( |
WideInitGoogleMockTest | , |
|
|
ParsesSingleFlag | ) |
Definition at line 187 of file gmock_test.cc.
187 {
188 const wchar_t*
argv[] = {
189 L"foo.exe",
190 L"--gmock_verbose=info",
191 NULL
192 };
193
194 const wchar_t* new_argv[] = {
195 L"foo.exe",
196 NULL
197 };
198
200}
◆ TEST() [13/13]
TEST |
( |
WideInitGoogleMockTest | , |
|
|
ParsesUnrecognizedFlag | ) |
Definition at line 222 of file gmock_test.cc.
222 {
223 const wchar_t*
argv[] = {
224 L"foo.exe",
225 L"--non_gmock_flag=blah",
226 NULL
227 };
228
229 const wchar_t* new_argv[] = {
230 L"foo.exe",
231 L"--non_gmock_flag=blah",
232 NULL
233 };
234
236}
◆ TestInitGoogleMock()
template<typename Char , int M, int N>
void TestInitGoogleMock |
( |
const Char *(&) | argv[M], |
|
|
const Char *(&) | new_argv[N], |
|
|
const ::std::string & | expected_gmock_verbose ) |
Definition at line 51 of file gmock_test.cc.
52 {
53 const ::std::string old_verbose =
GMOCK_FLAG(verbose);
54
55 int argc = M - 1;
56 InitGoogleMock(&argc,
const_cast<Char**
>(
argv));
57 ASSERT_EQ(
N - 1, argc) <<
"The new argv has wrong number of elements.";
58
59 for (
int i = 0; i <
N; i++) {
61 }
62
65}
#define ASSERT_EQ(val1, val2)
#define EXPECT_STREQ(s1, s2)