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
6c8c74ec
"googlemock/git@developer.sourcefind.cn:yangql/googletest.git" did not exist on "d89b36302116233b8c6377e6e891083f41ee51c5"
Commit
6c8c74ec
authored
Aug 20, 2018
by
Gennadiy Civil
Browse files
merge
parents
cfc0d5fb
df428ec1
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
70 additions
and
19 deletions
+70
-19
googlemock/include/gmock/gmock-cardinalities.h
googlemock/include/gmock/gmock-cardinalities.h
+5
-0
googlemock/include/gmock/gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+5
-0
googlemock/include/gmock/gmock-spec-builders.h
googlemock/include/gmock/gmock-spec-builders.h
+7
-8
googletest/include/gtest/gtest-message.h
googletest/include/gtest/gtest-message.h
+5
-0
googletest/include/gtest/gtest-spi.h
googletest/include/gtest/gtest-spi.h
+5
-0
googletest/include/gtest/gtest-test-part.h
googletest/include/gtest/gtest-test-part.h
+6
-1
googletest/include/gtest/gtest.h
googletest/include/gtest/gtest.h
+5
-0
googletest/include/gtest/internal/gtest-death-test-internal.h
...letest/include/gtest/internal/gtest-death-test-internal.h
+5
-0
googletest/include/gtest/internal/gtest-filepath.h
googletest/include/gtest/internal/gtest-filepath.h
+5
-0
googletest/include/gtest/internal/gtest-internal.h
googletest/include/gtest/internal/gtest-internal.h
+10
-0
googletest/samples/sample4.cc
googletest/samples/sample4.cc
+6
-6
googletest/samples/sample4.h
googletest/samples/sample4.h
+1
-2
googletest/samples/sample4_unittest.cc
googletest/samples/sample4_unittest.cc
+0
-2
googletest/src/gtest-internal-inl.h
googletest/src/gtest-internal-inl.h
+5
-0
No files found.
googlemock/include/gmock/gmock-cardinalities.h
View file @
6c8c74ec
...
@@ -44,6 +44,9 @@
...
@@ -44,6 +44,9 @@
#include "gmock/internal/gmock-port.h"
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4251
\
/* class A needs to have dll-interface to be used by clients of class B */
)
namespace
testing
{
namespace
testing
{
// To implement a cardinality Foo, define:
// To implement a cardinality Foo, define:
...
@@ -145,4 +148,6 @@ inline Cardinality MakeCardinality(const CardinalityInterface* c) {
...
@@ -145,4 +148,6 @@ inline Cardinality MakeCardinality(const CardinalityInterface* c) {
}
// namespace testing
}
// namespace testing
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4251
#endif // GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
#endif // GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
googlemock/include/gmock/gmock-matchers.h
View file @
6c8c74ec
...
@@ -56,6 +56,9 @@
...
@@ -56,6 +56,9 @@
# include <initializer_list> // NOLINT -- must be after gtest.h
# include <initializer_list> // NOLINT -- must be after gtest.h
#endif
#endif
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4251
\
/* class A needs to have dll-interface to be used by clients of class B */
)
namespace
testing
{
namespace
testing
{
// To implement a matcher Foo for type T, define:
// To implement a matcher Foo for type T, define:
...
@@ -5266,6 +5269,8 @@ PolymorphicMatcher<internal::variant_matcher::VariantMatcher<T> > VariantWith(
...
@@ -5266,6 +5269,8 @@ PolymorphicMatcher<internal::variant_matcher::VariantMatcher<T> > VariantWith(
}
// namespace testing
}
// namespace testing
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4251
// Include any custom callback matchers added by the local installation.
// Include any custom callback matchers added by the local installation.
// We must include this header at the end to make sure it can use the
// We must include this header at the end to make sure it can use the
// declarations from this file.
// declarations from this file.
...
...
googlemock/include/gmock/gmock-spec-builders.h
View file @
6c8c74ec
...
@@ -77,6 +77,9 @@
...
@@ -77,6 +77,9 @@
# include <stdexcept> // NOLINT
# include <stdexcept> // NOLINT
#endif
#endif
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4251
\
/* class A needs to have dll-interface to be used by clients of class B */
)
namespace
testing
{
namespace
testing
{
// An abstract handle of an expectation.
// An abstract handle of an expectation.
...
@@ -1357,11 +1360,7 @@ class ReferenceOrValueWrapper<T&> {
...
@@ -1357,11 +1360,7 @@ class ReferenceOrValueWrapper<T&> {
// we need to temporarily disable the warning. We have to do it for
// we need to temporarily disable the warning. We have to do it for
// the entire class to suppress the warning, even though it's about
// the entire class to suppress the warning, even though it's about
// the constructor only.
// the constructor only.
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4355
)
#ifdef _MSC_VER
# pragma warning(push) // Saves the current warning state.
# pragma warning(disable:4355) // Temporarily disables warning 4355.
#endif // _MSV_VER
// C++ treats the void type specially. For example, you cannot define
// C++ treats the void type specially. For example, you cannot define
// a void-typed variable or pass a void value to a function.
// a void-typed variable or pass a void value to a function.
...
@@ -1797,9 +1796,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
...
@@ -1797,9 +1796,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
GTEST_DISALLOW_COPY_AND_ASSIGN_
(
FunctionMockerBase
);
GTEST_DISALLOW_COPY_AND_ASSIGN_
(
FunctionMockerBase
);
};
// class FunctionMockerBase
};
// class FunctionMockerBase
#ifdef _MSC_VER
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4355
# pragma warning(pop) // Restores the warning state.
#endif // _MSV_VER
// Implements methods of FunctionMockerBase.
// Implements methods of FunctionMockerBase.
...
@@ -1844,6 +1841,8 @@ inline Expectation::Expectation(internal::ExpectationBase& exp) // NOLINT
...
@@ -1844,6 +1841,8 @@ inline Expectation::Expectation(internal::ExpectationBase& exp) // NOLINT
}
// namespace testing
}
// namespace testing
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4251
// Implementation for ON_CALL and EXPECT_CALL macros. A separate macro is
// Implementation for ON_CALL and EXPECT_CALL macros. A separate macro is
// required to avoid compile errors when the name of the method used in call is
// required to avoid compile errors when the name of the method used in call is
// a result of macro expansion. See CompilesWithMethodNameExpandedFromMacro
// a result of macro expansion. See CompilesWithMethodNameExpandedFromMacro
...
...
googletest/include/gtest/gtest-message.h
View file @
6c8c74ec
...
@@ -51,6 +51,9 @@
...
@@ -51,6 +51,9 @@
#include "gtest/internal/gtest-port.h"
#include "gtest/internal/gtest-port.h"
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4251
\
/* class A needs to have dll-interface to be used by clients of class B */
)
// Ensures that there is at least one operator<< in the global namespace.
// Ensures that there is at least one operator<< in the global namespace.
// See Message& operator<<(...) below for why.
// See Message& operator<<(...) below for why.
void
operator
<<
(
const
testing
::
internal
::
Secret
&
,
int
);
void
operator
<<
(
const
testing
::
internal
::
Secret
&
,
int
);
...
@@ -247,4 +250,6 @@ std::string StreamableToString(const T& streamable) {
...
@@ -247,4 +250,6 @@ std::string StreamableToString(const T& streamable) {
}
// namespace internal
}
// namespace internal
}
// namespace testing
}
// namespace testing
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4251
#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
googletest/include/gtest/gtest-spi.h
View file @
6c8c74ec
...
@@ -38,6 +38,9 @@
...
@@ -38,6 +38,9 @@
#include "gtest/gtest.h"
#include "gtest/gtest.h"
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4251
\
/* class A needs to have dll-interface to be used by clients of class B */
)
namespace
testing
{
namespace
testing
{
// This helper class can be used to mock out Google Test failure reporting
// This helper class can be used to mock out Google Test failure reporting
...
@@ -112,6 +115,8 @@ class GTEST_API_ SingleFailureChecker {
...
@@ -112,6 +115,8 @@ class GTEST_API_ SingleFailureChecker {
}
// namespace testing
}
// namespace testing
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4251
// A set of macros for testing Google Test assertions or code that's expected
// A set of macros for testing Google Test assertions or code that's expected
// to generate Google Test fatal failures. It verifies that the given
// to generate Google Test fatal failures. It verifies that the given
// statement will cause exactly one fatal Google Test failure with 'substr'
// statement will cause exactly one fatal Google Test failure with 'substr'
...
...
googletest/include/gtest/gtest-test-part.h
View file @
6c8c74ec
...
@@ -37,6 +37,9 @@
...
@@ -37,6 +37,9 @@
#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-string.h"
#include "gtest/internal/gtest-string.h"
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4251
\
/* class A needs to have dll-interface to be used by clients of class B */
)
namespace
testing
{
namespace
testing
{
// A copyable object representing the result of a test part (i.e. an
// A copyable object representing the result of a test part (i.e. an
...
@@ -142,7 +145,7 @@ class GTEST_API_ TestPartResultArray {
...
@@ -142,7 +145,7 @@ class GTEST_API_ TestPartResultArray {
};
};
// This interface knows how to report a test part result.
// This interface knows how to report a test part result.
class
TestPartResultReporterInterface
{
class
GTEST_API_
TestPartResultReporterInterface
{
public:
public:
virtual
~
TestPartResultReporterInterface
()
{}
virtual
~
TestPartResultReporterInterface
()
{}
...
@@ -175,4 +178,6 @@ class GTEST_API_ HasNewFatalFailureHelper
...
@@ -175,4 +178,6 @@ class GTEST_API_ HasNewFatalFailureHelper
}
// namespace testing
}
// namespace testing
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4251
#endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
#endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
googletest/include/gtest/gtest.h
View file @
6c8c74ec
...
@@ -66,6 +66,9 @@
...
@@ -66,6 +66,9 @@
#include "gtest/gtest-test-part.h"
#include "gtest/gtest-test-part.h"
#include "gtest/gtest-typed-test.h"
#include "gtest/gtest-typed-test.h"
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4251
\
/* class A needs to have dll-interface to be used by clients of class B */
)
// Depending on the platform, different string classes are available.
// Depending on the platform, different string classes are available.
// On Linux, in addition to ::std::string, Google also makes use of
// On Linux, in addition to ::std::string, Google also makes use of
// class ::string, which has the same interface as ::std::string, but
// class ::string, which has the same interface as ::std::string, but
...
@@ -2330,4 +2333,6 @@ inline int RUN_ALL_TESTS() {
...
@@ -2330,4 +2333,6 @@ inline int RUN_ALL_TESTS() {
return
::
testing
::
UnitTest
::
GetInstance
()
->
Run
();
return
::
testing
::
UnitTest
::
GetInstance
()
->
Run
();
}
}
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4251
#endif // GTEST_INCLUDE_GTEST_GTEST_H_
#endif // GTEST_INCLUDE_GTEST_GTEST_H_
googletest/include/gtest/internal/gtest-death-test-internal.h
View file @
6c8c74ec
...
@@ -52,6 +52,9 @@ const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
...
@@ -52,6 +52,9 @@ const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
#if GTEST_HAS_DEATH_TEST
#if GTEST_HAS_DEATH_TEST
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4251
\
/* class A needs to have dll-interface to be used by clients of class B */
)
// DeathTest is a class that hides much of the complexity of the
// DeathTest is a class that hides much of the complexity of the
// GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
// GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
// returns a concrete class that depends on the prevailing death test
// returns a concrete class that depends on the prevailing death test
...
@@ -135,6 +138,8 @@ class GTEST_API_ DeathTest {
...
@@ -135,6 +138,8 @@ class GTEST_API_ DeathTest {
GTEST_DISALLOW_COPY_AND_ASSIGN_
(
DeathTest
);
GTEST_DISALLOW_COPY_AND_ASSIGN_
(
DeathTest
);
};
};
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4251
// Factory interface for death tests. May be mocked out for testing.
// Factory interface for death tests. May be mocked out for testing.
class
DeathTestFactory
{
class
DeathTestFactory
{
public:
public:
...
...
googletest/include/gtest/internal/gtest-filepath.h
View file @
6c8c74ec
...
@@ -42,6 +42,9 @@
...
@@ -42,6 +42,9 @@
#include "gtest/internal/gtest-string.h"
#include "gtest/internal/gtest-string.h"
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4251
\
/* class A needs to have dll-interface to be used by clients of class B */
)
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
...
@@ -203,4 +206,6 @@ class GTEST_API_ FilePath {
...
@@ -203,4 +206,6 @@ class GTEST_API_ FilePath {
}
// namespace internal
}
// namespace internal
}
// namespace testing
}
// namespace testing
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4251
#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
googletest/include/gtest/internal/gtest-internal.h
View file @
6c8c74ec
...
@@ -141,6 +141,9 @@ GTEST_API_ std::string AppendUserMessage(
...
@@ -141,6 +141,9 @@ GTEST_API_ std::string AppendUserMessage(
#if GTEST_HAS_EXCEPTIONS
#if GTEST_HAS_EXCEPTIONS
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4275
\
/* an exported class was derived from a class that was not exported */
)
// This exception is thrown by (and only by) a failed Google Test
// This exception is thrown by (and only by) a failed Google Test
// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
// are enabled). We derive it from std::runtime_error, which is for
// are enabled). We derive it from std::runtime_error, which is for
...
@@ -152,6 +155,8 @@ class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
...
@@ -152,6 +155,8 @@ class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
explicit
GoogleTestFailureException
(
const
TestPartResult
&
failure
);
explicit
GoogleTestFailureException
(
const
TestPartResult
&
failure
);
};
};
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4275
#endif // GTEST_HAS_EXCEPTIONS
#endif // GTEST_HAS_EXCEPTIONS
namespace
edit_distance
{
namespace
edit_distance
{
...
@@ -528,6 +533,9 @@ GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
...
@@ -528,6 +533,9 @@ GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4251
\
/* class A needs to have dll-interface to be used by clients of class B */
)
// State of the definition of a type-parameterized test case.
// State of the definition of a type-parameterized test case.
class
GTEST_API_
TypedTestCasePState
{
class
GTEST_API_
TypedTestCasePState
{
public:
public:
...
@@ -573,6 +581,8 @@ class GTEST_API_ TypedTestCasePState {
...
@@ -573,6 +581,8 @@ class GTEST_API_ TypedTestCasePState {
RegisteredTestsMap
registered_tests_
;
RegisteredTestsMap
registered_tests_
;
};
};
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4251
// Skips to the first non-space char after the first comma in 'str';
// Skips to the first non-space char after the first comma in 'str';
// returns NULL if no comma is found in 'str'.
// returns NULL if no comma is found in 'str'.
inline
const
char
*
SkipComma
(
const
char
*
str
)
{
inline
const
char
*
SkipComma
(
const
char
*
str
)
{
...
...
googletest/samples/sample4.cc
View file @
6c8c74ec
...
@@ -40,13 +40,13 @@ int Counter::Increment() {
...
@@ -40,13 +40,13 @@ int Counter::Increment() {
// Returns the current counter value, and decrements it.
// Returns the current counter value, and decrements it.
// counter can not be less than 0, return 0 in this case
// counter can not be less than 0, return 0 in this case
int
Counter
::
Decrement
()
{
int
Counter
::
Decrement
()
{
if
(
counter_
==
0
){
if
(
counter_
==
0
)
{
return
counter_
;
return
counter_
;
}
}
else
{
else
return
counter_
--
;
return
counter_
--
;
}
}
}
// Prints the current counter value to STDOUT.
// Prints the current counter value to STDOUT.
void
Counter
::
Print
()
const
{
void
Counter
::
Print
()
const
{
...
...
googletest/samples/sample4.h
View file @
6c8c74ec
...
@@ -43,10 +43,9 @@ class Counter {
...
@@ -43,10 +43,9 @@ class Counter {
// Returns the current counter value, and increments it.
// Returns the current counter value, and increments it.
int
Increment
();
int
Increment
();
// Returns the current counter value, and decrements it.
// Returns the current counter value, and decrements it.
int
Decrement
();
int
Decrement
();
// Prints the current counter value to STDOUT.
// Prints the current counter value to STDOUT.
void
Print
()
const
;
void
Print
()
const
;
};
};
...
...
googletest/samples/sample4_unittest.cc
View file @
6c8c74ec
...
@@ -40,7 +40,6 @@ TEST(Counter, Increment) {
...
@@ -40,7 +40,6 @@ TEST(Counter, Increment) {
// Test that counter 0 returns 0
// Test that counter 0 returns 0
EXPECT_EQ
(
0
,
c
.
Decrement
());
EXPECT_EQ
(
0
,
c
.
Decrement
());
// EXPECT_EQ() evaluates its arguments exactly once, so they
// EXPECT_EQ() evaluates its arguments exactly once, so they
// can have side effects.
// can have side effects.
...
@@ -49,7 +48,6 @@ TEST(Counter, Increment) {
...
@@ -49,7 +48,6 @@ TEST(Counter, Increment) {
EXPECT_EQ
(
2
,
c
.
Increment
());
EXPECT_EQ
(
2
,
c
.
Increment
());
EXPECT_EQ
(
3
,
c
.
Decrement
());
EXPECT_EQ
(
3
,
c
.
Decrement
());
}
}
}
// namespace
}
// namespace
googletest/src/gtest-internal-inl.h
View file @
6c8c74ec
...
@@ -59,6 +59,9 @@
...
@@ -59,6 +59,9 @@
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "gtest/gtest-spi.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
{
namespace
testing
{
// Declares the flags.
// Declares the flags.
...
@@ -1179,4 +1182,6 @@ class StreamingListener : public EmptyTestEventListener {
...
@@ -1179,4 +1182,6 @@ class StreamingListener : public EmptyTestEventListener {
}
// namespace internal
}
// namespace internal
}
// namespace testing
}
// namespace testing
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4251
#endif // GTEST_SRC_GTEST_INTERNAL_INL_H_
#endif // GTEST_SRC_GTEST_INTERNAL_INL_H_
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