proxygen
CountersTest.cpp File Reference

Go to the source code of this file.

Functions

 TEST (FollyCountersTest, HasImplementation)
 
 TEST (FollyCountersTest, SumWorks)
 
 TEST (FollyCountersTest, AvgWorks)
 

Function Documentation

TEST ( FollyCountersTest  ,
HasImplementation   
)

Definition at line 30 of file CountersTest.cpp.

References counter, EXPECT_FALSE, and folly::none.

30  {
31  CompressionCounter counter(
32  kCodecType, kCodecName, folly::none, kKey, CompressionCounterType::SUM);
33  EXPECT_FALSE(counter.hasImplementation());
34 }
std::atomic< int > counter
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
constexpr None none
Definition: Optional.h:87
TEST ( FollyCountersTest  ,
SumWorks   
)

Definition at line 36 of file CountersTest.cpp.

References counter, i, and folly::none.

36  {
37  CompressionCounter counter(
38  kCodecType, kCodecName, folly::none, kKey, CompressionCounterType::SUM);
39  for (int i = 0; i < 100; ++i) {
40  ++counter;
41  counter++;
42  }
43 }
std::atomic< int > counter
constexpr None none
Definition: Optional.h:87
TEST ( FollyCountersTest  ,
AvgWorks   
)

Definition at line 45 of file CountersTest.cpp.

References counter, i, and folly::none.

45  {
46  CompressionCounter counter(
47  kCodecType, kCodecName, folly::none, kKey, CompressionCounterType::AVG);
48  for (int i = 0; i < 100; ++i) {
49  counter += 5;
50  }
51 }
std::atomic< int > counter
constexpr None none
Definition: Optional.h:87