diff options
author | dancingqueue <dancingqueue@yandex-team.ru> | 2022-02-10 16:50:06 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:06 +0300 |
commit | 97ccada5638c88fa727d68a9ee849a9a768a54d9 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/generic/va_args_ut.cpp | |
parent | 3c712c7c680d2b93fae03957df9561bd08eb5b7c (diff) | |
download | ydb-97ccada5638c88fa727d68a9ee849a9a768a54d9.tar.gz |
Restoring authorship annotation for <dancingqueue@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/va_args_ut.cpp')
-rw-r--r-- | util/generic/va_args_ut.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/util/generic/va_args_ut.cpp b/util/generic/va_args_ut.cpp index f3264bf1f3f..a9c96a0f55a 100644 --- a/util/generic/va_args_ut.cpp +++ b/util/generic/va_args_ut.cpp @@ -16,30 +16,30 @@ Y_UNIT_TEST_SUITE(TMacroVarargMapTest) { #undef ADD #undef ID } - - Y_UNIT_TEST(TestMapArgsN) { -#define MAP_ARG(INDEX, X) Y_STRINGIZE(X) -#define MAP_INDEX(INDEX, X) Y_STRINGIZE(INDEX) - static const char COMBINED_ARGS[] = Y_MAP_ARGS_N(MAP_ARG, 1, 2, 3); - UNIT_ASSERT_STRINGS_EQUAL(COMBINED_ARGS, "123"); - static const char COMBINED_INDEXES[] = Y_MAP_ARGS_N(MAP_INDEX, 1, 2, 3); - UNIT_ASSERT_STRINGS_EQUAL(COMBINED_INDEXES, "321"); -#undef MAP_INDEX -#undef MAP_ARG - } - - Y_UNIT_TEST(TestMapArgsWithLastN) { -#define ADD_ARG(INDEX, X) X + -#define ID_ARG(INDEX, X) X -#define MAP_INDEX(INDEX, X) Y_STRINGIZE(INDEX) - static const int SUM = Y_MAP_ARGS_WITH_LAST_N(ADD_ARG, ID_ARG, 1, 2, 3, 4 + 5); - UNIT_ASSERT_VALUES_EQUAL(SUM, 1 + 2 + 3 + 4 + 5); - static const char COMBINED_INDEXES[] = Y_MAP_ARGS_WITH_LAST_N(MAP_INDEX, MAP_INDEX, 1, 2, 3, 4 + 5); - UNIT_ASSERT_STRINGS_EQUAL(COMBINED_INDEXES, "4321"); -#undef MAP_INDEX -#undef ADD_ARG -#undef ID_ARG - } + + Y_UNIT_TEST(TestMapArgsN) { +#define MAP_ARG(INDEX, X) Y_STRINGIZE(X) +#define MAP_INDEX(INDEX, X) Y_STRINGIZE(INDEX) + static const char COMBINED_ARGS[] = Y_MAP_ARGS_N(MAP_ARG, 1, 2, 3); + UNIT_ASSERT_STRINGS_EQUAL(COMBINED_ARGS, "123"); + static const char COMBINED_INDEXES[] = Y_MAP_ARGS_N(MAP_INDEX, 1, 2, 3); + UNIT_ASSERT_STRINGS_EQUAL(COMBINED_INDEXES, "321"); +#undef MAP_INDEX +#undef MAP_ARG + } + + Y_UNIT_TEST(TestMapArgsWithLastN) { +#define ADD_ARG(INDEX, X) X + +#define ID_ARG(INDEX, X) X +#define MAP_INDEX(INDEX, X) Y_STRINGIZE(INDEX) + static const int SUM = Y_MAP_ARGS_WITH_LAST_N(ADD_ARG, ID_ARG, 1, 2, 3, 4 + 5); + UNIT_ASSERT_VALUES_EQUAL(SUM, 1 + 2 + 3 + 4 + 5); + static const char COMBINED_INDEXES[] = Y_MAP_ARGS_WITH_LAST_N(MAP_INDEX, MAP_INDEX, 1, 2, 3, 4 + 5); + UNIT_ASSERT_STRINGS_EQUAL(COMBINED_INDEXES, "4321"); +#undef MAP_INDEX +#undef ADD_ARG +#undef ID_ARG + } } Y_UNIT_TEST_SUITE(TestVaArgs) { |