diff options
author | dancingqueue <dancingqueue@yandex-team.ru> | 2022-02-10 16:50:06 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:06 +0300 |
commit | 97ccada5638c88fa727d68a9ee849a9a768a54d9 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library | |
parent | 3c712c7c680d2b93fae03957df9561bd08eb5b7c (diff) | |
download | ydb-97ccada5638c88fa727d68a9ee849a9a768a54d9.tar.gz |
Restoring authorship annotation for <dancingqueue@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library')
4 files changed, 59 insertions, 59 deletions
diff --git a/library/cpp/testing/gtest_extensions/gtest_extensions.h b/library/cpp/testing/gtest_extensions/gtest_extensions.h index 0859000800..e20532241e 100644 --- a/library/cpp/testing/gtest_extensions/gtest_extensions.h +++ b/library/cpp/testing/gtest_extensions/gtest_extensions.h @@ -1,5 +1,5 @@ -#pragma once - +#pragma once + #include "assertions.h" #include "matchers.h" #include "pretty_printers.h" 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 4c1f48e593..81cdfd0427 100644 --- a/library/cpp/testing/gtest_extensions/ut/gtest_extensions_ut.cpp +++ b/library/cpp/testing/gtest_extensions/ut/gtest_extensions_ut.cpp @@ -1,49 +1,49 @@ #include <library/cpp/testing/gtest/gtest.h> - + #include <util/generic/string.h> #include <util/generic/maybe.h> #include <util/stream/output.h> #include <util/stream/str.h> - -namespace { - class IMock { - public: - virtual void M1(const TStringBuf&) = 0; - virtual void M2(TStringBuf) = 0; - virtual void M3(const TString&) = 0; - virtual void M4(TString) = 0; - }; - - class TSampleMock : IMock { - public: - MOCK_METHOD(void, M1, (const TStringBuf&)); - MOCK_METHOD(void, M2, (TStringBuf)); - MOCK_METHOD(void, M3, (const TString&)); - MOCK_METHOD(void, M4, (TString)); - }; -} - - + +namespace { + class IMock { + public: + virtual void M1(const TStringBuf&) = 0; + virtual void M2(TStringBuf) = 0; + virtual void M3(const TString&) = 0; + virtual void M4(TString) = 0; + }; + + class TSampleMock : IMock { + public: + MOCK_METHOD(void, M1, (const TStringBuf&)); + MOCK_METHOD(void, M2, (TStringBuf)); + MOCK_METHOD(void, M3, (const TString&)); + MOCK_METHOD(void, M4, (TString)); + }; +} + + TEST(MatchersSpecializations, String) { TSampleMock mock; - + TStringBuf simpleStringBuf = "SimpleStringBuf"; const TStringBuf constSimpleStringBuf = "ConstSimpleStringBuf"; - + TString simpleString = "SimpleString"; const TString constSimpleString = "ConstSimpleString"; - + EXPECT_CALL(mock, M1("ConstSimpleStringBuf")).Times(1); EXPECT_CALL(mock, M2("SimpleStringBuf")).Times(1); EXPECT_CALL(mock, M3("ConstSimpleString")).Times(1); EXPECT_CALL(mock, M4("SimpleString")).Times(1); - + mock.M1(constSimpleStringBuf); mock.M2(simpleStringBuf); mock.M3(constSimpleString); mock.M4(simpleString); } - + template <typename T, typename M> std::pair<bool, std::string> Match(T&& t, M&& m) { testing::StringMatchResultListener listener; @@ -233,9 +233,9 @@ struct TThrowsOnMove { TThrowsOnMove() = default; TThrowsOnMove(TThrowsOnMove&&) { ythrow yexception() << "move failed"; - } + } }; - + TEST(PrettyPrinters, String) { EXPECT_EQ(GtestPrint(TString("hello world")), "\"hello world\""); EXPECT_EQ(GtestPrint(TStringBuf("hello world")), "\"hello world\""); diff --git a/library/cpp/testing/gtest_extensions/ut/ya.make b/library/cpp/testing/gtest_extensions/ut/ya.make index 58df6b0dcb..39b41cecfd 100644 --- a/library/cpp/testing/gtest_extensions/ut/ya.make +++ b/library/cpp/testing/gtest_extensions/ut/ya.make @@ -1,20 +1,20 @@ GTEST() -OWNER( +OWNER( amatanhead - bulatman - dancingqueue + bulatman + dancingqueue prettyboy thegeorg - g:cpp-contrib -) - -SRCS( + g:cpp-contrib +) + +SRCS( gtest_extensions_ut.cpp probe_ut.cpp -) - -PEERDIR( +) + +PEERDIR( library/cpp/testing/gtest_extensions -) - -END() +) + +END() diff --git a/library/cpp/testing/gtest_extensions/ya.make b/library/cpp/testing/gtest_extensions/ya.make index 6a9a9ecca5..e24e81e8bd 100644 --- a/library/cpp/testing/gtest_extensions/ya.make +++ b/library/cpp/testing/gtest_extensions/ya.make @@ -1,26 +1,26 @@ -LIBRARY() -OWNER( +LIBRARY() +OWNER( amatanhead - bulatman - dancingqueue + bulatman + dancingqueue prettyboy thegeorg - g:cpp-contrib -) - -PEERDIR( + g:cpp-contrib +) + +PEERDIR( contrib/restricted/googletest/googlemock contrib/restricted/googletest/googletest -) - -SRCS( +) + +SRCS( assertions.cpp gtest_extensions.cpp matchers.cpp pretty_printers.cpp probe.cpp -) - -END() - -RECURSE_FOR_TESTS(ut) +) + +END() + +RECURSE_FOR_TESTS(ut) |