diff options
author | thegeorg <thegeorg@yandex-team.ru> | 2022-02-10 16:45:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:08 +0300 |
commit | 4e839db24a3bbc9f1c610c43d6faaaa99824dcca (patch) | |
tree | 506dac10f5df94fab310584ee51b24fc5a081c22 /library/cpp/testing/gtest_extensions | |
parent | 2d37894b1b037cf24231090eda8589bbb44fb6fc (diff) | |
download | ydb-4e839db24a3bbc9f1c610c43d6faaaa99824dcca.tar.gz |
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 1 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 5445c7a464..75c9c3591e 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 14d8284446..69533fe5d8 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 c3a49b9323..2321e0c8ba 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 7d1fee83d3..019759d09e 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 81cdfd0427..7dd8c9d57e 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 39b41cecfd..b5d696a4bd 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 |