diff options
author | komels <komels@yandex-team.ru> | 2022-04-15 16:53:39 +0300 |
---|---|---|
committer | komels <komels@yandex-team.ru> | 2022-04-15 16:53:39 +0300 |
commit | 703a2fb6e100d202d1c7fcd052d73bd5affef408 (patch) | |
tree | 22b7320c06bb04d86dbf7b9af9ae44281331cd15 /library/cpp/openssl/big_integer/ut/big_integer_ut.cpp | |
parent | 3375bbfda1e2afb03aa2072bf5f2f2c3a26026e8 (diff) | |
download | ydb-703a2fb6e100d202d1c7fcd052d73bd5affef408.tar.gz |
Move 'kikimr/yndx'-depending tests out of ydb/core
ref:0a380e13308d579e0545a76924330d1ca5129c43
Diffstat (limited to 'library/cpp/openssl/big_integer/ut/big_integer_ut.cpp')
-rw-r--r-- | library/cpp/openssl/big_integer/ut/big_integer_ut.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/library/cpp/openssl/big_integer/ut/big_integer_ut.cpp b/library/cpp/openssl/big_integer/ut/big_integer_ut.cpp deleted file mode 100644 index 8a0050f531..0000000000 --- a/library/cpp/openssl/big_integer/ut/big_integer_ut.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "big_integer.h" - -#include <library/cpp/testing/unittest/registar.h> - -#include <util/system/byteorder.h> -#include <util/stream/str.h> - -Y_UNIT_TEST_SUITE(BigInteger) { - using NOpenSsl::TBigInteger; - - Y_UNIT_TEST(Initialization) { - constexpr ui64 testVal = 12345678900; - const auto fromULong = TBigInteger::FromULong(testVal); - - const ui64 testArea = HostToInet(testVal); // transform to big-endian - const auto fromRegion = TBigInteger::FromRegion(&testArea, sizeof(testArea)); - UNIT_ASSERT(fromULong == fromRegion); - UNIT_ASSERT_VALUES_EQUAL(fromULong, fromRegion); - - const auto fromULongOther = TBigInteger::FromULong(22345678900); - UNIT_ASSERT(fromULong != fromULongOther); - } - - Y_UNIT_TEST(Decimal) { - UNIT_ASSERT_VALUES_EQUAL(TBigInteger::FromULong(123456789).ToDecimalString(), "123456789"); - } - - Y_UNIT_TEST(Region) { - const auto v1 = TBigInteger::FromULong(1234567890); - char buf[1024]; - const auto v2 = TBigInteger::FromRegion(buf, v1.ToRegion(buf)); - - UNIT_ASSERT_VALUES_EQUAL(v1, v2); - } - - Y_UNIT_TEST(Output) { - TStringStream ss; - - ss << TBigInteger::FromULong(123456789); - - UNIT_ASSERT_VALUES_EQUAL(ss.Str(), "123456789"); - } -} |