aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/testing/unittest
diff options
context:
space:
mode:
authordanlark <danlark@yandex-team.ru>2022-02-10 16:46:10 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:10 +0300
commitbaa58daefa91fde4b4769facdbd2903763b9c6a8 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/testing/unittest
parent3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (diff)
downloadydb-baa58daefa91fde4b4769facdbd2903763b9c6a8.tar.gz
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/testing/unittest')
-rw-r--r--library/cpp/testing/unittest/registar.cpp8
-rw-r--r--library/cpp/testing/unittest/registar.h2
-rw-r--r--library/cpp/testing/unittest/registar_ut.cpp2
-rw-r--r--library/cpp/testing/unittest/utmain.cpp48
4 files changed, 30 insertions, 30 deletions
diff --git a/library/cpp/testing/unittest/registar.cpp b/library/cpp/testing/unittest/registar.cpp
index 7d40ff2c27..3679b768ed 100644
--- a/library/cpp/testing/unittest/registar.cpp
+++ b/library/cpp/testing/unittest/registar.cpp
@@ -35,7 +35,7 @@ currentTest;
::NUnitTest::TRaiseErrorHandler RaiseErrorHandler;
void ::NUnitTest::NPrivate::RaiseError(const char* what, const TString& msg, bool fatalFailure) {
- Y_VERIFY(UnittestThread, "%s in non-unittest thread with message:\n%s", what, msg.data());
+ Y_VERIFY(UnittestThread, "%s in non-unittest thread with message:\n%s", what, msg.data());
Y_VERIFY(GetCurrentTest());
if (RaiseErrorHandler) {
@@ -46,7 +46,7 @@ void ::NUnitTest::NPrivate::RaiseError(const char* what, const TString& msg, boo
// Default handler
TBackTrace bt;
bt.Capture();
- GetCurrentTest()->AddError(msg.data(), bt.PrintToString());
+ GetCurrentTest()->AddError(msg.data(), bt.PrintToString());
if (::NUnitTest::ContinueOnFail || !fatalFailure) {
return;
}
@@ -414,7 +414,7 @@ NUnitTest::TTestBase::TCleanUp::~TCleanUp() {
try {
Base_->AfterTest();
} catch (...) {
- Base_->AddError(CurrentExceptionMessage().data());
+ Base_->AddError(CurrentExceptionMessage().data());
}
::NUnitTest::NPrivate::SetUnittestThread(false);
::NUnitTest::NPrivate::SetCurrentTest(nullptr);
@@ -434,7 +434,7 @@ namespace {
struct TCmp {
template <class T>
inline bool operator()(const T& l, const T& r) const noexcept {
- return stricmp(Fix(l.Name().data()), Fix(r.Name().data())) < 0;
+ return stricmp(Fix(l.Name().data()), Fix(r.Name().data())) < 0;
}
static inline const char* Fix(const char* n) noexcept {
diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h
index 2774c8b4a9..44517a0092 100644
--- a/library/cpp/testing/unittest/registar.h
+++ b/library/cpp/testing/unittest/registar.h
@@ -454,7 +454,7 @@ public: \
const TString _a(A); \
const TString _b(B); \
if (_a != _b) { \
- UNIT_FAIL_IMPL("strings (" #A ") and (" #B ") are different", Sprintf("\n%s", ::NUnitTest::ColoredDiff(_a, _b, " \t\n.,:;'\"").data())); \
+ UNIT_FAIL_IMPL("strings (" #A ") and (" #B ") are different", Sprintf("\n%s", ::NUnitTest::ColoredDiff(_a, _b, " \t\n.,:;'\"").data())); \
} \
} while (false)
diff --git a/library/cpp/testing/unittest/registar_ut.cpp b/library/cpp/testing/unittest/registar_ut.cpp
index 35e71adf61..1f36d53abb 100644
--- a/library/cpp/testing/unittest/registar_ut.cpp
+++ b/library/cpp/testing/unittest/registar_ut.cpp
@@ -253,7 +253,7 @@ Y_UNIT_TEST_SUITE(TUnitTestMacroTest) {
UNIT_ASSERT_TEST_FAILS(valuesUnequal(5, 5));
UNIT_ASSERT_TEST_FAILS(valuesUnequal(static_cast<char>(5), 5l));
TString test("test");
- UNIT_ASSERT_TEST_FAILS(valuesUnequal("test", test.data()));
+ UNIT_ASSERT_TEST_FAILS(valuesUnequal("test", test.data()));
UNIT_ASSERT_VALUES_UNEQUAL("UNIT_ASSERT_VALUES_UNEQUAL", "UNIT_ASSERT_VALUES_EQUAL");
UNIT_ASSERT_VALUES_UNEQUAL(1.0, 1.1);
diff --git a/library/cpp/testing/unittest/utmain.cpp b/library/cpp/testing/unittest/utmain.cpp
index d7d73662af..305bc6b40f 100644
--- a/library/cpp/testing/unittest/utmain.cpp
+++ b/library/cpp/testing/unittest/utmain.cpp
@@ -41,7 +41,7 @@
#endif
#ifdef WITH_VALGRIND
-#define NOTE_IN_VALGRIND(test) VALGRIND_PRINTF("%s::%s", test->unit->name.data(), test->name)
+#define NOTE_IN_VALGRIND(test) VALGRIND_PRINTF("%s::%s", test->unit->name.data(), test->name)
#else
#define NOTE_IN_VALGRIND(test)
#endif
@@ -87,7 +87,7 @@ private:
event.InsertValue("class", className);
event.InsertValue("subtest", subtestName);
event.InsertValue("status", status);
- event.InsertValue("comment", comment.data());
+ event.InsertValue("comment", comment.data());
event.InsertValue("time", (now - PrevTime).SecondsFloat());
if (context) {
for (const auto& metric : context->Metrics) {
@@ -140,13 +140,13 @@ private:
}
void OnError(const TError* descr) override {
- const TString comment = BuildComment(descr->msg, descr->BackTrace.data());
+ const TString comment = BuildComment(descr->msg, descr->BackTrace.data());
ErrorMessages.push_back(comment);
}
void OnFinish(const TFinish* descr) override {
if (descr->Success) {
- TraceSubtestFinished(descr->test->unit->name.data(), descr->test->name, "good", "", descr->Context);
+ TraceSubtestFinished(descr->test->unit->name.data(), descr->test->name, "good", "", descr->Context);
} else {
TStringBuilder msgs;
for (const TString& m : ErrorMessages) {
@@ -158,7 +158,7 @@ private:
if (msgs) {
msgs << TStringBuf("\n");
}
- TraceSubtestFinished(descr->test->unit->name.data(), descr->test->name, "fail", msgs, descr->Context);
+ TraceSubtestFinished(descr->test->unit->name.data(), descr->test->name, "fail", msgs, descr->Context);
ErrorMessages.clear();
}
}
@@ -302,7 +302,7 @@ private:
return;
}
if (PrintBeforeSuite_ || PrintBeforeTest_) {
- fprintf(stderr, "%s<-----%s %s\n", LightBlueColor().data(), OldColor().data(), unit->name.data());
+ fprintf(stderr, "%s<-----%s %s\n", LightBlueColor().data(), OldColor().data(), unit->name.data());
}
}
@@ -316,11 +316,11 @@ private:
}
fprintf(stderr, "%s----->%s %s -> ok: %s%u%s",
- LightBlueColor().data(), OldColor().data(), unit->name.data(),
- LightGreenColor().data(), GoodTestsInCurrentUnit(), OldColor().data());
+ LightBlueColor().data(), OldColor().data(), unit->name.data(),
+ LightGreenColor().data(), GoodTestsInCurrentUnit(), OldColor().data());
if (FailTestsInCurrentUnit()) {
fprintf(stderr, ", err: %s%u%s",
- LightRedColor().data(), FailTestsInCurrentUnit(), OldColor().data());
+ LightRedColor().data(), FailTestsInCurrentUnit(), OldColor().data());
}
fprintf(stderr, "\n");
}
@@ -331,7 +331,7 @@ private:
return;
}
if (PrintBeforeTest_) {
- fprintf(stderr, "[%sexec%s] %s::%s...\n", LightBlueColor().data(), OldColor().data(), test->unit->name.data(), test->name);
+ fprintf(stderr, "[%sexec%s] %s::%s...\n", LightBlueColor().data(), OldColor().data(), test->unit->name.data(), test->name);
}
}
@@ -344,19 +344,19 @@ private:
return;
}
- const TString err = Sprintf("[%sFAIL%s] %s::%s -> %s%s%s\n%s%s%s", LightRedColor().data(), OldColor().data(),
- descr->test->unit->name.data(),
+ const TString err = Sprintf("[%sFAIL%s] %s::%s -> %s%s%s\n%s%s%s", LightRedColor().data(), OldColor().data(),
+ descr->test->unit->name.data(),
descr->test->name,
- LightRedColor().data(), descr->msg, OldColor().data(), LightCyanColor().data(), descr->BackTrace.data(), OldColor().data());
+ LightRedColor().data(), descr->msg, OldColor().data(), LightCyanColor().data(), descr->BackTrace.data(), OldColor().data());
const TDuration test_duration = SaveTestDuration();
if (ShowFails) {
if (PrintTimes_) {
- Fails.push_back(Sprintf("%s %s", test_duration.ToString().data(), err.data()));
+ Fails.push_back(Sprintf("%s %s", test_duration.ToString().data(), err.data()));
} else {
Fails.push_back(err);
}
}
- fprintf(stderr, "%s", err.data());
+ fprintf(stderr, "%s", err.data());
NOTE_IN_VALGRIND(descr->test);
PrintTimes(test_duration);
if (IsForked) {
@@ -374,8 +374,8 @@ private:
}
if (descr->Success) {
- fprintf(stderr, "[%sgood%s] %s::%s\n", LightGreenColor().data(), OldColor().data(),
- descr->test->unit->name.data(),
+ fprintf(stderr, "[%sgood%s] %s::%s\n", LightGreenColor().data(), OldColor().data(),
+ descr->test->unit->name.data(),
descr->test->name);
NOTE_IN_VALGRIND(descr->test);
PrintTimes(SaveTestDuration());
@@ -411,16 +411,16 @@ private:
}
fprintf(stderr, "[%sDONE%s] ok: %s%u%s",
- YellowColor().data(), OldColor().data(),
- LightGreenColor().data(), GoodTests(), OldColor().data());
+ YellowColor().data(), OldColor().data(),
+ LightGreenColor().data(), GoodTests(), OldColor().data());
if (FailTests())
fprintf(stderr, ", err: %s%u%s",
- LightRedColor().data(), FailTests(), OldColor().data());
+ LightRedColor().data(), FailTests(), OldColor().data());
fprintf(stderr, "\n");
if (ShowFails) {
for (size_t i = 0; i < Fails.size(); ++i) {
- printf("%s", Fails[i].data());
+ printf("%s", Fails[i].data());
}
}
}
@@ -434,7 +434,7 @@ private:
return false;
}
- if (DisabledSuites_.find(name.data()) != DisabledSuites_.end()) {
+ if (DisabledSuites_.find(name.data()) != DisabledSuites_.end()) {
return false;
}
@@ -442,7 +442,7 @@ private:
return true;
}
- return EnabledSuites_.find(name.data()) != EnabledSuites_.end();
+ return EnabledSuites_.find(name.data()) != EnabledSuites_.end();
}
bool CheckAccessTest(TString suite, const char* test) override {
@@ -468,7 +468,7 @@ private:
}
TList<TString> args(1, "--is-forked-internal");
- args.push_back(Sprintf("+%s::%s", suite.data(), name));
+ args.push_back(Sprintf("+%s::%s", suite.data(), name));
// stdin is ignored - unittest should not need them...
TShellCommand cmd(AppName, args,