50# include <mach/mach_init.h>
51# include <mach/task.h>
52# include <mach/vm_map.h>
58# include <sys/procfs.h>
63# include <sys/types.h>
67# include <zircon/process.h>
68# include <zircon/syscalls.h>
80#if defined(_MSC_VER) || defined(__BORLANDC__)
93T ReadProcFileField(
const std::string& filename,
int field) {
95 std::ifstream file(filename.c_str());
107 const std::string filename =
108 (
Message() <<
"/proc/" << getpid() <<
"/stat").GetString();
109 return ReadProcFileField<int>(filename, 19);
115 const task_t task = mach_task_self();
116 mach_msg_type_number_t thread_count;
117 thread_act_array_t thread_list;
118 const kern_return_t status = task_threads(task, &thread_list, &thread_count);
119 if (status == KERN_SUCCESS) {
123 reinterpret_cast<vm_address_t
>(thread_list),
124 sizeof(thread_t) * thread_count);
125 return static_cast<size_t>(thread_count);
136 const int fd =
open(
"/proc/self/as", O_RDONLY);
140 procfs_info process_info;
142 devctl(fd, DCMD_PROC_INFO, &process_info,
sizeof(process_info), NULL);
145 return static_cast<size_t>(process_info.num_threads);
154 struct procentry64 entry;
155 pid_t pid = getpid();
156 int status = getprocs64(&entry,
sizeof(entry), NULL, 0, &pid, 1);
158 return entry.pi_thcount;
164#elif GTEST_OS_FUCHSIA
169 zx_status_t status = zx_object_get_info(
171 ZX_INFO_PROCESS_THREADS,
176 if (status == ZX_OK) {
193#if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
195void SleepMilliseconds(
int n) {
199AutoHandle::AutoHandle()
200 : handle_(INVALID_HANDLE_VALUE) {}
202AutoHandle::AutoHandle(Handle handle)
205AutoHandle::~AutoHandle() {
209AutoHandle::Handle AutoHandle::Get()
const {
213void AutoHandle::Reset() {
214 Reset(INVALID_HANDLE_VALUE);
217void AutoHandle::Reset(HANDLE handle) {
219 if (handle_ != handle) {
221 ::CloseHandle(handle_);
226 <<
"Resetting a valid handle to itself is likely a programmer error "
227 "and thus not allowed.";
231bool AutoHandle::IsCloseable()
const {
234 return handle_ != NULL && handle_ != INVALID_HANDLE_VALUE;
237Notification::Notification()
238 : event_(::CreateEvent(NULL,
245void Notification::Notify() {
249void Notification::WaitForNotification() {
251 ::WaitForSingleObject(event_.Get(), INFINITE) == WAIT_OBJECT_0);
255 : owner_thread_id_(0),
257 critical_section_init_phase_(0),
258 critical_section_(new CRITICAL_SECTION) {
259 ::InitializeCriticalSection(critical_section_);
268 if (type_ == kDynamic) {
269 ::DeleteCriticalSection(critical_section_);
270 delete critical_section_;
271 critical_section_ = NULL;
276 ThreadSafeLazyInit();
277 ::EnterCriticalSection(critical_section_);
278 owner_thread_id_ = ::GetCurrentThreadId();
281void Mutex::Unlock() {
282 ThreadSafeLazyInit();
286 owner_thread_id_ = 0;
287 ::LeaveCriticalSection(critical_section_);
292void Mutex::AssertHeld() {
293 ThreadSafeLazyInit();
294 GTEST_CHECK_(owner_thread_id_ == ::GetCurrentThreadId())
295 <<
"The current thread is not holding the mutex @" <<
this;
299void Mutex::ThreadSafeLazyInit() {
301 if (type_ == kStatic) {
303 ::InterlockedCompareExchange(&critical_section_init_phase_, 1L, 0L)) {
307 owner_thread_id_ = 0;
308 critical_section_ =
new CRITICAL_SECTION;
309 ::InitializeCriticalSection(critical_section_);
313 &critical_section_init_phase_, 2L, 1L) ==
319 while (::InterlockedCompareExchange(&critical_section_init_phase_,
333 <<
"Unexpected value of critical_section_init_phase_ "
334 <<
"while initializing a static mutex.";
341class ThreadWithParamSupport :
public ThreadWithParamBase {
343 static HANDLE CreateThread(Runnable* runnable,
344 Notification* thread_can_start) {
345 ThreadMainParam* param =
new ThreadMainParam(runnable, thread_can_start);
348 HANDLE thread_handle = ::CreateThread(
351 &ThreadWithParamSupport::ThreadMain,
355 GTEST_CHECK_(thread_handle != NULL) <<
"CreateThread failed with error "
356 << ::GetLastError() <<
".";
357 if (thread_handle == NULL) {
360 return thread_handle;
364 struct ThreadMainParam {
365 ThreadMainParam(Runnable* runnable, Notification* thread_can_start)
366 : runnable_(runnable),
367 thread_can_start_(thread_can_start) {
369 scoped_ptr<Runnable> runnable_;
371 Notification* thread_can_start_;
374 static DWORD WINAPI ThreadMain(
void* ptr) {
376 scoped_ptr<ThreadMainParam> param(
static_cast<ThreadMainParam*
>(ptr));
377 if (param->thread_can_start_ != NULL)
378 param->thread_can_start_->WaitForNotification();
379 param->runnable_->Run();
384 ThreadWithParamSupport();
391ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
392 Notification* thread_can_start)
393 : thread_(ThreadWithParamSupport::CreateThread(runnable,
397ThreadWithParamBase::~ThreadWithParamBase() {
401void ThreadWithParamBase::Join() {
402 GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0)
403 <<
"Failed to join the thread with error " << ::GetLastError() <<
".";
410class ThreadLocalRegistryImpl {
414 static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
415 const ThreadLocalBase* thread_local_instance) {
416 DWORD current_thread = ::GetCurrentThreadId();
418 ThreadIdToThreadLocals*
const thread_to_thread_locals =
419 GetThreadLocalsMapLocked();
420 ThreadIdToThreadLocals::iterator thread_local_pos =
421 thread_to_thread_locals->find(current_thread);
422 if (thread_local_pos == thread_to_thread_locals->end()) {
423 thread_local_pos = thread_to_thread_locals->insert(
424 std::make_pair(current_thread, ThreadLocalValues())).first;
425 StartWatcherThreadFor(current_thread);
427 ThreadLocalValues& thread_local_values = thread_local_pos->second;
428 ThreadLocalValues::iterator value_pos =
429 thread_local_values.find(thread_local_instance);
430 if (value_pos == thread_local_values.end()) {
433 .insert(std::make_pair(
434 thread_local_instance,
435 linked_ptr<ThreadLocalValueHolderBase>(
436 thread_local_instance->NewValueForCurrentThread())))
439 return value_pos->second.get();
442 static void OnThreadLocalDestroyed(
443 const ThreadLocalBase* thread_local_instance) {
444 std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
449 ThreadIdToThreadLocals*
const thread_to_thread_locals =
450 GetThreadLocalsMapLocked();
451 for (ThreadIdToThreadLocals::iterator it =
452 thread_to_thread_locals->begin();
453 it != thread_to_thread_locals->end();
455 ThreadLocalValues& thread_local_values = it->second;
456 ThreadLocalValues::iterator value_pos =
457 thread_local_values.find(thread_local_instance);
458 if (value_pos != thread_local_values.end()) {
459 value_holders.push_back(value_pos->second);
460 thread_local_values.erase(value_pos);
470 static void OnThreadExit(DWORD thread_id) {
472 std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
477 ThreadIdToThreadLocals*
const thread_to_thread_locals =
478 GetThreadLocalsMapLocked();
479 ThreadIdToThreadLocals::iterator thread_local_pos =
480 thread_to_thread_locals->find(thread_id);
481 if (thread_local_pos != thread_to_thread_locals->end()) {
482 ThreadLocalValues& thread_local_values = thread_local_pos->second;
483 for (ThreadLocalValues::iterator value_pos =
484 thread_local_values.begin();
485 value_pos != thread_local_values.end();
487 value_holders.push_back(value_pos->second);
489 thread_to_thread_locals->erase(thread_local_pos);
498 typedef std::map<
const ThreadLocalBase*,
499 linked_ptr<ThreadLocalValueHolderBase> > ThreadLocalValues;
502 typedef std::map<DWORD, ThreadLocalValues> ThreadIdToThreadLocals;
506 typedef std::pair<DWORD, HANDLE> ThreadIdAndHandle;
508 static void StartWatcherThreadFor(DWORD thread_id) {
511 HANDLE thread = ::OpenThread(SYNCHRONIZE | THREAD_QUERY_INFORMATION,
517 DWORD watcher_thread_id;
518 HANDLE watcher_thread = ::CreateThread(
521 &ThreadLocalRegistryImpl::WatcherThreadFunc,
522 reinterpret_cast<LPVOID
>(
new ThreadIdAndHandle(thread_id, thread)),
528 ::SetThreadPriority(watcher_thread,
529 ::GetThreadPriority(::GetCurrentThread()));
530 ::ResumeThread(watcher_thread);
531 ::CloseHandle(watcher_thread);
536 static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
537 const ThreadIdAndHandle* tah =
538 reinterpret_cast<const ThreadIdAndHandle*
>(param);
540 ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
541 OnThreadExit(tah->first);
542 ::CloseHandle(tah->second);
548 static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() {
550 static ThreadIdToThreadLocals* map =
new ThreadIdToThreadLocals;
557 static Mutex thread_map_mutex_;
560Mutex ThreadLocalRegistryImpl::mutex_(Mutex::kStaticMutex);
561Mutex ThreadLocalRegistryImpl::thread_map_mutex_(Mutex::kStaticMutex);
563ThreadLocalValueHolderBase* ThreadLocalRegistry::GetValueOnCurrentThread(
564 const ThreadLocalBase* thread_local_instance) {
565 return ThreadLocalRegistryImpl::GetValueOnCurrentThread(
566 thread_local_instance);
569void ThreadLocalRegistry::OnThreadLocalDestroyed(
570 const ThreadLocalBase* thread_local_instance) {
571 ThreadLocalRegistryImpl::OnThreadLocalDestroyed(thread_local_instance);
576#if GTEST_USES_POSIX_RE
586 regfree(&partial_regex_);
587 regfree(&full_regex_);
589 free(
const_cast<char*
>(pattern_));
593bool RE::FullMatch(
const char* str,
const RE& re) {
594 if (!re.is_valid_)
return false;
597 return regexec(&re.full_regex_, str, 1, &match, 0) == 0;
602bool RE::PartialMatch(
const char* str,
const RE& re) {
603 if (!re.is_valid_)
return false;
606 return regexec(&re.partial_regex_, str, 1, &match, 0) == 0;
610void RE::Init(
const char* regex) {
615 const size_t full_regex_len = strlen(regex) + 10;
616 char*
const full_pattern =
new char[full_regex_len];
618 snprintf(full_pattern, full_regex_len,
"^(%s)$", regex);
619 is_valid_ = regcomp(&full_regex_, full_pattern, REG_EXTENDED) == 0;
629 const char*
const partial_regex = (*regex ==
'\0') ?
"()" : regex;
630 is_valid_ = regcomp(&partial_regex_, partial_regex, REG_EXTENDED) == 0;
633 <<
"Regular expression \"" << regex
634 <<
"\" is not a valid POSIX Extended regular expression.";
636 delete[] full_pattern;
639#elif GTEST_USES_SIMPLE_RE
643bool IsInSet(
char ch,
const char* str) {
644 return ch !=
'\0' && strchr(str, ch) != NULL;
650bool IsAsciiDigit(
char ch) {
return '0' <=
ch &&
ch <=
'9'; }
651bool IsAsciiPunct(
char ch) {
652 return IsInSet(ch,
"^-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~");
654bool IsRepeat(
char ch) {
return IsInSet(ch,
"?*+"); }
655bool IsAsciiWhiteSpace(
char ch) {
return IsInSet(ch,
" \f\n\r\t\v"); }
656bool IsAsciiWordChar(
char ch) {
657 return (
'a' <= ch && ch <=
'z') || (
'A' <=
ch &&
ch <=
'Z') ||
658 (
'0' <= ch && ch <=
'9') ||
ch ==
'_';
662bool IsValidEscape(
char c) {
663 return (IsAsciiPunct(c) || IsInSet(c,
"dDfnrsStvwW"));
668bool AtomMatchesChar(
bool escaped,
char pattern_char,
char ch) {
670 switch (pattern_char) {
671 case 'd':
return IsAsciiDigit(ch);
672 case 'D':
return !IsAsciiDigit(ch);
673 case 'f':
return ch ==
'\f';
674 case 'n':
return ch ==
'\n';
675 case 'r':
return ch ==
'\r';
676 case 's':
return IsAsciiWhiteSpace(ch);
677 case 'S':
return !IsAsciiWhiteSpace(ch);
678 case 't':
return ch ==
'\t';
679 case 'v':
return ch ==
'\v';
680 case 'w':
return IsAsciiWordChar(ch);
681 case 'W':
return !IsAsciiWordChar(ch);
683 return IsAsciiPunct(pattern_char) && pattern_char ==
ch;
686 return (pattern_char ==
'.' && ch !=
'\n') || pattern_char ==
ch;
690static std::string FormatRegexSyntaxError(
const char* regex,
int index) {
691 return (Message() <<
"Syntax error at index " << index
692 <<
" in simple regular expression \"" << regex <<
"\": ").GetString();
697bool ValidateRegex(
const char* regex) {
702 ADD_FAILURE() <<
"NULL is not a valid simple regular expression.";
709 bool prev_repeatable =
false;
710 for (
int i = 0; regex[i]; i++) {
711 if (regex[i] ==
'\\') {
713 if (regex[i] ==
'\0') {
714 ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
715 <<
"'\\' cannot appear at the end.";
719 if (!IsValidEscape(regex[i])) {
720 ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
721 <<
"invalid escape sequence \"\\" << regex[i] <<
"\".";
724 prev_repeatable =
true;
726 const char ch = regex[i];
728 if (ch ==
'^' && i > 0) {
730 <<
"'^' can only appear at the beginning.";
732 }
else if (ch ==
'$' && regex[i + 1] !=
'\0') {
734 <<
"'$' can only appear at the end.";
736 }
else if (IsInSet(ch,
"()[]{}|")) {
738 <<
"'" <<
ch <<
"' is unsupported.";
740 }
else if (IsRepeat(ch) && !prev_repeatable) {
742 <<
"'" <<
ch <<
"' can only follow a repeatable token.";
746 prev_repeatable = !IsInSet(ch,
"^$?*+");
760bool MatchRepetitionAndRegexAtHead(
761 bool escaped,
char c,
char repeat,
const char* regex,
763 const size_t min_count = (repeat ==
'+') ? 1 : 0;
764 const size_t max_count = (repeat ==
'?') ? 1 :
765 static_cast<size_t>(-1) - 1;
769 for (
size_t i = 0; i <= max_count; ++i) {
771 if (i >= min_count && MatchRegexAtHead(regex, str + i)) {
778 if (str[i] ==
'\0' || !AtomMatchesChar(escaped, c, str[i]))
787bool MatchRegexAtHead(
const char* regex,
const char* str) {
797 const bool escaped = *regex ==
'\\';
800 if (IsRepeat(regex[1])) {
804 return MatchRepetitionAndRegexAtHead(
805 escaped, regex[0], regex[1], regex + 2, str);
810 return (*str !=
'\0') && AtomMatchesChar(escaped, *regex, *str) &&
811 MatchRegexAtHead(regex + 1, str + 1);
823bool MatchRegexAnywhere(
const char* regex,
const char* str) {
824 if (regex == NULL || str == NULL)
828 return MatchRegexAtHead(regex + 1, str);
832 if (MatchRegexAtHead(regex, str))
834 }
while (*str++ !=
'\0');
841 free(
const_cast<char*
>(pattern_));
842 free(
const_cast<char*
>(full_pattern_));
846bool RE::FullMatch(
const char* str,
const RE& re) {
847 return re.is_valid_ && MatchRegexAnywhere(re.full_pattern_, str);
852bool RE::PartialMatch(
const char* str,
const RE& re) {
853 return re.is_valid_ && MatchRegexAnywhere(re.pattern_, str);
857void RE::Init(
const char* regex) {
858 pattern_ = full_pattern_ = NULL;
863 is_valid_ = ValidateRegex(regex);
869 const size_t len = strlen(regex);
873 char* buffer =
static_cast<char*
>(malloc(
len + 3));
874 full_pattern_ = buffer;
884 if (
len == 0 || regex[
len - 1] !=
'$')
896GTEST_API_ ::std::string FormatFileLocation(
const char* file,
int line) {
897 const std::string file_name(file == NULL ?
kUnknownFile : file);
900 return file_name +
":";
903 return file_name +
"(" + StreamableToString(line) +
"):";
905 return file_name +
":" + StreamableToString(line) +
":";
915 const char* file,
int line) {
916 const std::string file_name(file == NULL ?
kUnknownFile : file);
921 return file_name +
":" + StreamableToString(line);
925 : severity_(severity) {
926 const char*
const marker =
929 severity ==
GTEST_ERROR ?
"[ ERROR ]" :
"[ FATAL ]";
930 GetStream() << ::std::endl << marker <<
" "
947#if GTEST_HAS_STREAM_REDIRECTION
950class CapturedStream {
953 explicit CapturedStream(
int fd) : fd_(fd), uncaptured_fd_(dup(fd)) {
955 char temp_dir_path[MAX_PATH + 1] = {
'\0' };
956 char temp_file_path[MAX_PATH + 1] = {
'\0' };
958 ::GetTempPathA(
sizeof(temp_dir_path), temp_dir_path);
959 const UINT success = ::GetTempFileNameA(temp_dir_path,
964 <<
"Unable to create a temporary file in " << temp_dir_path;
965 const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE);
966 GTEST_CHECK_(captured_fd != -1) <<
"Unable to open temporary file "
968 filename_ = temp_file_path;
974# if GTEST_OS_LINUX_ANDROID
989 char name_template[] =
"/sdcard/gtest_captured_stream.XXXXXX";
991 char name_template[] =
"/tmp/captured_stream.XXXXXX";
993 const int captured_fd = mkstemp(name_template);
994 filename_ = name_template;
997 dup2(captured_fd, fd_);
1002 remove(filename_.c_str());
1005 std::string GetCapturedString() {
1006 if (uncaptured_fd_ != -1) {
1009 dup2(uncaptured_fd_, fd_);
1010 close(uncaptured_fd_);
1011 uncaptured_fd_ = -1;
1014 FILE*
const file =
posix::FOpen(filename_.c_str(),
"r");
1024 ::std::string filename_;
1031static CapturedStream* g_captured_stderr = NULL;
1032static CapturedStream* g_captured_stdout = NULL;
1035static
void CaptureStream(
int fd, const
char* stream_name,
1036 CapturedStream** stream) {
1037 if (*stream != NULL) {
1038 GTEST_LOG_(FATAL) <<
"Only one " << stream_name
1039 <<
" capturer can exist at a time.";
1041 *stream =
new CapturedStream(fd);
1045static std::string GetCapturedStream(CapturedStream** captured_stream) {
1046 const std::string content = (*captured_stream)->GetCapturedString();
1048 delete *captured_stream;
1049 *captured_stream = NULL;
1066 return GetCapturedStream(&g_captured_stdout);
1071 return GetCapturedStream(&g_captured_stderr);
1081 fseek(file, 0, SEEK_END);
1082 return static_cast<size_t>(ftell(file));
1087 char*
const buffer =
new char[file_size];
1089 size_t bytes_last_read = 0;
1090 size_t bytes_read = 0;
1092 fseek(file, 0, SEEK_SET);
1097 bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);
1098 bytes_read += bytes_last_read;
1099 }
while (bytes_last_read > 0 && bytes_read < file_size);
1101 const std::string content(buffer, bytes_read);
1107#if GTEST_HAS_DEATH_TEST
1108static const std::vector<std::string>* g_injected_test_argvs = NULL;
1110std::vector<std::string> GetInjectableArgvs() {
1111 if (g_injected_test_argvs != NULL) {
1112 return *g_injected_test_argvs;
1117void SetInjectableArgvs(
const std::vector<std::string>* new_argvs) {
1118 if (g_injected_test_argvs != new_argvs)
delete g_injected_test_argvs;
1119 g_injected_test_argvs = new_argvs;
1122void SetInjectableArgvs(
const std::vector<std::string>& new_argvs) {
1124 new std::vector<std::string>(new_argvs.begin(), new_argvs.end()));
1127#if GTEST_HAS_GLOBAL_STRING
1128void SetInjectableArgvs(
const std::vector< ::string>& new_argvs) {
1130 new std::vector<std::string>(new_argvs.begin(), new_argvs.end()));
1134void ClearInjectableArgvs() {
1135 delete g_injected_test_argvs;
1136 g_injected_test_argvs = NULL;
1140#if GTEST_OS_WINDOWS_MOBILE
1144 TerminateProcess(GetCurrentProcess(), 1);
1152static std::string FlagToEnvVar(
const char* flag) {
1153 const std::string full_flag =
1157 for (
size_t i = 0; i != full_flag.length(); i++) {
1158 env_var <<
ToUpper(full_flag.c_str()[i]);
1161 return env_var.GetString();
1170 const long long_value = strtol(str, &end, 10);
1176 msg <<
"WARNING: " << src_text
1177 <<
" is expected to be a 32-bit integer, but actually"
1178 <<
" has value \"" << str <<
"\".\n";
1185 const Int32 result =
static_cast<Int32>(long_value);
1186 if (long_value == LONG_MAX || long_value == LONG_MIN ||
1189 result != long_value
1193 msg <<
"WARNING: " << src_text
1194 <<
" is expected to be a 32-bit integer, but actually"
1195 <<
" has value " << str <<
", which overflows.\n";
1210#if defined(GTEST_GET_BOOL_FROM_ENV_)
1211 return GTEST_GET_BOOL_FROM_ENV_(flag, default_value);
1213 const std::string env_var = FlagToEnvVar(flag);
1214 const char*
const string_value =
posix::GetEnv(env_var.c_str());
1215 return string_value == NULL ?
1216 default_value : strcmp(string_value,
"0") != 0;
1224#if defined(GTEST_GET_INT32_FROM_ENV_)
1225 return GTEST_GET_INT32_FROM_ENV_(flag, default_value);
1227 const std::string env_var = FlagToEnvVar(flag);
1228 const char*
const string_value =
posix::GetEnv(env_var.c_str());
1229 if (string_value == NULL) {
1231 return default_value;
1234 Int32 result = default_value;
1236 string_value, &result)) {
1237 printf(
"The default value %s is used.\n",
1238 (
Message() << default_value).GetString().c_str());
1240 return default_value;
1256 std::string default_value_for_output_flag =
"";
1257 const char* xml_output_file_env =
posix::GetEnv(
"XML_OUTPUT_FILE");
1258 if (NULL != xml_output_file_env) {
1259 default_value_for_output_flag = std::string(
"xml:") + xml_output_file_env;
1261 return default_value_for_output_flag;
1267#if defined(GTEST_GET_STRING_FROM_ENV_)
1268 return GTEST_GET_STRING_FROM_ENV_(flag, default_value);
1270 const std::string env_var = FlagToEnvVar(flag);
1272 return value == NULL ? default_value :
value;
std::string GetString() const
::std::ostream & GetStream()
#define GTEST_FLAG_PREFIX_
#define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
#define GTEST_LOG_(severity)
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
#define GTEST_CHECK_(condition)
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
#define EXPECT_TRUE(condition)
void close(T *e, websocketpp::connection_hdl hdl)
@ Join
merge all the arguments together into a single string via the delimiter character default(' ')
static const Reg8 ch(Operand::CH)
bool remove(const path &p)
char * StrDup(const char *src)
const char * GetEnv(const char *name)
FILE * FOpen(const char *path, const char *mode)
GTEST_API_ size_t GetFileSize(FILE *file)
std::string OutputFlagAlsoCheckEnvVar()
GTEST_API_ Int32 Int32FromGTestEnv(const char *flag, Int32 default_val)
GTEST_API_::std::string FormatCompilerIndependentFileLocation(const char *file, int line)
GTEST_API_ std::string ReadEntireFile(FILE *file)
GTEST_API_::std::string FormatFileLocation(const char *file, int line)
GTEST_API_ std::string GetCapturedStderr()
GTEST_API_ size_t GetThreadCount()
bool BoolFromGTestEnv(const char *flag, bool default_val)
const char * StringFromGTestEnv(const char *flag, const char *default_val)
GTEST_API_ void CaptureStderr()
TypeWithSize< 4 >::Int Int32
GTEST_API_ std::vector< std::string > GetArgvs()
const char kUnknownFile[]
bool ParseInt32(const Message &src_text, const char *str, Int32 *value)
GTEST_API_ void CaptureStdout()
GTEST_API_ std::string GetCapturedStdout()
bool is_valid(octet_iterator start, octet_iterator end)
#define T(meth, val, expected)
memcpy((char *) pInfo->slotDescription, s, l)