36 #include "gmock/gmock.h" 39 #include "gtest/gtest.h" 47 template <
typename Char,
int M,
int N>
54 ASSERT_EQ(N, argc) <<
"The new argv has wrong number of elements.";
56 for (
int i = 0; i < N; i++) {
64 TEST(InitGoogleMockTest, ParsesInvalidCommandLine) {
65 const char* argv[] = {
69 const char* new_argv[] = {
76 TEST(InitGoogleMockTest, ParsesEmptyCommandLine) {
77 const char* argv[] = {
82 const char* new_argv[] = {
90 TEST(InitGoogleMockTest, ParsesSingleFlag) {
91 const char* argv[] = {
93 "--gmock_verbose=info",
97 const char* new_argv[] = {
105 TEST(InitGoogleMockTest, ParsesUnrecognizedFlag) {
106 const char* argv[] = {
108 "--non_gmock_flag=blah",
112 const char* new_argv[] = {
114 "--non_gmock_flag=blah",
121 TEST(InitGoogleMockTest, ParsesGoogleMockFlagAndUnrecognizedFlag) {
122 const char* argv[] = {
124 "--non_gmock_flag=blah",
125 "--gmock_verbose=error",
129 const char* new_argv[] = {
131 "--non_gmock_flag=blah",
138 TEST(InitGoogleMockTest, CallsInitGoogleTest) {
140 const char* argv[] = {
142 "--non_gmock_flag=blah",
143 "--gmock_verbose=error",
147 const char* new_argv[] = {
149 "--non_gmock_flag=blah",
157 TEST(WideInitGoogleMockTest, ParsesInvalidCommandLine) {
158 const wchar_t* argv[] = {
162 const wchar_t* new_argv[] = {
169 TEST(WideInitGoogleMockTest, ParsesEmptyCommandLine) {
170 const wchar_t* argv[] = {
175 const wchar_t* new_argv[] = {
183 TEST(WideInitGoogleMockTest, ParsesSingleFlag) {
184 const wchar_t* argv[] = {
186 L
"--gmock_verbose=info",
190 const wchar_t* new_argv[] = {
198 TEST(WideInitGoogleMockTest, ParsesUnrecognizedFlag) {
199 const wchar_t* argv[] = {
201 L
"--non_gmock_flag=blah",
205 const wchar_t* new_argv[] = {
207 L
"--non_gmock_flag=blah",
214 TEST(WideInitGoogleMockTest, ParsesGoogleMockFlagAndUnrecognizedFlag) {
215 const wchar_t* argv[] = {
217 L
"--non_gmock_flag=blah",
218 L
"--gmock_verbose=error",
222 const wchar_t* new_argv[] = {
224 L
"--non_gmock_flag=blah",
231 TEST(WideInitGoogleMockTest, CallsInitGoogleTest) {
233 const wchar_t* argv[] = {
235 L
"--non_gmock_flag=blah",
236 L
"--gmock_verbose=error",
240 const wchar_t* new_argv[] = {
242 L
"--non_gmock_flag=blah",
251 TEST(FlagTest, IsAccessibleInCode) {
void TestInitGoogleMock(const Char *(&argv)[M], const Char *(&new_argv)[N], const ::std::string &expected_gmock_verbose)
GTEST_API_ void InitGoogleMock(int *argc, char **argv)
GTEST_API_ int g_init_gtest_count
#define EXPECT_STREQ(expected, actual)
TEST(InitGoogleMockTest, ParsesInvalidCommandLine)
#define ASSERT_EQ(val1, val2)
#define EXPECT_EQ(expected, actual)