Merge branch 'master' into deprecate

This commit is contained in:
Gennadiy Civil 2018-07-26 13:04:53 -04:00 committed by GitHub
commit 6cacb41935
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 24 deletions

View File

@ -357,7 +357,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
// // error when trying to resolve between this and overload 4 in // // error when trying to resolve between this and overload 4 in
// // 'gmock_GetName(WithoutMatchers(), nullptr)'. // // 'gmock_GetName(WithoutMatchers(), nullptr)'.
// MockSpec<string&()> gmock_GetName( // MockSpec<string&()> gmock_GetName(
// const WithoutMatchers&, const Function<string&()>*) const { // const WithoutMatchers&, const Function<string&()>*) const {
// // Removes const from this, calls overload 1 // // Removes const from this, calls overload 1
// return AdjustConstness_(this)->gmock_GetName(); // return AdjustConstness_(this)->gmock_GetName();
// } // }
@ -366,7 +366,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
// const string& gmock_GetName() const { ... } // const string& gmock_GetName() const { ... }
// // Overload 4 // // Overload 4
// MockSpec<const string&()> gmock_GetName( // MockSpec<const string&()> gmock_GetName(
// const WithoutMatchers&, const Function<const string&()>*) const { // const WithoutMatchers&, const Function<const string&()>*) const {
// // Does not remove const, calls overload 3 // // Does not remove const, calls overload 3
// return AdjustConstness_const(this)->gmock_GetName(); // return AdjustConstness_const(this)->gmock_GetName();
// } // }

View File

@ -119,7 +119,7 @@ class FunctionMocker<R($As)> : public
// // error when trying to resolve between this and overload 4 in // // error when trying to resolve between this and overload 4 in
// // 'gmock_GetName(WithoutMatchers(), nullptr)'. // // 'gmock_GetName(WithoutMatchers(), nullptr)'.
// MockSpec<string&()> gmock_GetName( // MockSpec<string&()> gmock_GetName(
// const WithoutMatchers&, const Function<string&()>*) const { // const WithoutMatchers&, const Function<string&()>*) const {
// // Removes const from this, calls overload 1 // // Removes const from this, calls overload 1
// return AdjustConstness_(this)->gmock_GetName(); // return AdjustConstness_(this)->gmock_GetName();
// } // }
@ -128,7 +128,7 @@ class FunctionMocker<R($As)> : public
// const string& gmock_GetName() const { ... } // const string& gmock_GetName() const { ... }
// // Overload 4 // // Overload 4
// MockSpec<const string&()> gmock_GetName( // MockSpec<const string&()> gmock_GetName(
// const WithoutMatchers&, const Function<const string&()>*) const { // const WithoutMatchers&, const Function<const string&()>*) const {
// // Does not remove const, calls overload 3 // // Does not remove const, calls overload 3
// return AdjustConstness_const(this)->gmock_GetName(); // return AdjustConstness_const(this)->gmock_GetName();
// } // }

View File

@ -33,13 +33,12 @@
// threads concurrently. // threads concurrently.
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
namespace testing { namespace testing {
namespace { namespace {
// From "gtest/internal/gtest-port.h". // From gtest-port.h.
using ::testing::internal::ThreadWithParam; using ::testing::internal::ThreadWithParam;
// The maximum number of test threads (not including helper threads) // The maximum number of test threads (not including helper threads)

View File

@ -203,7 +203,7 @@ for more details.
If you're working with floating point numbers, you may want to use the floating If you're working with floating point numbers, you may want to use the floating
point variations of some of these macros in order to avoid problems caused by point variations of some of these macros in order to avoid problems caused by
rounding. See [Advanced googletest Topics](advanced) for details. rounding. See [Advanced googletest Topics](advanced.md) for details.
Macros in this section work with both narrow and wide string objects (`string` Macros in this section work with both narrow and wide string objects (`string`
and `wstring`). and `wstring`).
@ -220,17 +220,11 @@ The assertions in this group compare two **C strings**. If you want to compare
two `string` objects, use `EXPECT_EQ`, `EXPECT_NE`, and etc instead. two `string` objects, use `EXPECT_EQ`, `EXPECT_NE`, and etc instead.
| Fatal assertion | Nonfatal assertion | Verifies | | Fatal assertion | Nonfatal assertion | Verifies |
| ----------------------- | ----------------------- | ---------------------- | | ------------------------------- | ------------------------------- | -------------------------------------------------------- |
| `ASSERT_STREQ(str1, | `EXPECT_STREQ(str1, | the two C strings have | | `ASSERT_STREQ(str1, str2);` | `EXPECT_STREQ(str1, str2);` | the two C strings have the same content |
: str2);` : str2);` : the same content : | `ASSERT_STRNE(str1, str2);` | `EXPECT_STRNE(str1, str2);` | the two C strings have different contents |
| `ASSERT_STRNE(str1, | `EXPECT_STRNE(str1, | the two C strings have | | `ASSERT_STRCASEEQ(str1, str2);` | `EXPECT_STRCASEEQ(str1, str2);` | the two C strings have the same content, ignoring case |
: str2);` : str2);` : different contents : | `ASSERT_STRCASENE(str1, str2);` | `EXPECT_STRCASENE(str1, str2);` | the two C strings have different contents, ignoring case |
| `ASSERT_STRCASEEQ(str1, | `EXPECT_STRCASEEQ(str1, | the two C strings have |
: str2);` : str2);` : the same content, :
: : : ignoring case :
| `ASSERT_STRCASENE(str1, | `EXPECT_STRCASENE(str1, | the two C strings have |
: str2);` : str2);` : different contents, :
: : : ignoring case :
Note that "CASE" in an assertion name means that case is ignored. A `NULL` Note that "CASE" in an assertion name means that case is ignored. A `NULL`
pointer and an empty string are considered *different*. pointer and an empty string are considered *different*.

View File

@ -34,8 +34,7 @@
// Google Test. They are subject to change without notice. They should not used // Google Test. They are subject to change without notice. They should not used
// by code external to Google Test. // by code external to Google Test.
// //
// This header file is #included by // This header file is #included by gtest-internal.h.
// gtest/internal/gtest-internal.h.
// It should not be #included by other files. // It should not be #included by other files.
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_

View File

@ -29,7 +29,7 @@
// //
// Author: wan@google.com (Zhanyong Wan) // Author: wan@google.com (Zhanyong Wan)
// //
// Unit test for gtest/gtest_prod.h. // Unit test for gtest_prod.h.
#include "production.h" #include "production.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"

View File

@ -35,8 +35,8 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
// Verifies that the command line flag variables can be accessed in // Verifies that the command line flag variables can be accessed in
// code once "gtest/gtest.h" has been // code once "gtest.h" has been #included.
// #included. Do not move it after other gtest #includes. // Do not move it after other gtest #includes.
TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) { TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
bool dummy = testing::GTEST_FLAG(also_run_disabled_tests) bool dummy = testing::GTEST_FLAG(also_run_disabled_tests)
|| testing::GTEST_FLAG(break_on_failure) || testing::GTEST_FLAG(break_on_failure)