From 7ba4c2ba02694c718e99150cf450ae69912828b1 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Thu, 5 Oct 2017 08:55:15 +0300 Subject: [PATCH] Review fixes. --- .../routing_common_tests/transit_test.cpp | 2 +- routing_common/transit_serdes.hpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/routing_common/routing_common_tests/transit_test.cpp b/routing_common/routing_common_tests/transit_test.cpp index 179631211a..ef5363588d 100644 --- a/routing_common/routing_common_tests/transit_test.cpp +++ b/routing_common/routing_common_tests/transit_test.cpp @@ -30,7 +30,7 @@ void TestSerialization(Obj const & obj) Deserializer> deserializer(src); deserializedObj.Visit(deserializer); - TEST(obj.IsEqualForTesting(deserializedObj), (obj, "is not equal to", deserializedObj)); + TEST(obj.IsEqualForTesting(deserializedObj), (obj, deserializedObj)); } UNIT_TEST(Transit_HeaderSerialization) diff --git a/routing_common/transit_serdes.hpp b/routing_common/transit_serdes.hpp index fdc49ed4d2..59040f1929 100644 --- a/routing_common/transit_serdes.hpp +++ b/routing_common/transit_serdes.hpp @@ -26,10 +26,10 @@ namespace routing { namespace transit { -// Note. For the time being double at transit section is used only for saving weight of edges (in seconds). +// Note. For the time being double in transit section is used only for saving weight of edges (in seconds). // Let us assume that it takes less than 10^7 seconds (115 days) to get from one station to a neighboring one. -double constexpr kMinDoubleAtTransit = kInvalidWeight; -double constexpr kMaxDoubleAtTransit = 10000000.0; +double constexpr kMinDoubleAtTransitSection = kInvalidWeight; +double constexpr kMaxDoubleAtTransitSection = 10000000.0; uint32_t constexpr kDoubleBits = 32; template @@ -47,9 +47,9 @@ public: void operator()(double d, char const * name = nullptr) { - CHECK_GREATER_OR_EQUAL(d, kMinDoubleAtTransit, ()); - CHECK_LESS_OR_EQUAL(d, kMaxDoubleAtTransit, ()); - (*this)(DoubleToUint32(d, kMinDoubleAtTransit, kMaxDoubleAtTransit, kDoubleBits), name); + CHECK_GREATER_OR_EQUAL(d, kMinDoubleAtTransitSection, ()); + CHECK_LESS_OR_EQUAL(d, kMaxDoubleAtTransitSection, ()); + (*this)(DoubleToUint32(d, kMinDoubleAtTransitSection, kMaxDoubleAtTransitSection, kDoubleBits), name); } void operator()(std::string const & s, char const * /* name */ = nullptr) @@ -100,7 +100,7 @@ public: { uint32_t ui; (*this)(ui, name); - d = Uint32ToDouble(ui, kMinDoubleAtTransit, kMaxDoubleAtTransit, kDoubleBits); + d = Uint32ToDouble(ui, kMinDoubleAtTransitSection, kMaxDoubleAtTransitSection, kDoubleBits); } void operator()(std::string & s, char const * /* name */ = nullptr)