proxygen
UnitTest.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2015-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <folly/Unit.h>
18 
20 
21 using namespace folly;
22 
23 TEST(Unit, operatorEq) {
24  EXPECT_TRUE(Unit{} == Unit{});
25 }
26 
27 TEST(Unit, operatorNe) {
28  EXPECT_FALSE(Unit{} != Unit{});
29 }
30 
31 TEST(Unit, liftInt) {
32  using lifted = lift_unit_t<int>;
33  using actual = std::is_same<int, lifted>;
35 }
36 
37 TEST(Unit, liftUnit) {
38  using lifted = lift_unit_t<Unit>;
39  using actual = std::is_same<Unit, lifted>;
41 }
42 
43 TEST(Unit, liftVoid) {
44  using lifted = lift_unit_t<void>;
45  using actual = std::is_same<Unit, lifted>;
47 }
48 
49 TEST(Unit, dropInt) {
50  using dropped = drop_unit_t<int>;
51  using actual = std::is_same<int, dropped>;
53 }
54 
55 TEST(Unit, dropUnit) {
56  using dropped = drop_unit_t<Unit>;
57  using actual = std::is_same<void, dropped>;
59 }
60 
61 TEST(Unit, dropVoid) {
62  using dropped = drop_unit_t<void>;
63  using actual = std::is_same<void, dropped>;
65 }
typename drop_unit< T >::type drop_unit_t
Definition: Unit.h:67
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
typename lift_unit< T >::type lift_unit_t
Definition: Unit.h:56
static const char *const value
Definition: Conv.cpp:50
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST(SequencedExecutor, CPUThreadPoolExecutor)