Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArsentiy Milchakov <milcars@mapswithme.com>2018-08-01 14:17:51 +0300
committerSlava <slovaricheg@gmail.com>2018-08-01 20:01:44 +0300
commitc0e546812efed884e1186db377b2307017bc95f7 (patch)
tree197b766984a56ffdfc4afede06c2473470324814 /partners_api
parentebe4e348a50432d1680add098f02dc0d727d4d81 (diff)
[partners_api] tests fix
Diffstat (limited to 'partners_api')
-rw-r--r--partners_api/maxim_api.cpp2
-rw-r--r--partners_api/partners_api_tests/booking_tests.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/partners_api/maxim_api.cpp b/partners_api/maxim_api.cpp
index dfc046db43..dc9c426d13 100644
--- a/partners_api/maxim_api.cpp
+++ b/partners_api/maxim_api.cpp
@@ -129,7 +129,7 @@ void MakeFromJson(std::string const & src, std::vector<taxi::Product> & products
return;
auto const price = json_object_get(root.get(), "Price");
- if (price == nullptr)
+ if (price == nullptr || json_is_null(price))
return;
double p = 0.0;
diff --git a/partners_api/partners_api_tests/booking_tests.cpp b/partners_api/partners_api_tests/booking_tests.cpp
index 72c10f39aa..1bf8bfc7dc 100644
--- a/partners_api/partners_api_tests/booking_tests.cpp
+++ b/partners_api/partners_api_tests/booking_tests.cpp
@@ -65,7 +65,8 @@ UNIT_CLASS_TEST(AsyncGuiThreadBooking, Booking_GetBlockAvailability)
auto price = BlockInfo::kIncorrectPrice;
string currency;
string hotelId;
- api.GetBlockAvailability(std::move(params), [&hotelId, &price, &currency](std::string const & id,
+ auto copy = params;
+ api.GetBlockAvailability(std::move(copy), [&hotelId, &price, &currency](std::string const & id,
Blocks const & blocks)
{
hotelId = id;
@@ -88,7 +89,8 @@ UNIT_CLASS_TEST(AsyncGuiThreadBooking, Booking_GetBlockAvailability)
double price = std::numeric_limits<double>::max();
string currency;
string hotelId;
- api.GetBlockAvailability(std::move(params), [&hotelId, &price, &currency](std::string const & id,
+ auto copy = params;
+ api.GetBlockAvailability(std::move(copy), [&hotelId, &price, &currency](std::string const & id,
Blocks const & blocks)
{
hotelId = id;