proxygen
HeaderPieceTests.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #include <glog/logging.h>
13 
14 using namespace proxygen::compress;
15 using namespace testing;
16 
17 class HeaderPieceTests : public testing::Test {};
18 
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
TEST_F(HeaderTableTests, IndexTranslation)