41 #if !defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
47 template <
typename Char,
int M,
int N>
49 const ::std::string& expected_gmock_verbose) {
54 ASSERT_EQ(N - 1, 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[] = {
nullptr};
67 const char* new_argv[] = {
nullptr};
72 TEST(InitGoogleMockTest, ParsesEmptyCommandLine) {
73 const char* argv[] = {
"foo.exe",
nullptr};
75 const char* new_argv[] = {
"foo.exe",
nullptr};
80 TEST(InitGoogleMockTest, ParsesSingleFlag) {
81 const char* argv[] = {
"foo.exe",
"--gmock_verbose=info",
nullptr};
83 const char* new_argv[] = {
"foo.exe",
nullptr};
88 TEST(InitGoogleMockTest, ParsesMultipleFlags) {
90 const wchar_t* argv[] = {L
"foo.exe", L
"--gmock_verbose=info",
91 L
"--gmock_default_mock_behavior=2",
nullptr};
93 const wchar_t* new_argv[] = {L
"foo.exe",
nullptr};
101 TEST(InitGoogleMockTest, ParsesUnrecognizedFlag) {
102 const char* argv[] = {
"foo.exe",
"--non_gmock_flag=blah",
nullptr};
104 const char* new_argv[] = {
"foo.exe",
"--non_gmock_flag=blah",
nullptr};
109 TEST(InitGoogleMockTest, ParsesGoogleMockFlagAndUnrecognizedFlag) {
110 const char* argv[] = {
"foo.exe",
"--non_gmock_flag=blah",
111 "--gmock_verbose=error",
nullptr};
113 const char* new_argv[] = {
"foo.exe",
"--non_gmock_flag=blah",
nullptr};
118 TEST(WideInitGoogleMockTest, ParsesInvalidCommandLine) {
119 const wchar_t* argv[] = {
nullptr};
121 const wchar_t* new_argv[] = {
nullptr};
126 TEST(WideInitGoogleMockTest, ParsesEmptyCommandLine) {
127 const wchar_t* argv[] = {L
"foo.exe",
nullptr};
129 const wchar_t* new_argv[] = {L
"foo.exe",
nullptr};
134 TEST(WideInitGoogleMockTest, ParsesSingleFlag) {
135 const wchar_t* argv[] = {L
"foo.exe", L
"--gmock_verbose=info",
nullptr};
137 const wchar_t* new_argv[] = {L
"foo.exe",
nullptr};
142 TEST(WideInitGoogleMockTest, ParsesMultipleFlags) {
144 const wchar_t* argv[] = {L
"foo.exe", L
"--gmock_verbose=info",
145 L
"--gmock_default_mock_behavior=2",
nullptr};
147 const wchar_t* new_argv[] = {L
"foo.exe",
nullptr};
155 TEST(WideInitGoogleMockTest, ParsesUnrecognizedFlag) {
156 const wchar_t* argv[] = {L
"foo.exe", L
"--non_gmock_flag=blah",
nullptr};
158 const wchar_t* new_argv[] = {L
"foo.exe", L
"--non_gmock_flag=blah",
nullptr};
163 TEST(WideInitGoogleMockTest, ParsesGoogleMockFlagAndUnrecognizedFlag) {
164 const wchar_t* argv[] = {L
"foo.exe", L
"--non_gmock_flag=blah",
165 L
"--gmock_verbose=error",
nullptr};
167 const wchar_t* new_argv[] = {L
"foo.exe", L
"--non_gmock_flag=blah",
nullptr};
172 #endif // !defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
175 TEST(FlagTest, IsAccessibleInCode) {
void TestInitGoogleMock(const Char *(&argv)[M], const Char *(&new_argv)[N], const ::std::string &expected_gmock_verbose)
#define EXPECT_NE(val1, val2)
GTEST_API_ void InitGoogleMock(int *argc, char **argv)
#define TEST(test_suite_name, test_name)
#define ASSERT_EQ(val1, val2)
#define GMOCK_FLAG_GET(name)
#define EXPECT_STREQ(s1, s2)
#define GMOCK_FLAG_SET(name, value)
#define EXPECT_EQ(val1, val2)