diff options
| author | levysotsky <[email protected]> | 2022-02-10 16:47:29 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:47:29 +0300 | 
| commit | 57f874ffc2a75047c1c4fea7a9fc86cb0f56ed50 (patch) | |
| tree | ba6454f353979bb4bafaf230cafdf3e02ea120b2 /library/cpp/testing/unittest | |
| parent | 23d4769f0fea97cfb1028710e50f2b5ecd0ac2c0 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/testing/unittest')
| -rw-r--r-- | library/cpp/testing/unittest/registar.h | 38 | 
1 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h index 44517a00924..633be5ced9f 100644 --- a/library/cpp/testing/unittest/registar.h +++ b/library/cpp/testing/unittest/registar.h @@ -363,12 +363,12 @@ public:                       \  #define UNIT_FAIL_IMPL(R, M)                                                                                                                     \      do {                                                                                                                                         \ -        ::NUnitTest::NPrivate::RaiseError(R, ::TStringBuilder() << R << " at " << __LOCATION__ << ", " << __PRETTY_FUNCTION__ << ": " << M, true); \ +        ::NUnitTest::NPrivate::RaiseError(R, ::TStringBuilder() << R << " at " << __LOCATION__ << ", " << __PRETTY_FUNCTION__ << ": " << M, true); \       } while (false)  #define UNIT_FAIL_NONFATAL_IMPL(R, M)                                                                                                             \      do {                                                                                                                                          \ -        ::NUnitTest::NPrivate::RaiseError(R, ::TStringBuilder() << R << " at " << __LOCATION__ << ", " << __PRETTY_FUNCTION__ << ": " << M, false); \ +        ::NUnitTest::NPrivate::RaiseError(R, ::TStringBuilder() << R << " at " << __LOCATION__ << ", " << __PRETTY_FUNCTION__ << ": " << M, false); \       } while (false)  #define UNIT_FAIL(M) UNIT_FAIL_IMPL("forced failure", M) @@ -378,7 +378,7 @@ public:                       \  #define UNIT_ASSERT_TYPES_EQUAL(A, B)                                                                                                                                  \      do {                                                                                                                                                               \          if (!std::is_same<A, B>::value) {                                                                                                                              \ -            UNIT_FAIL_IMPL("types equal assertion failed", (::TStringBuilder() << #A << " (" << TypeName<A>() << ") != " << #B << " (" << TypeName<B>() << ")").data()); \ +            UNIT_FAIL_IMPL("types equal assertion failed", (::TStringBuilder() << #A << " (" << TypeName<A>() << ") != " << #B << " (" << TypeName<B>() << ")").data()); \           }                                                                                                                                                              \      } while (false) @@ -391,7 +391,7 @@ public:                       \              const auto _es = ToString((long double)(E));                                                       \              const auto _as = ToString((long double)(A));                                                       \              const auto _ds = ToString((long double)(D));                                                       \ -            auto&& failMsg = Sprintf("std::abs(%s - %s) > %s %s", _es.data(), _as.data(), _ds.data(), (::TStringBuilder() << C).data()); \ +            auto&& failMsg = Sprintf("std::abs(%s - %s) > %s %s", _es.data(), _as.data(), _ds.data(), (::TStringBuilder() << C).data()); \               UNIT_FAIL_IMPL("assertion failure", failMsg);                                                      \          }                                                                                                      \      } while (false) @@ -405,19 +405,19 @@ public:                       \          const auto _dd = (D);                                                                                                          \          if (std::isnan((long double)_ed) && !std::isnan((long double)_ad)) {                                                           \              const auto _as = ToString((long double)_ad);                                                                               \ -            auto&& failMsg = Sprintf("expected NaN, got %s %s", _as.data(), (::TStringBuilder() << C).data());                           \ +            auto&& failMsg = Sprintf("expected NaN, got %s %s", _as.data(), (::TStringBuilder() << C).data());                           \               UNIT_FAIL_IMPL("assertion failure", failMsg);                                                                              \          }                                                                                                                              \          if (!std::isnan((long double)_ed) && std::isnan((long double)_ad)) {                                                           \              const auto _es = ToString((long double)_ed);                                                                               \ -            auto&& failMsg = Sprintf("expected %s, got NaN %s", _es.data(), (::TStringBuilder() << C).data());                           \ +            auto&& failMsg = Sprintf("expected %s, got NaN %s", _es.data(), (::TStringBuilder() << C).data());                           \               UNIT_FAIL_IMPL("assertion failure", failMsg);                                                                              \          }                                                                                                                              \          if (std::abs((_ed) - (_ad)) > (_dd)) {                                                                                         \              const auto _es = ToString((long double)_ed);                                                                               \              const auto _as = ToString((long double)_ad);                                                                               \              const auto _ds = ToString((long double)_dd);                                                                               \ -            auto&& failMsg = Sprintf("std::abs(%s - %s) > %s %s", _es.data(), _as.data(), _ds.data(), (::TStringBuilder() << C).data()); \ +            auto&& failMsg = Sprintf("std::abs(%s - %s) > %s %s", _es.data(), _as.data(), _ds.data(), (::TStringBuilder() << C).data()); \               UNIT_FAIL_IMPL("assertion failure", failMsg);                                                                              \          }                                                                                                                              \      } while (false) @@ -430,7 +430,7 @@ public:                       \          const TString _a(A);                                                                                 \          const TString _b(B);                                                                                 \          if (_a != _b) {                                                                                      \ -            auto&& failMsg = Sprintf("%s != %s %s", ToString(_a).data(), ToString(_b).data(), (::TStringBuilder() << C).data()); \ +            auto&& failMsg = Sprintf("%s != %s %s", ToString(_a).data(), ToString(_b).data(), (::TStringBuilder() << C).data()); \               UNIT_FAIL_IMPL("strings equal assertion failed", failMsg);                                       \          }                                                                                                    \      } while (false) @@ -442,7 +442,7 @@ public:                       \          const TString _a(A);                                                                                                    \          const TString _b(B);                                                                                                    \          if (!_a.Contains(_b)) {                                                                                                 \ -            auto&& msg = Sprintf("\"%s\" does not contain \"%s\", %s", ToString(_a).data(), ToString(_b).data(), (::TStringBuilder() << C).data()); \ +            auto&& msg = Sprintf("\"%s\" does not contain \"%s\", %s", ToString(_a).data(), ToString(_b).data(), (::TStringBuilder() << C).data()); \               UNIT_FAIL_IMPL("strings contains assertion failed", msg);                                                           \          }                                                                                                                       \      } while (false) @@ -464,7 +464,7 @@ public:                       \          const TString _a(A);                                                                             \          const TString _b(B);                                                                             \          if (_a == _b) {                                                                                  \ -            auto&& msg = Sprintf("%s == %s %s", ToString(_a).data(), ToString(_b).data(), (::TStringBuilder() << C).data()); \ +            auto&& msg = Sprintf("%s == %s %s", ToString(_a).data(), ToString(_b).data(), (::TStringBuilder() << C).data()); \               UNIT_FAIL_IMPL("strings unequal assertion failed", msg);                                     \          }                                                                                                \      } while (false) @@ -475,7 +475,7 @@ public:                       \  #define UNIT_ASSERT_C(A, C)                                                                             \      do {                                                                                                \          if (!(A)) {                                                                                     \ -            UNIT_FAIL_IMPL("assertion failed", Sprintf("(%s) %s", #A, (::TStringBuilder() << C).data())); \ +            UNIT_FAIL_IMPL("assertion failed", Sprintf("(%s) %s", #A, (::TStringBuilder() << C).data())); \           }                                                                                               \      } while (false) @@ -485,7 +485,7 @@ public:                       \  #define UNIT_ASSERT_EQUAL_C(A, B, C)                                                                                  \      do {                                                                                                              \          if (!((A) == (B))) {                                                                                          \ -            UNIT_FAIL_IMPL("equal assertion failed", Sprintf("%s == %s %s", #A, #B, (::TStringBuilder() << C).data())); \ +            UNIT_FAIL_IMPL("equal assertion failed", Sprintf("%s == %s %s", #A, #B, (::TStringBuilder() << C).data())); \           }                                                                                                             \      } while (false) @@ -494,7 +494,7 @@ public:                       \  #define UNIT_ASSERT_UNEQUAL_C(A, B, C)                                                                                 \      do {                                                                                                               \          if ((A) == (B)) {                                                                                              \ -            UNIT_FAIL_IMPL("unequal assertion failed", Sprintf("%s != %s %s", #A, #B, (::TStringBuilder() << C).data()));\ +            UNIT_FAIL_IMPL("unequal assertion failed", Sprintf("%s != %s %s", #A, #B, (::TStringBuilder() << C).data()));\           }                                                                                                              \      } while (false) @@ -503,7 +503,7 @@ public:                       \  #define UNIT_ASSERT_LT_C(A, B, C)                                                                                        \      do {                                                                                                                 \          if (!((A) < (B))) {                                                                                              \ -            UNIT_FAIL_IMPL("less-than assertion failed", Sprintf("%s < %s %s", #A, #B, (::TStringBuilder() << C).data())); \ +            UNIT_FAIL_IMPL("less-than assertion failed", Sprintf("%s < %s %s", #A, #B, (::TStringBuilder() << C).data())); \           }                                                                                                                \      } while (false) @@ -512,7 +512,7 @@ public:                       \  #define UNIT_ASSERT_LE_C(A, B, C)                                                                                             \      do {                                                                                                                      \          if (!((A) <= (B))) {                                                                                                  \ -            UNIT_FAIL_IMPL("less-or-equal assertion failed", Sprintf("%s <= %s %s", #A, #B, (::TStringBuilder() << C).data())); \ +            UNIT_FAIL_IMPL("less-or-equal assertion failed", Sprintf("%s <= %s %s", #A, #B, (::TStringBuilder() << C).data())); \           }                                                                                                                     \      } while (false) @@ -521,7 +521,7 @@ public:                       \  #define UNIT_ASSERT_GT_C(A, B, C)                                                                                           \      do {                                                                                                                    \          if (!((A) > (B))) {                                                                                                 \ -            UNIT_FAIL_IMPL("greater-than assertion failed", Sprintf("%s > %s %s", #A, #B, (::TStringBuilder() << C).data())); \ +            UNIT_FAIL_IMPL("greater-than assertion failed", Sprintf("%s > %s %s", #A, #B, (::TStringBuilder() << C).data())); \           }                                                                                                                   \      } while (false) @@ -530,7 +530,7 @@ public:                       \  #define UNIT_ASSERT_GE_C(A, B, C)                                                                        \      do { \          if (!((A) >= (B))) {                                                                                    \ -            UNIT_FAIL_IMPL("greater-or-equal assertion failed", Sprintf("%s >= %s %s", #A, #B, (::TStringBuilder() << C).data())); \ +            UNIT_FAIL_IMPL("greater-or-equal assertion failed", Sprintf("%s >= %s %s", #A, #B, (::TStringBuilder() << C).data())); \           } \      } while (false) @@ -651,7 +651,7 @@ public:                       \          } catch (const ::NUnitTest::TAssertException&) {                                                                                                                 \              throw;                                                                                                                                                       \          } catch (...) {                                                                                                                                                  \ -            UNIT_FAIL_IMPL("exception-free assertion failed", Sprintf("%s throws %s\nException message: %s", #A, (::TStringBuilder() << C).data(), CurrentExceptionMessage().data())); \ +            UNIT_FAIL_IMPL("exception-free assertion failed", Sprintf("%s throws %s\nException message: %s", #A, (::TStringBuilder() << C).data(), CurrentExceptionMessage().data())); \           }                                                                                                                                                                \      } while (false) @@ -712,7 +712,7 @@ public:                       \          TString _bsInd;                                                                                                                \          bool _usePlainDiff;                                                                                                            \          if (!::NUnitTest::NPrivate::CompareAndMakeStrings(A, B, _as, _asInd, _bs, _bsInd, _usePlainDiff, EQflag)) {                    \ -            auto&& failMsg = Sprintf("(%s %s %s) failed: (%s %s %s) %s", #A, EQstr, #B, _as.data(), NEQstr, _bs.data(), (::TStringBuilder() << C).data()); \ +            auto&& failMsg = Sprintf("(%s %s %s) failed: (%s %s %s) %s", #A, EQstr, #B, _as.data(), NEQstr, _bs.data(), (::TStringBuilder() << C).data()); \               if (EQflag && !_usePlainDiff) {                                                                                            \                  failMsg += ", with diff:\n";                                                                                           \                  failMsg += ::NUnitTest::ColoredDiff(_asInd, _bsInd);                                                                   \  | 
