aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/testing
diff options
context:
space:
mode:
authortobo <tobo@yandex-team.ru>2022-02-10 16:47:27 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:27 +0300
commit7fe839092527589b38f014d854c51565b3c1adfa (patch)
tree309e97022d3530044b712b8f71318c78faf7856e /library/cpp/testing
parentd0d68c395c10da4cb56a1c845504570a04d7893e (diff)
downloadydb-7fe839092527589b38f014d854c51565b3c1adfa.tar.gz
Restoring authorship annotation for <tobo@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/testing')
-rw-r--r--library/cpp/testing/benchmark/bench.cpp22
-rw-r--r--library/cpp/testing/benchmark/bench.h10
-rw-r--r--library/cpp/testing/common/env.h2
-rw-r--r--library/cpp/testing/common/network.cpp2
-rw-r--r--library/cpp/testing/gmock_in_unittest/events.cpp8
-rw-r--r--library/cpp/testing/unittest/registar.cpp2
-rw-r--r--library/cpp/testing/unittest/registar.h26
-rw-r--r--library/cpp/testing/unittest/registar_ut.cpp24
-rw-r--r--library/cpp/testing/unittest/utmain.cpp4
9 files changed, 50 insertions, 50 deletions
diff --git a/library/cpp/testing/benchmark/bench.cpp b/library/cpp/testing/benchmark/bench.cpp
index 08d8708005..24299e6b12 100644
--- a/library/cpp/testing/benchmark/bench.cpp
+++ b/library/cpp/testing/benchmark/bench.cpp
@@ -73,7 +73,7 @@ namespace {
const TStringBuf N;
};
- inline TString DoFmtTime(double t) {
+ inline TString DoFmtTime(double t) {
if (t > 0.1) {
return ToString(t) + " seconds";
}
@@ -173,7 +173,7 @@ namespace {
}
};
- TLinFunc CalcModel(const TSamples& s) {
+ TLinFunc CalcModel(const TSamples& s) {
TKahanSLRSolver solver;
for (const auto& p : s) {
@@ -188,7 +188,7 @@ namespace {
return TLinFunc{c, i};
}
- inline TSamples RemoveOutliers(const TSamples& s, double fraction) {
+ inline TSamples RemoveOutliers(const TSamples& s, double fraction) {
if (s.size() < 20) {
return s;
}
@@ -263,7 +263,7 @@ namespace {
using TTests = TIntrusiveListWithAutoDelete<ITestRunner, TDestructor>;
- inline TTests& Tests() {
+ inline TTests& Tests() {
return *Singleton<TTests>();
}
@@ -285,7 +285,7 @@ namespace {
F_JSON /* "json" */
};
- TAdaptiveLock STDOUT_LOCK;
+ TAdaptiveLock STDOUT_LOCK;
struct IReporter {
virtual void Report(TResult&& result) = 0;
@@ -420,7 +420,7 @@ namespace {
TAdaptiveLock ResultsLock_;
};
- THolder<IReporter> MakeReporter(const EOutFormat type) {
+ THolder<IReporter> MakeReporter(const EOutFormat type) {
switch (type) {
case F_CONSOLE:
return MakeHolder<TConsoleReporter>();
@@ -438,11 +438,11 @@ namespace {
return MakeHolder<TConsoleReporter>(); // make compiler happy
}
- THolder<IReporter> MakeOrderedReporter(const EOutFormat type) {
+ THolder<IReporter> MakeOrderedReporter(const EOutFormat type) {
return MakeHolder<TOrderedReporter>(MakeReporter(type));
}
- void EnumerateTests(TVector<ITestRunner*>& tests) {
+ void EnumerateTests(TVector<ITestRunner*>& tests) {
for (size_t id : xrange(tests.size())) {
tests[id]->SequentialId = id;
}
@@ -453,11 +453,11 @@ template <>
EOutFormat FromStringImpl<EOutFormat>(const char* data, size_t len) {
const auto s = TStringBuf{data, len};
- if (TStringBuf("console") == s) {
+ if (TStringBuf("console") == s) {
return F_CONSOLE;
- } else if (TStringBuf("csv") == s) {
+ } else if (TStringBuf("csv") == s) {
return F_CSV;
- } else if (TStringBuf("json") == s) {
+ } else if (TStringBuf("json") == s) {
return F_JSON;
}
diff --git a/library/cpp/testing/benchmark/bench.h b/library/cpp/testing/benchmark/bench.h
index 21551ad0dd..d2fab33709 100644
--- a/library/cpp/testing/benchmark/bench.h
+++ b/library/cpp/testing/benchmark/bench.h
@@ -84,9 +84,9 @@ namespace NBench {
int Main(int argc, char** argv);
}
-#define Y_CPU_BENCHMARK(name, cnt) \
- namespace N_bench_##name { \
- static void Run(::NBench::NCpu::TParams&); \
- const ::NBench::NCpu::TRegistar benchmark(#name, &Run); \
- } \
+#define Y_CPU_BENCHMARK(name, cnt) \
+ namespace N_bench_##name { \
+ static void Run(::NBench::NCpu::TParams&); \
+ const ::NBench::NCpu::TRegistar benchmark(#name, &Run); \
+ } \
static void N_bench_##name::Run(::NBench::NCpu::TParams& cnt)
diff --git a/library/cpp/testing/common/env.h b/library/cpp/testing/common/env.h
index 7b89aa1bed..af1c807e3c 100644
--- a/library/cpp/testing/common/env.h
+++ b/library/cpp/testing/common/env.h
@@ -11,7 +11,7 @@
TString ArcadiaSourceRoot();
// @brief return full path for file or folder specified by known source location `where` and `path` which is relative to parent folder of `where`
-// for the instance: there is 2 files in folder test example_ut.cpp and example.data, so full path to test/example.data can be obtained
+// for the instance: there is 2 files in folder test example_ut.cpp and example.data, so full path to test/example.data can be obtained
// from example_ut.cpp as ArcadiaFromCurrentLocation(__SOURCE_FILE__, "example.data")
TString ArcadiaFromCurrentLocation(TStringBuf where, TStringBuf path);
diff --git a/library/cpp/testing/common/network.cpp b/library/cpp/testing/common/network.cpp
index 230c50ee6d..40965779fb 100644
--- a/library/cpp/testing/common/network.cpp
+++ b/library/cpp/testing/common/network.cpp
@@ -37,7 +37,7 @@ namespace {
{
}
- ~TPortGuard() override {
+ ~TPortGuard() override {
Y_VERIFY_SYSERROR(NFs::Remove(Lock_->GetName()));
}
diff --git a/library/cpp/testing/gmock_in_unittest/events.cpp b/library/cpp/testing/gmock_in_unittest/events.cpp
index dbd65b727d..5f3e21b23e 100644
--- a/library/cpp/testing/gmock_in_unittest/events.cpp
+++ b/library/cpp/testing/gmock_in_unittest/events.cpp
@@ -12,18 +12,18 @@ void TGMockTestEventListener::OnTestPartResult(const testing::TestPartResult& re
const TString summary = result.summary();
TStringBuilder msg;
if (result.file_name())
- msg << result.file_name() << TStringBuf(":");
+ msg << result.file_name() << TStringBuf(":");
if (result.line_number() != -1)
- msg << result.line_number() << TStringBuf(":");
+ msg << result.line_number() << TStringBuf(":");
if (summary) {
if (msg) {
- msg << TStringBuf("\n");
+ msg << TStringBuf("\n");
}
msg << summary;
}
if (message && summary != message) {
if (msg) {
- msg << TStringBuf("\n");
+ msg << TStringBuf("\n");
}
msg << message;
}
diff --git a/library/cpp/testing/unittest/registar.cpp b/library/cpp/testing/unittest/registar.cpp
index 3679b768ed..0fe5ef9700 100644
--- a/library/cpp/testing/unittest/registar.cpp
+++ b/library/cpp/testing/unittest/registar.cpp
@@ -364,7 +364,7 @@ void NUnitTest::TTestBase::AtEnd() {
Processor()->UnitStop(unit);
}
-void NUnitTest::TTestBase::Run(std::function<void()> f, const TString& suite, const char* name, const bool forceFork) {
+void NUnitTest::TTestBase::Run(std::function<void()> f, const TString& suite, const char* name, const bool forceFork) {
TestErrors_ = 0;
CurrentSubtest_ = name;
Processor()->Run(f, suite, name, forceFork);
diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h
index 44517a0092..76f48372bc 100644
--- a/library/cpp/testing/unittest/registar.h
+++ b/library/cpp/testing/unittest/registar.h
@@ -135,7 +135,7 @@ namespace NUnitTest {
// Should execute a test whitin suite?
virtual bool CheckAccessTest(TString /*suite*/, const char* /*name*/);
- virtual void Run(std::function<void()> f, const TString& /*suite*/, const char* /*name*/, bool /*forceFork*/);
+ virtual void Run(std::function<void()> f, const TString& /*suite*/, const char* /*name*/, bool /*forceFork*/);
// This process is forked for current test
virtual bool GetIsForked() const;
@@ -219,11 +219,11 @@ namespace NUnitTest {
void AtEnd();
- void Run(std::function<void()> f, const TString& suite, const char* name, bool forceFork);
+ void Run(std::function<void()> f, const TString& suite, const char* name, bool forceFork);
class TCleanUp {
public:
- explicit TCleanUp(TTestBase* base);
+ explicit TCleanUp(TTestBase* base);
~TCleanUp();
@@ -771,7 +771,7 @@ public: \
ITestSuiteProcessor* Processor() const noexcept;
private:
- explicit TTestFactory(ITestSuiteProcessor* processor);
+ explicit TTestFactory(ITestSuiteProcessor* processor);
~TTestFactory();
@@ -805,15 +805,15 @@ public: \
{
}
- inline TBaseTestCase(const char* name, std::function<void(TTestContext&)> body, bool forceFork)
+ inline TBaseTestCase(const char* name, std::function<void(TTestContext&)> body, bool forceFork)
: Name_(name)
- , Body_(std::move(body))
+ , Body_(std::move(body))
, ForceFork_(forceFork)
{
}
virtual ~TBaseTestCase() = default;
-
+
// Each test case is executed in 3 steps:
//
// 1. SetUp() (from fixture)
@@ -850,7 +850,7 @@ public: \
Parent->SetHandler();
}
- TInvokeGuard(TInvokeGuard&& guard) noexcept
+ TInvokeGuard(TInvokeGuard&& guard) noexcept
: Parent(guard.Parent)
{
guard.Parent = nullptr;
@@ -912,7 +912,7 @@ public: \
};
#define UNIT_TEST_SUITE_REGISTRATION(T) \
- static const ::NUnitTest::TTestBaseFactory<T> Y_GENERATE_UNIQUE_ID(UTREG_);
+ static const ::NUnitTest::TTestBaseFactory<T> Y_GENERATE_UNIQUE_ID(UTREG_);
#define Y_UNIT_TEST_SUITE_IMPL_F(N, T, F) \
namespace NTestSuite##N { \
@@ -936,9 +936,9 @@ public: \
return StaticName(); \
} \
\
- static void AddTest(const char* name, \
- const std::function<void(NUnitTest::TTestContext&)>& body, bool forceFork) \
- { \
+ static void AddTest(const char* name, \
+ const std::function<void(NUnitTest::TTestContext&)>& body, bool forceFork) \
+ { \
Tests().push_back([=]{ return MakeHolder<NUnitTest::TBaseTestCase>(name, body, forceFork); }); \
} \
\
@@ -1005,7 +1005,7 @@ public: \
TCurrentTest::AddTest(TTestCase##N::Create); \
} \
}; \
- static const TTestRegistration##N testRegistration##N;
+ static const TTestRegistration##N testRegistration##N;
#define Y_UNIT_TEST_IMPL(N, FF, F) \
Y_UNIT_TEST_IMPL_REGISTER(N, FF, F) \
diff --git a/library/cpp/testing/unittest/registar_ut.cpp b/library/cpp/testing/unittest/registar_ut.cpp
index 1f36d53abb..b06a3f7a68 100644
--- a/library/cpp/testing/unittest/registar_ut.cpp
+++ b/library/cpp/testing/unittest/registar_ut.cpp
@@ -43,9 +43,9 @@ Y_UNIT_TEST_SUITE(TUnitTestMacroTest) {
UNIT_ASSERT_TEST_FAILS(stringsEqual("q", TString("w")));
UNIT_ASSERT_TEST_FAILS(stringsEqual(TString("q"), "w"));
UNIT_ASSERT_TEST_FAILS(stringsEqual(TString("a"), TString("b")));
- UNIT_ASSERT_TEST_FAILS(stringsEqual(TString("a"), TStringBuf("b")));
- UNIT_ASSERT_TEST_FAILS(stringsEqual("a", TStringBuf("b")));
- UNIT_ASSERT_TEST_FAILS(stringsEqual(TStringBuf("a"), "b"));
+ UNIT_ASSERT_TEST_FAILS(stringsEqual(TString("a"), TStringBuf("b")));
+ UNIT_ASSERT_TEST_FAILS(stringsEqual("a", TStringBuf("b")));
+ UNIT_ASSERT_TEST_FAILS(stringsEqual(TStringBuf("a"), "b"));
TString empty;
TStringBuf emptyBuf;
@@ -86,19 +86,19 @@ Y_UNIT_TEST_SUITE(TUnitTestMacroTest) {
UNIT_ASSERT_TEST_FAILS(stringsUnequal("", ""));
UNIT_ASSERT_TEST_FAILS(stringsUnequal("42", TString("42")));
UNIT_ASSERT_TEST_FAILS(stringsUnequal(TString("4"), "4"));
- UNIT_ASSERT_TEST_FAILS(stringsUnequal("d", TStringBuf("d")));
- UNIT_ASSERT_TEST_FAILS(stringsUnequal(TStringBuf("yandex"), "yandex"));
- UNIT_ASSERT_TEST_FAILS(stringsUnequal(TStringBuf("index"), TString("index")));
- UNIT_ASSERT_TEST_FAILS(stringsUnequal(TString("diff"), TStringBuf("diff")));
+ UNIT_ASSERT_TEST_FAILS(stringsUnequal("d", TStringBuf("d")));
+ UNIT_ASSERT_TEST_FAILS(stringsUnequal(TStringBuf("yandex"), "yandex"));
+ UNIT_ASSERT_TEST_FAILS(stringsUnequal(TStringBuf("index"), TString("index")));
+ UNIT_ASSERT_TEST_FAILS(stringsUnequal(TString("diff"), TStringBuf("diff")));
UNIT_ASSERT_STRINGS_UNEQUAL("1", "2");
UNIT_ASSERT_STRINGS_UNEQUAL("", "3");
- UNIT_ASSERT_STRINGS_UNEQUAL("green", TStringBuf("red"));
- UNIT_ASSERT_STRINGS_UNEQUAL(TStringBuf("solomon"), "golovan");
+ UNIT_ASSERT_STRINGS_UNEQUAL("green", TStringBuf("red"));
+ UNIT_ASSERT_STRINGS_UNEQUAL(TStringBuf("solomon"), "golovan");
UNIT_ASSERT_STRINGS_UNEQUAL("d", TString("f"));
UNIT_ASSERT_STRINGS_UNEQUAL(TString("yandex"), "index");
- UNIT_ASSERT_STRINGS_UNEQUAL(TString("mail"), TStringBuf("yandex"));
- UNIT_ASSERT_STRINGS_UNEQUAL(TStringBuf("C++"), TString("python"));
+ UNIT_ASSERT_STRINGS_UNEQUAL(TString("mail"), TStringBuf("yandex"));
+ UNIT_ASSERT_STRINGS_UNEQUAL(TStringBuf("C++"), TString("python"));
}
Y_UNIT_TEST(Equal) {
@@ -352,7 +352,7 @@ Y_UNIT_TEST_SUITE(TUnitTestMacroTest) {
Y_UNIT_TEST(ExceptionContains) {
UNIT_ASSERT_TEST_FAILS(TTestException("abc").AssertExceptionContains<TTestException>("cba"));
- UNIT_ASSERT_TEST_FAILS(TTestException("abc").AssertExceptionContains<TTestException>(TStringBuf("cba")));
+ UNIT_ASSERT_TEST_FAILS(TTestException("abc").AssertExceptionContains<TTestException>(TStringBuf("cba")));
UNIT_ASSERT_TEST_FAILS(TTestException("abc").AssertExceptionContains<TTestException>(TString("cba")));
UNIT_ASSERT_TEST_FAILS(TTestException("abc").AssertExceptionContains<TTestException>(TStringBuilder() << "cba"));
diff --git a/library/cpp/testing/unittest/utmain.cpp b/library/cpp/testing/unittest/utmain.cpp
index 305bc6b40f..7f345ba7ca 100644
--- a/library/cpp/testing/unittest/utmain.cpp
+++ b/library/cpp/testing/unittest/utmain.cpp
@@ -151,12 +151,12 @@ private:
TStringBuilder msgs;
for (const TString& m : ErrorMessages) {
if (msgs) {
- msgs << TStringBuf("\n");
+ msgs << TStringBuf("\n");
}
msgs << m;
}
if (msgs) {
- msgs << TStringBuf("\n");
+ msgs << TStringBuf("\n");
}
TraceSubtestFinished(descr->test->unit->name.data(), descr->test->name, "fail", msgs, descr->Context);
ErrorMessages.clear();