proxygen
HeaderPieceTests.cpp File Reference
#include <glog/logging.h>
#include <folly/portability/GTest.h>
#include <proxygen/lib/http/codec/compress/HeaderPiece.h>

Go to the source code of this file.

Classes

class  HeaderPieceTests
 

Functions

 TEST_F (HeaderPieceTests, Basic)
 

Function Documentation

TEST_F ( HeaderPieceTests  ,
Basic   
)

Definition at line 19 of file HeaderPieceTests.cpp.

References EXPECT_EQ, EXPECT_TRUE, and proxygen::compress::HeaderPiece::isMultiValued().

19  {
20  HeaderPiece *hp;
21 
22  // creating non-owner piece with null pointer
23  hp = new HeaderPiece(nullptr, 0, false, true);
25  // destructing this should be fine, since will not try to release the memory
26  delete hp;
27 
28  char *buf = new char[16];
29  hp = new HeaderPiece(buf, 16, true, true);
30  EXPECT_EQ(hp->str.data(), buf);
31  EXPECT_EQ(hp->str.size(), 16);
32  // this should release the mem
33  delete hp;
34 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859