proxygen
ConversionOperatorTest.cpp File Reference
#include <folly/futures/Future.h>
#include <folly/portability/GTest.h>
#include <thread>

Go to the source code of this file.

Functions

 TEST (ConverstionOperator, DirectInitialization)
 
 TEST (ConverstionOperator, StaticCast)
 

Function Documentation

TEST ( ConverstionOperator  ,
DirectInitialization   
)

Definition at line 42 of file ConversionOperatorTest.cpp.

References EXPECT_EQ, and folly::gen::move.

42  {
43  auto future = makeFuture<Widget>(23);
44  EXPECT_EQ(future.value().v_, 23);
45  Future<int> secondFuture{std::move(future)};
46  EXPECT_EQ(secondFuture.value(), 23);
47 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
TEST ( ConverstionOperator  ,
StaticCast   
)

Definition at line 49 of file ConversionOperatorTest.cpp.

References EXPECT_EQ, folly::gen::move, and folly::value().

49  {
50  auto future = makeFuture<Widget>(23);
51  EXPECT_EQ(future.value().v_, 23);
52  EXPECT_EQ(static_cast<Future<int>>(std::move(future)).value(), 23);
53 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
static const char *const value
Definition: Conv.cpp:50