From e8980b2736752266e50d2b02de56f1ae6a040a3a Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 3 Oct 2018 17:53:20 +0300 Subject: [PATCH] Code has been updated for new versions of libraries #7 --- src/Router.cpp | 2 +- test/DataHolderTests.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Router.cpp b/src/Router.cpp index 26b6a77..670dcfe 100644 --- a/src/Router.cpp +++ b/src/Router.cpp @@ -28,7 +28,7 @@ proxygen::RequestHandler* RouterFactory::onRequest( // TODO: bad method handler return nullptr; } - const auto method = std::array{{maybe_method.get()}}; + const auto method = std::array{{maybe_method.value()}}; auto it = boost::find_if(routes_, [message, method](const Route& route) { return boost::contains(route.methods, method) diff --git a/test/DataHolderTests.cpp b/test/DataHolderTests.cpp index 2135e9f..40b0076 100644 --- a/test/DataHolderTests.cpp +++ b/test/DataHolderTests.cpp @@ -10,12 +10,12 @@ TEST(DataHolder, Empty) { auto future = holder.FetchThreadPosts(0); - EXPECT_THROW(future.get(), std::runtime_error); + EXPECT_THROW(std::move(future).get(), std::runtime_error); } { auto future = holder.FetchThreadPosts(42); - EXPECT_THROW(future.get(), std::runtime_error); + EXPECT_THROW(std::move(future).get(), std::runtime_error); } } @@ -25,7 +25,7 @@ TEST(DataHolder, ThreadAndPosts) { auto future = holder.CreateThread({0, 0, "hello world", "image.png"}); - const uint64_t thread_id = future.get(); + const uint64_t thread_id = std::move(future).get(); ASSERT_EQ(thread_id, 1); } { @@ -43,7 +43,7 @@ TEST(DataHolder, ThreadAndPosts) { auto future = holder.CreateThread({0, 0, "another thread", ""}); - const uint64_t thread_id = future.get(); + const uint64_t thread_id = std::move(future).get(); ASSERT_EQ(thread_id, 2); } { @@ -61,7 +61,7 @@ TEST(DataHolder, ThreadAndPosts) { auto future = holder.AddPostToThread({0, 1, "post1", ""}); - const uint64_t post_id = future.get(); + const uint64_t post_id = std::move(future).get(); ASSERT_EQ(post_id, 3); } { @@ -79,12 +79,12 @@ TEST(DataHolder, ThreadAndPosts) for (const int i : boost::irange(0, 1000)) { auto future = holder.AddPostToThread({0, 1, "post", "image"}); - const uint64_t post_id = future.get(); + const uint64_t post_id = std::move(future).get(); ASSERT_EQ(post_id, i + 4); } { auto future = holder.AddPostToThread({0, 2, "post2", "image2"}); - const uint64_t post_id = future.get(); + const uint64_t post_id = std::move(future).get(); ASSERT_EQ(post_id, 1004); } {