diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /library/cpp/yson/node | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yson/node')
-rw-r--r-- | library/cpp/yson/node/node.h | 4 | ||||
-rw-r--r-- | library/cpp/yson/node/node_ut.cpp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/library/cpp/yson/node/node.h b/library/cpp/yson/node/node.h index 5f90f95df0..82b956272f 100644 --- a/library/cpp/yson/node/node.h +++ b/library/cpp/yson/node/node.h @@ -6,7 +6,7 @@ #include <util/generic/variant.h> #include <util/generic/vector.h> #include <util/generic/yexception.h> -#include <util/generic/ylimits.h> +#include <util/generic/ylimits.h> #include <util/string/cast.h> #include <cmath> @@ -324,7 +324,7 @@ inline T TNode::ConvertTo() const { case NYT::TNode::Uint64: return IntCast<T>(); case NYT::TNode::Double: - if (AsDouble() < Min<T>() || AsDouble() > MaxFloor<T>() || !std::isfinite(AsDouble())) { + if (AsDouble() < Min<T>() || AsDouble() > MaxFloor<T>() || !std::isfinite(AsDouble())) { ythrow TTypeError() << AsDouble() << " can't be converted to " << TypeName<T>(); } return AsDouble(); diff --git a/library/cpp/yson/node/node_ut.cpp b/library/cpp/yson/node/node_ut.cpp index 448e99f575..0d385b54f8 100644 --- a/library/cpp/yson/node/node_ut.cpp +++ b/library/cpp/yson/node/node_ut.cpp @@ -345,14 +345,14 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { UNIT_ASSERT_EXCEPTION(TNode(-5.3).ConvertTo<ui8>(), TNode::TTypeError); UNIT_ASSERT_EXCEPTION(TNode(-5.3).ConvertTo<ui64>(), TNode::TTypeError); - UNIT_ASSERT_VALUES_EQUAL(TNode(127.0).ConvertTo<i8>(), 127); - UNIT_ASSERT_EXCEPTION(TNode(128.0).ConvertTo<i8>(), TNode::TTypeError); - UNIT_ASSERT_VALUES_EQUAL(TNode(255.0).ConvertTo<ui8>(), 255); + UNIT_ASSERT_VALUES_EQUAL(TNode(127.0).ConvertTo<i8>(), 127); + UNIT_ASSERT_EXCEPTION(TNode(128.0).ConvertTo<i8>(), TNode::TTypeError); + UNIT_ASSERT_VALUES_EQUAL(TNode(255.0).ConvertTo<ui8>(), 255); UNIT_ASSERT_EXCEPTION(TNode(256.0).ConvertTo<ui8>(), TNode::TTypeError); UNIT_ASSERT_EXCEPTION(TNode(1e100).ConvertTo<i64>(), TNode::TTypeError); UNIT_ASSERT_EXCEPTION(TNode(1e100).ConvertTo<ui64>(), TNode::TTypeError); { - double v = 1ull << 63; + double v = 1ull << 63; TNode node = v; UNIT_ASSERT(node.IsDouble()); UNIT_ASSERT_EXCEPTION(node.ConvertTo<i64>(), TNode::TTypeError); |