32 #include "gmock/gmock.h" 33 #include "gmock/internal/gmock-port.h" 41 "true iff Google Mock should report leaked mock objects " 45 "Controls how verbose Google Mock's output is." 47 " info - prints all messages.\n" 48 " warning - prints warnings and errors.\n" 49 " error - prints errors only.");
62 if (str == NULL || flag == NULL)
return NULL;
66 const size_t flag_len = flag_str.length();
67 if (strncmp(str, flag_str.c_str(), flag_len) != 0)
return NULL;
70 const char* flag_end = str + flag_len;
73 if (def_optional && (flag_end[0] ==
'\0')) {
80 if (flag_end[0] !=
'=')
return NULL;
97 if (value_str == NULL)
return false;
100 *value = !(*value_str ==
'0' || *value_str ==
'f' || *value_str ==
'F');
109 template <
typename String>
116 if (value_str == NULL)
return false;
127 template <
typename CharType>
132 if (*argc <= 0)
return;
134 for (
int i = 1;
i != *argc;
i++) {
136 const char*
const arg = arg_string.c_str();
146 for (
int j = i; j != *argc; j++) {
147 argv[j] = argv[j + 1];
GTEST_API_ void InitGoogleMock(int *argc, char **argv)
GMOCK_DEFINE_bool_(catch_leaked_mocks, true,"true iff Google Mock should report leaked mock objects ""as failures.")
std::string StreamableToString(const T &streamable)
static bool ParseGoogleMockBoolFlag(const char *str, const char *flag, bool *value)
const char kWarningVerbosity[]
void InitGoogleMockImpl(int *argc, CharType **argv)
GMOCK_DEFINE_string_(verbose, internal::kWarningVerbosity,"Controls how verbose Google Mock's output is."" Valid values:\n"" info - prints all messages.\n"" warning - prints warnings and errors.\n"" error - prints errors only.")
static const char * ParseGoogleMockFlagValue(const char *str, const char *flag, bool def_optional)
static const char *const value
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
static bool ParseGoogleMockStringFlag(const char *str, const char *flag, String *value)