From c12f63214e9b7761d27e68353e4aaf1761c9cf88 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Tue, 7 Apr 2009 21:03:22 +0000 Subject: Adds sample4_unittest to scons (by Vlad Losev); adds logic for getting the thread count on Mac (by Vlad Losev); adds HasFailure() and HasNonfatalFailure() (by Zhanyong Wan). --- include/gtest/gtest.h | 7 +++++++ include/gtest/internal/gtest-port.h | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/gtest/gtest.h b/include/gtest/gtest.h index 6d87e035..26d76b26 100644 --- a/include/gtest/gtest.h +++ b/include/gtest/gtest.h @@ -272,6 +272,13 @@ class Test { // Returns true iff the current test has a fatal failure. static bool HasFatalFailure(); + // Returns true iff the current test has a non-fatal failure. + static bool HasNonfatalFailure(); + + // Returns true iff the current test has a (either fatal or + // non-fatal) failure. + static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); } + // Logs a property for the current test. Only the last value for a given // key is remembered. // These are public static so they can be called from utility functions diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h index 97736314..4267a58f 100644 --- a/include/gtest/internal/gtest-port.h +++ b/include/gtest/internal/gtest-port.h @@ -673,9 +673,9 @@ class ThreadLocal { T value_; }; -// There's no portable way to detect the number of threads, so we just -// return 0 to indicate that we cannot detect it. -inline size_t GetThreadCount() { return 0; } +// Returns the number of threads running in the process, or 0 to indicate that +// we cannot detect it. +size_t GetThreadCount(); // The above synchronization primitives have dummy implementations. // Therefore Google Test is not thread-safe. -- cgit v1.2.3