diff options
author | komels <komels@yandex-team.ru> | 2022-04-14 13:10:53 +0300 |
---|---|---|
committer | komels <komels@yandex-team.ru> | 2022-04-14 13:10:53 +0300 |
commit | 21c9b0e6b039e9765eb414c406c2b86e8cea6850 (patch) | |
tree | f40ebc18ff8958dfbd189954ad024043ca983ea5 /library/cpp/tvmauth/client/ut/logger_ut.cpp | |
parent | 9a4effa852abe489707139c2b260dccc6f4f9aa9 (diff) | |
download | ydb-21c9b0e6b039e9765eb414c406c2b86e8cea6850.tar.gz |
Final part on compatibility layer: LOGBROKER-7215
ref:777c67aadbf705d19034a09a792b2df61ba53697
Diffstat (limited to 'library/cpp/tvmauth/client/ut/logger_ut.cpp')
-rw-r--r-- | library/cpp/tvmauth/client/ut/logger_ut.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/library/cpp/tvmauth/client/ut/logger_ut.cpp b/library/cpp/tvmauth/client/ut/logger_ut.cpp new file mode 100644 index 0000000000..76236e8913 --- /dev/null +++ b/library/cpp/tvmauth/client/ut/logger_ut.cpp @@ -0,0 +1,43 @@ +#include "common.h" + +#include <library/cpp/tvmauth/client/logger.h> + +#include <library/cpp/testing/unittest/registar.h> + +using namespace NTvmAuth; + +Y_UNIT_TEST_SUITE(ClientLogger) { + int i = 0; + + Y_UNIT_TEST(Debug) { + TLogger l; + l.Debug("qwerty"); + UNIT_ASSERT_VALUES_EQUAL("7: qwerty\n", l.Stream.Str()); + } + + Y_UNIT_TEST(Info) { + TLogger l; + l.Info("qwerty"); + UNIT_ASSERT_VALUES_EQUAL("6: qwerty\n", l.Stream.Str()); + } + + Y_UNIT_TEST(Warning) { + TLogger l; + l.Warning("qwerty"); + UNIT_ASSERT_VALUES_EQUAL("4: qwerty\n", l.Stream.Str()); + } + + Y_UNIT_TEST(Error) { + TLogger l; + l.Error("qwerty"); + UNIT_ASSERT_VALUES_EQUAL("3: qwerty\n", l.Stream.Str()); + } + +#ifdef _unix_ + Y_UNIT_TEST(Cerr_) { + TCerrLogger l(5); + l.Error("hit"); + l.Debug("miss"); + } +#endif +} |