diff options
author | thegeorg <[email protected]> | 2022-02-10 16:45:12 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:12 +0300 |
commit | 49116032d905455a7b1c994e4a696afc885c1e71 (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /library/cpp/testing/gtest_extensions | |
parent | 4e839db24a3bbc9f1c610c43d6faaaa99824dcca (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/testing/gtest_extensions')
6 files changed, 26 insertions, 26 deletions
diff --git a/library/cpp/testing/gtest_extensions/README.md b/library/cpp/testing/gtest_extensions/README.md index 75c9c3591e6..5445c7a464a 100644 --- a/library/cpp/testing/gtest_extensions/README.md +++ b/library/cpp/testing/gtest_extensions/README.md @@ -2,4 +2,4 @@ Extensions that enable better support of util types in gtest and gmock: pretty printers, matchers, some convenience macros. -If you're using `GTEST`, include `library/cpp/testing/gtest/gtest.h` and it will automatically enable these extensions. This is the preferred way to include gtest and gmock as opposed to including gtest, gmock and extensions directly. It eliminates chances of forgetting to include extensions. +If you're using `GTEST`, include `library/cpp/testing/gtest/gtest.h` and it will automatically enable these extensions. This is the preferred way to include gtest and gmock as opposed to including gtest, gmock and extensions directly. It eliminates chances of forgetting to include extensions. diff --git a/library/cpp/testing/gtest_extensions/pretty_printers.h b/library/cpp/testing/gtest_extensions/pretty_printers.h index 69533fe5d88..14d82844464 100644 --- a/library/cpp/testing/gtest_extensions/pretty_printers.h +++ b/library/cpp/testing/gtest_extensions/pretty_printers.h @@ -39,8 +39,8 @@ * } * ``` */ -#define Y_GTEST_ARCADIA_PRINTER(T) \ - void PrintTo(const T& value, std::ostream* stream) { \ +#define Y_GTEST_ARCADIA_PRINTER(T) \ + void PrintTo(const T& value, std::ostream* stream) { \ ::TString ss; \ ::TStringOutput s{ss}; \ s << value; \ @@ -48,18 +48,18 @@ } -template <typename TCharType, typename TCharTraits> -void PrintTo(const TBasicString<TCharType, TCharTraits>& value, std::ostream* stream) { +template <typename TCharType, typename TCharTraits> +void PrintTo(const TBasicString<TCharType, TCharTraits>& value, std::ostream* stream) { *stream << value.Quote().c_str(); } -template <typename TCharType, typename TCharTraits> -void PrintTo(TBasicStringBuf<TCharType, TCharTraits> value, std::ostream* stream) { - *stream << TBasicString<TCharType, TCharTraits>{value}.Quote().c_str(); +template <typename TCharType, typename TCharTraits> +void PrintTo(TBasicStringBuf<TCharType, TCharTraits> value, std::ostream* stream) { + *stream << TBasicString<TCharType, TCharTraits>{value}.Quote().c_str(); } template <typename T, typename P> -void PrintTo(const TMaybe<T, P>& value, std::ostream* stream) { +void PrintTo(const TMaybe<T, P>& value, std::ostream* stream) { if (value.Defined()) { ::testing::internal::UniversalPrint(value.GetRef(), stream); } else { @@ -67,7 +67,7 @@ void PrintTo(const TMaybe<T, P>& value, std::ostream* stream) { } } -inline void PrintTo(TNothing /* value */, std::ostream* stream) { +inline void PrintTo(TNothing /* value */, std::ostream* stream) { *stream << "nothing"; } diff --git a/library/cpp/testing/gtest_extensions/probe.cpp b/library/cpp/testing/gtest_extensions/probe.cpp index 2321e0c8ba3..c3a49b93238 100644 --- a/library/cpp/testing/gtest_extensions/probe.cpp +++ b/library/cpp/testing/gtest_extensions/probe.cpp @@ -2,7 +2,7 @@ #include <ostream> -namespace testing { +namespace testing { void PrintTo(const TProbeState& state, ::std::ostream* os) { int copies = state.CopyConstructors + state.CopyAssignments; int moves = state.MoveConstructors + state.MoveAssignments; @@ -10,4 +10,4 @@ namespace testing { << "copies: " << copies << " = " << state.CopyConstructors << " + " << state.CopyAssignments << "; " << "moves: " << moves << " = " << state.MoveConstructors << " + " << state.MoveAssignments; } -} // namespace testing +} // namespace testing diff --git a/library/cpp/testing/gtest_extensions/probe.h b/library/cpp/testing/gtest_extensions/probe.h index 019759d09e0..7d1fee83d38 100644 --- a/library/cpp/testing/gtest_extensions/probe.h +++ b/library/cpp/testing/gtest_extensions/probe.h @@ -2,15 +2,15 @@ #include <util/system/yassert.h> -#include <library/cpp/testing/common/probe.h> - +#include <library/cpp/testing/common/probe.h> + #include <gtest/gtest.h> #include <gmock/gmock.h> -namespace testing { - using NTesting::TProbe; - using NTesting::TProbeState; - using NTesting::TCoercibleToProbe; +namespace testing { + using NTesting::TProbe; + using NTesting::TProbeState; + using NTesting::TCoercibleToProbe; // A helper functor which extracts from probe-like objectss their state. struct TProbableTraits { @@ -43,13 +43,13 @@ namespace testing { MATCHER(IsAlive, "is alive") { Y_UNUSED(result_listener); - const auto& state = TProbableTraits::ExtractState(arg); + const auto& state = TProbableTraits::ExtractState(arg); return state.Destructors < state.Constructors + state.CopyConstructors + state.CopyAssignments; } MATCHER(IsDead, "is dead") { Y_UNUSED(result_listener); - const auto& state = TProbableTraits::ExtractState(arg); + const auto& state = TProbableTraits::ExtractState(arg); return state.Destructors == state.Constructors + state.CopyConstructors + state.CopyAssignments; } @@ -57,25 +57,25 @@ namespace testing { PrintToString(copyCount) + " copy constructors and " + \ PrintToString(moveCount) + " move constructors were called") { Y_UNUSED(result_listener); - const auto& state = TProbableTraits::ExtractState(arg); + const auto& state = TProbableTraits::ExtractState(arg); return state.CopyConstructors == copyCount && state.MoveConstructors == moveCount; } MATCHER(NoCopies, "no copies were made") { Y_UNUSED(result_listener); - const auto& state = TProbableTraits::ExtractState(arg); + const auto& state = TProbableTraits::ExtractState(arg); return 0 == state.CopyConstructors && 0 == state.CopyAssignments; } MATCHER(NoMoves, "no moves were made") { Y_UNUSED(result_listener); - const auto& state = TProbableTraits::ExtractState(arg); + const auto& state = TProbableTraits::ExtractState(arg); return 0 == state.MoveConstructors && 0 == state.MoveAssignments; } MATCHER(NoAssignments, "no assignments were made") { Y_UNUSED(result_listener); - const auto& state = TProbableTraits::ExtractState(arg); + const auto& state = TProbableTraits::ExtractState(arg); return 0 == state.CopyAssignments && 0 == state.MoveAssignments; } } diff --git a/library/cpp/testing/gtest_extensions/ut/gtest_extensions_ut.cpp b/library/cpp/testing/gtest_extensions/ut/gtest_extensions_ut.cpp index 7dd8c9d57e5..81cdfd04271 100644 --- a/library/cpp/testing/gtest_extensions/ut/gtest_extensions_ut.cpp +++ b/library/cpp/testing/gtest_extensions/ut/gtest_extensions_ut.cpp @@ -251,7 +251,7 @@ struct T1 { int x; }; -void PrintTo(T1 value, std::ostream* stream) { +void PrintTo(T1 value, std::ostream* stream) { *stream << "T1{" << value.x << "}"; } diff --git a/library/cpp/testing/gtest_extensions/ut/ya.make b/library/cpp/testing/gtest_extensions/ut/ya.make index b5d696a4bd6..39b41cecfd2 100644 --- a/library/cpp/testing/gtest_extensions/ut/ya.make +++ b/library/cpp/testing/gtest_extensions/ut/ya.make @@ -1,4 +1,4 @@ -GTEST() +GTEST() OWNER( amatanhead bulatman |