aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/testing/unittest/registar.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/testing/unittest/registar.cpp
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/testing/unittest/registar.cpp')
-rw-r--r--library/cpp/testing/unittest/registar.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/library/cpp/testing/unittest/registar.cpp b/library/cpp/testing/unittest/registar.cpp
index 606e18cefd..3679b768ed 100644
--- a/library/cpp/testing/unittest/registar.cpp
+++ b/library/cpp/testing/unittest/registar.cpp
@@ -11,27 +11,27 @@
#include <util/system/tls.h>
#include <util/system/error.h>
#include <util/string/cast.h>
-
+
bool NUnitTest::ShouldColorizeDiff = true;
bool NUnitTest::ContinueOnFail = false;
TString NUnitTest::RandomString(size_t len, ui32 seed) {
- TReallyFastRng32 rand(seed);
+ TReallyFastRng32 rand(seed);
TString ret;
-
- ret.reserve(len);
-
- for (size_t i = 0; i < len; ++i) {
- ret.push_back(char(rand.Uniform(1, 128)));
- }
-
- return ret;
-}
-
-Y_POD_STATIC_THREAD(bool)
-UnittestThread;
-Y_POD_STATIC_THREAD(NUnitTest::TTestBase*)
-currentTest;
+
+ ret.reserve(len);
+
+ for (size_t i = 0; i < len; ++i) {
+ ret.push_back(char(rand.Uniform(1, 128)));
+ }
+
+ return ret;
+}
+
+Y_POD_STATIC_THREAD(bool)
+UnittestThread;
+Y_POD_STATIC_THREAD(NUnitTest::TTestBase*)
+currentTest;
::NUnitTest::TRaiseErrorHandler RaiseErrorHandler;
void ::NUnitTest::NPrivate::RaiseError(const char* what, const TString& msg, bool fatalFailure) {
@@ -78,8 +78,8 @@ struct TDiffColorizer {
explicit TDiffColorizer(bool reverse = false)
: Reverse(reverse)
- {
- }
+ {
+ }
TString Special(TStringBuf str) const {
return ToString(Colors.YellowColor()) + str;
@@ -111,8 +111,8 @@ struct TTraceDiffFormatter {
explicit TTraceDiffFormatter(bool reverse = false)
: Reverse(reverse)
- {
- }
+ {
+ }
TString Special(TStringBuf str) const {
return ToString(str);
@@ -124,14 +124,14 @@ struct TTraceDiffFormatter {
TString Left(TArrayRef<const char> str) const {
return NUnitTest::GetFormatTag("good") +
- TString(str.begin(), str.end()) +
- NUnitTest::GetResetTag();
+ TString(str.begin(), str.end()) +
+ NUnitTest::GetResetTag();
}
TString Right(TArrayRef<const char> str) const {
return NUnitTest::GetFormatTag("bad") +
- TString(str.begin(), str.end()) +
- NUnitTest::GetResetTag();
+ TString(str.begin(), str.end()) +
+ NUnitTest::GetResetTag();
}
};
@@ -149,7 +149,7 @@ TString NUnitTest::ColoredDiff(TStringBuf s1, TStringBuf s2, const TString& deli
NDiff::InlineDiff(chunks, s1, s2, delims);
if (NUnitTest::ShouldColorizeDiff) {
NDiff::PrintChunks(res, TDiffColorizer(reverse), chunks);
- } else {
+ } else {
res << NUnitTest::GetResetTag();
NDiff::PrintChunks(res, TTraceDiffFormatter(reverse), chunks);
}
@@ -290,10 +290,10 @@ void NUnitTest::ITestBaseFactory::Register() noexcept {
}
NUnitTest::TTestBase::TTestBase() noexcept
- : Parent_(nullptr)
- , TestErrors_()
- , CurrentSubtest_()
-{
+ : Parent_(nullptr)
+ , TestErrors_()
+ , CurrentSubtest_()
+{
}
NUnitTest::TTestBase::~TTestBase() = default;