MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / BoolFromGTestEnv

Function BoolFromGTestEnv

tests/gtest/gtest-all.cc:11038–11047  ·  view source on GitHub ↗

Reads and returns the Boolean environment variable corresponding to the given flag; if it's not set, returns default_value. The value is considered true iff it's not "0".

Source from the content-addressed store, hash-verified

11036//
11037// The value is considered true iff it's not "0".
11038bool BoolFromGTestEnv(const char* flag, bool default_value) {
11039#if defined(GTEST_GET_BOOL_FROM_ENV_)
11040 return GTEST_GET_BOOL_FROM_ENV_(flag, default_value);
11041#else
11042 const std::string env_var = FlagToEnvVar(flag);
11043 const char* const string_value = posix::GetEnv(env_var.c_str());
11044 return string_value == nullptr ? default_value
11045 : strcmp(string_value, "0") != 0;
11046#endif // defined(GTEST_GET_BOOL_FROM_ENV_)
11047}
11048
11049// Reads and returns a 32-bit integer stored in the environment
11050// variable corresponding to the given flag; if it isn't set or

Callers 1

gtest-all.ccFile · 0.85

Calls 2

FlagToEnvVarFunction · 0.85
GetEnvFunction · 0.85

Tested by

no test coverage detected