proxygen
Matchers.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-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.
7  */
8 
9 #pragma once
10 
11 #include <gmock/gmock.h>
12 #include <gtest/gtest.h>
13 
14 namespace fizz {
15 namespace test {
16 
17 MATCHER_P(BufMatches, expected, "") {
18  return folly::IOBufEqualTo()(folly::IOBuf::copyBuffer(expected), arg);
19 }
20 
21 MATCHER_P(RangeMatches, expected, "") {
22  folly::StringPiece exp(expected);
23  return exp.size() == arg.size() &&
24  (exp.size() == 0 || memcmp(exp.data(), arg.data(), exp.size()) == 0);
25 }
26 } // namespace test
27 } // namespace fizz
MATCHER_P(WriteNewSessionTicketMatches, expected,"")
constexpr size_type size() const
Definition: Range.h:431
constexpr Iter data() const
Definition: Range.h:446
Definition: Actions.h:16
static std::unique_ptr< IOBuf > copyBuffer(const void *buf, std::size_t size, std::size_t headroom=0, std::size_t minTailroom=0)
Definition: IOBuf.h:1587