proxygen
OrderingTest.cpp File Reference

Go to the source code of this file.

Classes

struct  OddCompare< T >
 
class  OrderingTest
 

Functions

 TEST_F (OrderingTest, ordering)
 
 TEST_F (OrderingTest, to_ordering)
 
 TEST_F (OrderingTest, compare_equal_to)
 
 TEST_F (OrderingTest, compare_not_equal_to)
 
 TEST_F (OrderingTest, compare_less)
 
 TEST_F (OrderingTest, compare_less_equal)
 
 TEST_F (OrderingTest, compare_greater)
 
 TEST_F (OrderingTest, compare_greater_equal)
 

Function Documentation

TEST_F ( OrderingTest  ,
ordering   
)

Definition at line 32 of file OrderingTest.cpp.

References folly::eq, EXPECT_EQ, folly::gt, and folly::lt.

32  {
33  EXPECT_EQ(-1, int(ordering::lt));
34  EXPECT_EQ(0, int(ordering::eq));
35  EXPECT_EQ(+1, int(ordering::gt));
36 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TEST_F ( OrderingTest  ,
to_ordering   
)

Definition at line 38 of file OrderingTest.cpp.

References folly::eq, EXPECT_EQ, folly::gt, folly::lt, and folly::to_ordering().

38  {
39  EXPECT_EQ(ordering::lt, to_ordering(int(ordering::lt)));
40  EXPECT_EQ(ordering::eq, to_ordering(int(ordering::eq)));
41  EXPECT_EQ(ordering::gt, to_ordering(int(ordering::gt)));
42 
43  EXPECT_EQ(ordering::lt, to_ordering(-22));
44  EXPECT_EQ(ordering::eq, to_ordering(0));
45  EXPECT_EQ(ordering::gt, to_ordering(+44));
46 }
constexpr ordering to_ordering(T c)
Definition: Ordering.h:24
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TEST_F ( OrderingTest  ,
compare_equal_to   
)

Definition at line 48 of file OrderingTest.cpp.

References EXPECT_FALSE, and EXPECT_TRUE.

48  {
50  EXPECT_FALSE(op(3, 4));
51  EXPECT_TRUE(op(3, 3));
52  EXPECT_FALSE(op(4, 3));
53 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST_F ( OrderingTest  ,
compare_not_equal_to   
)

Definition at line 55 of file OrderingTest.cpp.

References EXPECT_FALSE, and EXPECT_TRUE.

55  {
57  EXPECT_TRUE(op(3, 4));
58  EXPECT_FALSE(op(3, 3));
59  EXPECT_TRUE(op(4, 3));
60 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST_F ( OrderingTest  ,
compare_less   
)

Definition at line 62 of file OrderingTest.cpp.

References EXPECT_FALSE, and EXPECT_TRUE.

62  {
64  EXPECT_FALSE(op(3, 4));
65  EXPECT_FALSE(op(3, 3));
66  EXPECT_TRUE(op(4, 3));
67 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST_F ( OrderingTest  ,
compare_less_equal   
)

Definition at line 69 of file OrderingTest.cpp.

References EXPECT_FALSE, and EXPECT_TRUE.

69  {
71  EXPECT_FALSE(op(3, 4));
72  EXPECT_TRUE(op(3, 3));
73  EXPECT_TRUE(op(4, 3));
74 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST_F ( OrderingTest  ,
compare_greater   
)

Definition at line 76 of file OrderingTest.cpp.

References EXPECT_FALSE, and EXPECT_TRUE.

76  {
78  EXPECT_TRUE(op(3, 4));
79  EXPECT_FALSE(op(3, 3));
80  EXPECT_FALSE(op(4, 3));
81 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST_F ( OrderingTest  ,
compare_greater_equal   
)

Definition at line 83 of file OrderingTest.cpp.

References EXPECT_FALSE, and EXPECT_TRUE.

83  {
85  EXPECT_TRUE(op(3, 4));
86  EXPECT_TRUE(op(3, 3));
87  EXPECT_FALSE(op(4, 3));
88 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862