proxygen
SlidingWindowTest.cpp File Reference

Go to the source code of this file.

Classes

class  SlidingWindowTest
 

Functions

 TEST_F (SlidingWindowTest, Constructor)
 
 TEST_F (SlidingWindowTest, SlideZero)
 
 TEST_F (SlidingWindowTest, SlideLessThanFullAmount)
 
 TEST_F (SlidingWindowTest, SlideMoreThanFullAmount)
 

Function Documentation

TEST_F ( SlidingWindowTest  ,
Constructor   
)

Definition at line 35 of file SlidingWindowTest.cpp.

References EXPECT_EQ, and i.

35  {
36  auto buckets = slidingWindow->get();
37  EXPECT_EQ(60, buckets.size());
38 
39  for (size_t i = 0; i < 60; ++i) {
40  EXPECT_EQ(60 - i - 1, buckets[i]);
41  }
42 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TEST_F ( SlidingWindowTest  ,
SlideZero   
)

Definition at line 44 of file SlidingWindowTest.cpp.

References EXPECT_EQ, and i.

44  {
45  slidingWindow->slide(0);
46  auto buckets = slidingWindow->get();
47  EXPECT_EQ(60, buckets.size());
48 
49  for (size_t i = 0; i < 60; ++i) {
50  EXPECT_EQ(60 - i - 1, buckets[i]);
51  }
52 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TEST_F ( SlidingWindowTest  ,
SlideLessThanFullAmount   
)

Definition at line 54 of file SlidingWindowTest.cpp.

References EXPECT_EQ, and i.

54  {
55  slidingWindow->slide(5);
56  auto buckets = slidingWindow->get();
57  EXPECT_EQ(60, buckets.size());
58 
59  for (size_t i = 0; i < 60; ++i) {
60  EXPECT_EQ(65 - i - 1, buckets[i]);
61  }
62 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TEST_F ( SlidingWindowTest  ,
SlideMoreThanFullAmount   
)

Definition at line 64 of file SlidingWindowTest.cpp.

References EXPECT_EQ, and i.

64  {
65  slidingWindow->slide(60);
66  auto buckets = slidingWindow->get();
67  EXPECT_EQ(60, buckets.size());
68 
69  for (size_t i = 0; i < 60; ++i) {
70  EXPECT_EQ(120 - i - 1, buckets[i]);
71  }
72 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922