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 | 3c712c7c680d2b93fae03957df9561bd08eb5b7c (patch) | |
tree | 67c4d640d22500fe4daafe7144095c91d77424b1 /library/cpp/testing/gtest_extensions/ut | |
parent | 0ba74a57f9d49cfef11e512659c5847b98867342 (diff) | |
download | ydb-3c712c7c680d2b93fae03957df9561bd08eb5b7c.tar.gz |
Restoring authorship annotation for <dancingqueue@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/testing/gtest_extensions/ut')
-rw-r--r-- | library/cpp/testing/gtest_extensions/ut/gtest_extensions_ut.cpp | 56 | ||||
-rw-r--r-- | library/cpp/testing/gtest_extensions/ut/ya.make | 26 |
2 files changed, 41 insertions, 41 deletions
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..4c1f48e593 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 39b41cecfd..58df6b0dcb 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() |