Skip to content

Commit

Permalink
Code has been updated for new versions of libraries #7
Browse files Browse the repository at this point in the history
  • Loading branch information
kremius committed Oct 3, 2018
1 parent dc1b092 commit e8980b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ proxygen::RequestHandler* RouterFactory::onRequest(
// TODO: bad method handler
return nullptr;
}
const auto method = std::array<proxygen::HTTPMethod, 1>{{maybe_method.get()}};
const auto method = std::array<proxygen::HTTPMethod, 1>{{maybe_method.value()}};

auto it = boost::find_if(routes_, [message, method](const Route& route) {
return boost::contains(route.methods, method)
Expand Down
14 changes: 7 additions & 7 deletions test/DataHolderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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);
}
{
Expand All @@ -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);
}
{
Expand All @@ -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);
}
{
Expand All @@ -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);
}
{
Expand Down

0 comments on commit e8980b2

Please sign in to comment.