MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / BoolFromGTestEnv

Function BoolFromGTestEnv

rtpose_wrapper/src/gtest/gtest-all.cpp:8508–8513  ·  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

8506//
8507// The value is considered true iff it's not "0".
8508bool BoolFromGTestEnv(const char* flag, bool default_value) {
8509 const String env_var = FlagToEnvVar(flag);
8510 const char* const string_value = posix::GetEnv(env_var.c_str());
8511 return string_value == NULL ?
8512 default_value : strcmp(string_value, "0") != 0;
8513}
8514
8515// Reads and returns a 32-bit integer stored in the environment
8516// variable corresponding to the given flag; if it isn't set or

Callers 1

gtest-all.cppFile · 0.85

Calls 2

FlagToEnvVarFunction · 0.85
GetEnvFunction · 0.85

Tested by

no test coverage detected