proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
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>
11
#include <
folly/portability/GTest.h
>
12
#include <
proxygen/lib/http/codec/compress/HeaderPiece.h
>
13
14
using namespace
proxygen::compress
;
15
using namespace
testing
;
16
17
class
HeaderPieceTests
:
public
testing::Test
{};
18
19
TEST_F
(
HeaderPieceTests
, Basic) {
20
HeaderPiece
*hp;
21
22
// creating non-owner piece with null pointer
23
hp =
new
HeaderPiece
(
nullptr
, 0,
false
,
true
);
24
EXPECT_TRUE
(hp->
isMultiValued
());
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
}
testing
Definition:
gmock-actions.h:53
proxygen::compress::HeaderPiece
Definition:
HeaderPiece.h:20
proxygen::compress::HeaderPiece::isMultiValued
bool isMultiValued() const
Definition:
HeaderPiece.h:47
HeaderPieceTests
Definition:
HeaderPieceTests.cpp:17
EXPECT_EQ
#define EXPECT_EQ(val1, val2)
Definition:
gtest.h:1922
HeaderPiece.h
GTest.h
proxygen::compress
Definition:
CompressionScheme.h:16
testing::Test
Definition:
gtest.h:371
EXPECT_TRUE
#define EXPECT_TRUE(condition)
Definition:
gtest.h:1859
proxygen::TEST_F
TEST_F(HeaderTableTests, IndexTranslation)
Definition:
HeaderTableTests.cpp:54
proxygen
lib
http
codec
compress
test
HeaderPieceTests.cpp
Generated by
1.8.11