Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
6de39826
Unverified
Commit
6de39826
authored
Aug 22, 2018
by
Jacob Schloss
Committed by
GitHub
Aug 22, 2018
Browse files
Merge branch 'master' into issue_1735
parents
6e798016
1d9a1912
Changes
182
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
111 additions
and
72 deletions
+111
-72
googletest/samples/sample5_unittest.cc
googletest/samples/sample5_unittest.cc
+1
-2
googletest/samples/sample6_unittest.cc
googletest/samples/sample6_unittest.cc
+1
-2
googletest/samples/sample7_unittest.cc
googletest/samples/sample7_unittest.cc
+1
-2
googletest/samples/sample8_unittest.cc
googletest/samples/sample8_unittest.cc
+1
-2
googletest/samples/sample9_unittest.cc
googletest/samples/sample9_unittest.cc
+1
-2
googletest/src/gtest-all.cc
googletest/src/gtest-all.cc
+1
-2
googletest/src/gtest-death-test.cc
googletest/src/gtest-death-test.cc
+3
-5
googletest/src/gtest-filepath.cc
googletest/src/gtest-filepath.cc
+2
-2
googletest/src/gtest-internal-inl.h
googletest/src/gtest-internal-inl.h
+7
-5
googletest/src/gtest-port.cc
googletest/src/gtest-port.cc
+50
-9
googletest/src/gtest-printers.cc
googletest/src/gtest-printers.cc
+2
-3
googletest/src/gtest-test-part.cc
googletest/src/gtest-test-part.cc
+1
-2
googletest/src/gtest-typed-test.cc
googletest/src/gtest-typed-test.cc
+1
-2
googletest/src/gtest.cc
googletest/src/gtest.cc
+37
-21
googletest/src/gtest_main.cc
googletest/src/gtest_main.cc
+0
-1
googletest/test/googletest-break-on-failure-unittest.py
googletest/test/googletest-break-on-failure-unittest.py
+0
-2
googletest/test/googletest-break-on-failure-unittest_.cc
googletest/test/googletest-break-on-failure-unittest_.cc
+1
-2
googletest/test/googletest-catch-exceptions-test.py
googletest/test/googletest-catch-exceptions-test.py
+0
-2
googletest/test/googletest-catch-exceptions-test_.cc
googletest/test/googletest-catch-exceptions-test_.cc
+1
-2
googletest/test/googletest-color-test.py
googletest/test/googletest-color-test.py
+0
-2
No files found.
googletest/samples/sample5_unittest.cc
View file @
6de39826
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// This sample teaches how to reuse a test fixture in multiple test
// cases by deriving sub-fixtures from it.
...
...
googletest/samples/sample6_unittest.cc
View file @
6de39826
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// This sample shows how to test common properties of multiple
// implementations of the same interface (aka interface tests).
...
...
googletest/samples/sample7_unittest.cc
View file @
6de39826
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: vladl@google.com (Vlad Losev)
// This sample shows how to test common properties of multiple
// implementations of an interface (aka interface tests) using
...
...
googletest/samples/sample8_unittest.cc
View file @
6de39826
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: vladl@google.com (Vlad Losev)
// This sample shows how to test code relying on some global flag variables.
// Combine() helps with generating all possible combinations of such flags,
...
...
googletest/samples/sample9_unittest.cc
View file @
6de39826
...
...
@@ -25,8 +25,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: vladl@google.com (Vlad Losev)
// This sample shows how to use Google Test listener API to implement
// an alternative console output and how to use the UnitTest reflection API
...
...
googletest/src/gtest-all.cc
View file @
6de39826
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: mheule@google.com (Markus Heule)
//
// Google C++ Testing and Mocking Framework (Google Test)
//
...
...
googletest/src/gtest-death-test.cc
View file @
6de39826
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
//
// This file implements death tests.
...
...
@@ -267,7 +266,7 @@ static const int kFuchsiaReadPipeFd = 3;
// statement, which is not allowed; THREW means that the test statement
// returned control by throwing an exception. IN_PROGRESS means the test
// has not yet concluded.
//
TODO(vladl@google.com)
: Unify names and possibly values for
//
FIXME
: Unify names and possibly values for
// AbortReason, DeathTestOutcome, and flag characters above.
enum
DeathTestOutcome
{
IN_PROGRESS
,
DIED
,
LIVED
,
RETURNED
,
THREW
};
...
...
@@ -582,7 +581,6 @@ bool DeathTestImpl::Passed(bool status_ok) {
if
(
status_ok
)
{
# if GTEST_USES_PCRE
// PCRE regexes support embedded NULs.
// GTEST_USES_PCRE is defined only in google3 mode
const
bool
matched
=
RE
::
PartialMatch
(
error_message
,
*
regex
());
# else
const
bool
matched
=
RE
::
PartialMatch
(
error_message
.
c_str
(),
*
regex
());
...
...
@@ -1460,7 +1458,7 @@ static int GetStatusFileDescriptor(unsigned int parent_process_id,
StreamableToString
(
parent_process_id
));
}
//
TODO(vladl@google.com)
: Replace the following check with a
//
FIXME
: Replace the following check with a
// compile-time assertion when available.
GTEST_CHECK_
(
sizeof
(
HANDLE
)
<=
sizeof
(
size_t
));
...
...
googletest/src/gtest-filepath.cc
View file @
6de39826
...
...
@@ -250,7 +250,7 @@ bool FilePath::DirectoryExists() const {
// root directory per disk drive.)
bool
FilePath
::
IsRootDirectory
()
const
{
#if GTEST_OS_WINDOWS
//
TODO(wan@google.com)
: on Windows a network share like
//
FIXME
: on Windows a network share like
// \\server\share can be a root directory, although it cannot be the
// current directory. Handle this properly.
return
pathname_
.
length
()
==
3
&&
IsAbsolutePath
();
...
...
@@ -350,7 +350,7 @@ FilePath FilePath::RemoveTrailingPathSeparator() const {
// Removes any redundant separators that might be in the pathname.
// For example, "bar///foo" becomes "bar/foo". Does not eliminate other
// redundancies that might be in a pathname involving "." or "..".
//
TODO(wan@google.com)
: handle Windows network shares (e.g. \\server\share).
//
FIXME
: handle Windows network shares (e.g. \\server\share).
void
FilePath
::
Normalize
()
{
if
(
pathname_
.
c_str
()
==
NULL
)
{
pathname_
=
""
;
...
...
googletest/src/gtest-internal-inl.h
View file @
6de39826
...
...
@@ -27,10 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Utility functions and classes used by the Google C++ testing framework.
//
// Author: wan@google.com (Zhanyong Wan)
//
// Utility functions and classes used by the Google C++ testing framework.//
// This file contains purely Google Test's internal implementation. Please
// DO NOT #INCLUDE IT IN A USER PROGRAM.
...
...
@@ -62,6 +59,9 @@
#include "gtest/gtest.h"
#include "gtest/gtest-spi.h"
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4251
\
/* class A needs to have dll-interface to be used by clients of class B */
)
namespace
testing
{
// Declares the flags.
...
...
@@ -994,7 +994,7 @@ bool ParseNaturalNumber(const ::std::string& str, Integer* number) {
const
bool
parse_success
=
*
end
==
'\0'
&&
errno
==
0
;
//
TODO(vladl@google.com)
: Convert this to compile time assertion when it is
//
FIXME
: Convert this to compile time assertion when it is
// available.
GTEST_CHECK_
(
sizeof
(
Integer
)
<=
sizeof
(
parsed
));
...
...
@@ -1182,4 +1182,6 @@ class StreamingListener : public EmptyTestEventListener {
}
// namespace internal
}
// namespace testing
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4251
#endif // GTEST_SRC_GTEST_INTERNAL_INL_H_
googletest/src/gtest-port.cc
View file @
6de39826
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#include "gtest/internal/gtest-port.h"
...
...
@@ -262,7 +261,7 @@ Mutex::Mutex()
Mutex
::~
Mutex
()
{
// Static mutexes are leaked intentionally. It is not thread-safe to try
// to clean them up.
//
TODO(yukawa)
: Switch to Slim Reader/Writer (SRW) Locks, which requires
//
FIXME
: Switch to Slim Reader/Writer (SRW) Locks, which requires
// nothing to clean it up but is available only on Vista and later.
// https://docs.microsoft.com/en-us/windows/desktop/Sync/slim-reader-writer--srw--locks
if
(
type_
==
kDynamic
)
{
...
...
@@ -295,6 +294,43 @@ void Mutex::AssertHeld() {
<<
"The current thread is not holding the mutex @"
<<
this
;
}
namespace
{
// Use the RAII idiom to flag mem allocs that are intentionally never
// deallocated. The motivation is to silence the false positive mem leaks
// that are reported by the debug version of MS's CRT which can only detect
// if an alloc is missing a matching deallocation.
// Example:
// MemoryIsNotDeallocated memory_is_not_deallocated;
// critical_section_ = new CRITICAL_SECTION;
//
class
MemoryIsNotDeallocated
{
public:
MemoryIsNotDeallocated
()
:
old_crtdbg_flag_
(
0
)
{
#ifdef _MSC_VER
old_crtdbg_flag_
=
_CrtSetDbgFlag
(
_CRTDBG_REPORT_FLAG
);
// Set heap allocation block type to _IGNORE_BLOCK so that MS debug CRT
// doesn't report mem leak if there's no matching deallocation.
_CrtSetDbgFlag
(
old_crtdbg_flag_
&
~
_CRTDBG_ALLOC_MEM_DF
);
#endif // _MSC_VER
}
~
MemoryIsNotDeallocated
()
{
#ifdef _MSC_VER
// Restore the original _CRTDBG_ALLOC_MEM_DF flag
_CrtSetDbgFlag
(
old_crtdbg_flag_
);
#endif // _MSC_VER
}
private:
int
old_crtdbg_flag_
;
GTEST_DISALLOW_COPY_AND_ASSIGN_
(
MemoryIsNotDeallocated
);
};
}
// namespace
// Initializes owner_thread_id_ and critical_section_ in static mutexes.
void
Mutex
::
ThreadSafeLazyInit
()
{
// Dynamic mutexes are initialized in the constructor.
...
...
@@ -305,7 +341,11 @@ void Mutex::ThreadSafeLazyInit() {
// If critical_section_init_phase_ was 0 before the exchange, we
// are the first to test it and need to perform the initialization.
owner_thread_id_
=
0
;
critical_section_
=
new
CRITICAL_SECTION
;
{
// Use RAII to flag that following mem alloc is never deallocated.
MemoryIsNotDeallocated
memory_is_not_deallocated
;
critical_section_
=
new
CRITICAL_SECTION
;
}
::
InitializeCriticalSection
(
critical_section_
);
// Updates the critical_section_init_phase_ to 2 to signal
// initialization complete.
...
...
@@ -344,7 +384,7 @@ class ThreadWithParamSupport : public ThreadWithParamBase {
Notification
*
thread_can_start
)
{
ThreadMainParam
*
param
=
new
ThreadMainParam
(
runnable
,
thread_can_start
);
DWORD
thread_id
;
//
TODO(yukawa)
: Consider to use _beginthreadex instead.
//
FIXME
: Consider to use _beginthreadex instead.
HANDLE
thread_handle
=
::
CreateThread
(
NULL
,
// Default security.
0
,
// Default stack size.
...
...
@@ -547,7 +587,8 @@ class ThreadLocalRegistryImpl {
// Returns map of thread local instances.
static
ThreadIdToThreadLocals
*
GetThreadLocalsMapLocked
()
{
mutex_
.
AssertHeld
();
static
ThreadIdToThreadLocals
*
map
=
new
ThreadIdToThreadLocals
;
MemoryIsNotDeallocated
memory_is_not_deallocated
;
static
ThreadIdToThreadLocals
*
map
=
new
ThreadIdToThreadLocals
();
return
map
;
}
...
...
@@ -696,7 +737,7 @@ static std::string FormatRegexSyntaxError(const char* regex, int index) {
// otherwise returns true.
bool
ValidateRegex
(
const
char
*
regex
)
{
if
(
regex
==
NULL
)
{
//
TODO(wan@google.com)
: fix the source file location in the
//
FIXME
: fix the source file location in the
// assertion failures to match where the regex is used in user
// code.
ADD_FAILURE
()
<<
"NULL is not a valid simple regular expression."
;
...
...
@@ -942,7 +983,7 @@ GTestLog::~GTestLog() {
// Disable Microsoft deprecation warnings for POSIX functions called from
// this class (creat, dup, dup2, and close)
GTEST_DISABLE_MSC_
WARNINGS
_PUSH_
(
4996
)
GTEST_DISABLE_MSC_
DEPRECATED
_PUSH_
()
#if GTEST_HAS_STREAM_REDIRECTION
...
...
@@ -1026,7 +1067,7 @@ class CapturedStream {
GTEST_DISALLOW_COPY_AND_ASSIGN_
(
CapturedStream
);
};
GTEST_DISABLE_MSC_
WARNINGS
_POP_
()
GTEST_DISABLE_MSC_
DEPRECATED
_POP_
()
static
CapturedStream
*
g_captured_stderr
=
NULL
;
static
CapturedStream
*
g_captured_stdout
=
NULL
;
...
...
googletest/src/gtest-printers.cc
View file @
6de39826
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Test - The Google C++ Testing and Mocking Framework
//
...
...
@@ -90,7 +89,7 @@ void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count,
// If the object size is bigger than kThreshold, we'll have to omit
// some details by printing only the first and the last kChunkSize
// bytes.
//
TODO(wan)
: let the user control the threshold using a flag.
//
FIXME
: let the user control the threshold using a flag.
if
(
count
<
kThreshold
)
{
PrintByteSegmentInObjectTo
(
obj_bytes
,
0
,
count
,
os
);
}
else
{
...
...
googletest/src/gtest-test-part.cc
View file @
6de39826
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: mheule@google.com (Markus Heule)
//
// The Google C++ Testing and Mocking Framework (Google Test)
...
...
googletest/src/gtest-typed-test.cc
View file @
6de39826
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#include "gtest/gtest-typed-test.h"
...
...
googletest/src/gtest.cc
View file @
6de39826
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
//
// The Google C++ Testing and Mocking Framework (Google Test)
...
...
@@ -55,7 +54,7 @@
#if GTEST_OS_LINUX
//
TODO(kenton@google.com)
: Use autoconf to detect availability of
//
FIXME
: Use autoconf to detect availability of
// gettimeofday().
# define GTEST_HAS_GETTIMEOFDAY_ 1
...
...
@@ -94,9 +93,9 @@
# if GTEST_OS_WINDOWS_MINGW
// MinGW has gettimeofday() but not _ftime64().
//
TODO(kenton@google.com)
: Use autoconf to detect availability of
//
FIXME
: Use autoconf to detect availability of
// gettimeofday().
//
TODO(kenton@google.com)
: There are other ways to get the time on
//
FIXME
: There are other ways to get the time on
// Windows, like GetTickCount() or GetSystemTimeAsFileTime(). MinGW
// supports these. consider using them instead.
# define GTEST_HAS_GETTIMEOFDAY_ 1
...
...
@@ -111,7 +110,7 @@
#else
// Assume other platforms have gettimeofday().
//
TODO(kenton@google.com)
: Use autoconf to detect availability of
//
FIXME
: Use autoconf to detect availability of
// gettimeofday().
# define GTEST_HAS_GETTIMEOFDAY_ 1
...
...
@@ -139,6 +138,12 @@
# define vsnprintf _vsnprintf
#endif // GTEST_OS_WINDOWS
#if GTEST_OS_MAC
#ifndef GTEST_OS_IOS
#include <crt_externs.h>
#endif
#endif
#if GTEST_HAS_ABSL
#include "absl/debugging/failure_signal_handler.h"
#include "absl/debugging/stacktrace.h"
...
...
@@ -468,7 +473,7 @@ std::string UnitTestOptions::GetAbsolutePathToOutputFile() {
internal
::
FilePath
output_name
(
colon
+
1
);
if
(
!
output_name
.
IsAbsolutePath
())
//
TODO(wan@google.com)
: on Windows \some\path is not an absolute
//
FIXME
: on Windows \some\path is not an absolute
// path (as its meaning depends on the current drive), yet the
// following logic for turning it into an absolute path is wrong.
// Fix it.
...
...
@@ -842,7 +847,7 @@ TimeInMillis GetTimeInMillis() {
SYSTEMTIME
now_systime
;
FILETIME
now_filetime
;
ULARGE_INTEGER
now_int64
;
//
TODO(kenton@google.com)
: Shouldn't this just use
//
FIXME
: Shouldn't this just use
// GetSystemTimeAsFileTime()?
GetSystemTime
(
&
now_systime
);
if
(
SystemTimeToFileTime
(
&
now_systime
,
&
now_filetime
))
{
...
...
@@ -858,11 +863,11 @@ TimeInMillis GetTimeInMillis() {
// MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996
// (deprecated function) there.
//
TODO(kenton@google.com)
: Use GetTickCount()? Or use
//
FIXME
: Use GetTickCount()? Or use
// SystemTimeToFileTime()
GTEST_DISABLE_MSC_
WARNINGS
_PUSH_
(
4996
)
GTEST_DISABLE_MSC_
DEPRECATED
_PUSH_
()
_ftime64
(
&
now
);
GTEST_DISABLE_MSC_
WARNINGS
_POP_
()
GTEST_DISABLE_MSC_
DEPRECATED
_POP_
()
return
static_cast
<
TimeInMillis
>
(
now
.
time
)
*
1000
+
now
.
millitm
;
#elif GTEST_HAS_GETTIMEOFDAY_
...
...
@@ -1397,7 +1402,7 @@ AssertionResult DoubleNearPredFormat(const char* expr1,
const
double
diff
=
fabs
(
val1
-
val2
);
if
(
diff
<=
abs_error
)
return
AssertionSuccess
();
//
TODO(wan)
: do not print the value of an expression if it's
//
FIXME
: do not print the value of an expression if it's
// already a literal.
return
AssertionFailure
()
<<
"The difference between "
<<
expr1
<<
" and "
<<
expr2
...
...
@@ -3335,7 +3340,7 @@ void TestEventRepeater::Append(TestEventListener *listener) {
listeners_
.
push_back
(
listener
);
}
//
TODO(vladl@google.com)
: Factor the search functionality into Vector::Find.
//
FIXME
: Factor the search functionality into Vector::Find.
TestEventListener
*
TestEventRepeater
::
Release
(
TestEventListener
*
listener
)
{
for
(
size_t
i
=
0
;
i
<
listeners_
.
size
();
++
i
)
{
if
(
listeners_
[
i
]
==
listener
)
{
...
...
@@ -3500,7 +3505,7 @@ void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
xmlout
=
posix
::
FOpen
(
output_file_
.
c_str
(),
"w"
);
}
if
(
xmlout
==
NULL
)
{
//
TODO(wan)
: report the reason of the failure.
//
FIXME
: report the reason of the failure.
//
// We don't do it for now as:
//
...
...
@@ -3529,7 +3534,7 @@ void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
// module will consist of ordinary English text.
// If this module is ever modified to produce version 1.1 XML output,
// most invalid characters can be retained using character references.
//
TODO(wan)
: It might be nice to have a minimally invasive, human-readable
//
FIXME
: It might be nice to have a minimally invasive, human-readable
// escaping scheme for invalid characters, rather than dropping them.
std
::
string
XmlUnitTestResultPrinter
::
EscapeXml
(
const
std
::
string
&
str
,
bool
is_attribute
)
{
...
...
@@ -3680,7 +3685,7 @@ void XmlUnitTestResultPrinter::OutputXmlAttribute(
}
// Prints an XML representation of a TestInfo object.
//
TODO(wan)
: There is also value in printing properties with the plain printer.
//
FIXME
: There is also value in printing properties with the plain printer.
void
XmlUnitTestResultPrinter
::
OutputXmlTestInfo
(
::
std
::
ostream
*
stream
,
const
char
*
test_case_name
,
const
TestInfo
&
test_info
)
{
...
...
@@ -3907,7 +3912,7 @@ void JsonUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
jsonout
=
posix
::
FOpen
(
output_file_
.
c_str
(),
"w"
);
}
if
(
jsonout
==
NULL
)
{
//
TODO(phosek)
: report the reason of the failure.
//
FIXME
: report the reason of the failure.
//
// We don't do it for now as:
//
...
...
@@ -4693,7 +4698,7 @@ int UnitTest::Run() {
// used for the duration of the program.
impl
()
->
set_catch_exceptions
(
GTEST_FLAG
(
catch_exceptions
));
#if GTEST_
HAS_SEH
#if GTEST_
OS_WINDOWS
// Either the user wants Google Test to catch exceptions thrown by the
// tests or this is executing in the context of death test child
// process. In either case the user does not want to see pop-up dialogs
...
...
@@ -4722,7 +4727,7 @@ int UnitTest::Run() {
// VC++ doesn't define _set_abort_behavior() prior to the version 8.0.
// Users of prior VC versions shall suffer the agony and pain of
// clicking through the countless debug dialogs.
//
TODO(vladl@google.com)
: find a way to suppress the abort dialog() in the
//
FIXME
: find a way to suppress the abort dialog() in the
// debug mode when compiled with VC 7.1 or lower.
if
(
!
GTEST_FLAG
(
break_on_failure
))
_set_abort_behavior
(
...
...
@@ -4730,7 +4735,7 @@ int UnitTest::Run() {
_WRITE_ABORT_MSG
|
_CALL_REPORTFAULT
);
// pop-up window, core dump.
# endif
}
#endif // GTEST_
HAS_SEH
#endif // GTEST_
OS_WINDOWS
return
internal
::
HandleExceptionsInMethodIfSupported
(
impl
(),
...
...
@@ -5616,7 +5621,7 @@ static bool HasGoogleTestFlagPrefix(const char* str) {
// @Y changes the color to yellow.
// @D changes to the default terminal text color.
//
//
TODO(wan@google.com)
: Write tests for this once we add stdout
//
FIXME
: Write tests for this once we add stdout
// capturing to Google Test.
static
void
PrintColorEncoded
(
const
char
*
str
)
{
GTestColor
color
=
COLOR_DEFAULT
;
// The current color.
...
...
@@ -5826,6 +5831,17 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
// other parts of Google Test.
void
ParseGoogleTestFlagsOnly
(
int
*
argc
,
char
**
argv
)
{
ParseGoogleTestFlagsOnlyImpl
(
argc
,
argv
);
// Fix the value of *_NSGetArgc() on macOS, but iff
// *_NSGetArgv() == argv
// Only applicable to char** version of argv
#if GTEST_OS_MAC
#ifndef GTEST_OS_IOS
if
(
*
_NSGetArgv
()
==
argv
)
{
*
_NSGetArgc
()
=
*
argc
;
}
#endif
#endif
}
void
ParseGoogleTestFlagsOnly
(
int
*
argc
,
wchar_t
**
argv
)
{
ParseGoogleTestFlagsOnlyImpl
(
argc
,
argv
);
...
...
googletest/src/gtest_main.cc
View file @
6de39826
...
...
@@ -26,7 +26,6 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#include <stdio.h>
#include "gtest/gtest.h"
...
...
googletest/test/googletest-break-on-failure-unittest.py
View file @
6de39826
...
...
@@ -38,8 +38,6 @@ by invoking googletest-break-on-failure-unittest_ (a program written with
Google Test) with different environments and command line flags.
"""
__author__
=
'wan@google.com (Zhanyong Wan)'
import
os
import
gtest_test_utils
...
...
googletest/test/googletest-break-on-failure-unittest_.cc
View file @
6de39826
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Unit test for Google Test's break-on-failure mode.
//
...
...
googletest/test/googletest-catch-exceptions-test.py
View file @
6de39826
...
...
@@ -35,8 +35,6 @@ googletest-catch-exceptions-ex-test_ (programs written with
Google Test) and verifies their output.
"""
__author__
=
'vladl@google.com (Vlad Losev)'
import
gtest_test_utils
# Constants.
...
...
googletest/test/googletest-catch-exceptions-test_.cc
View file @
6de39826
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: vladl@google.com (Vlad Losev)
//
// Tests for Google Test itself. Tests in this file throw C++ or SEH
// exceptions, and the output is verified by
...
...
googletest/test/googletest-color-test.py
View file @
6de39826
...
...
@@ -31,8 +31,6 @@
"""Verifies that Google Test correctly determines whether to use colors."""
__author__
=
'wan@google.com (Zhanyong Wan)'
import
os
import
gtest_test_utils
...
...
Prev
1
2
3
4
5
6
7
8
9
10
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment