proxygen
JsonTestUtil.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <folly/Range.h>
20 #include <folly/dynamic.h>
21 
22 namespace folly {
23 
34 bool compareJson(StringPiece json1, StringPiece json2);
35 
49  StringPiece json1,
50  StringPiece json2,
51  double tolerance);
52 
58  const dynamic& obj1,
59  const dynamic& obj2,
60  double tolerance);
61 
62 } // namespace folly
63 
68 #define FOLLY_EXPECT_JSON_EQ(json1, json2) \
69  EXPECT_PRED2(::folly::compareJson, json1, json2)
70 
71 #define FOLLY_EXPECT_JSON_NEAR(json1, json2, tolerance) \
72  EXPECT_PRED3(::folly::compareJsonWithTolerance, json1, json2, tolerance)
bool compareJsonWithTolerance(StringPiece json1, StringPiece json2, double tolerance)
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
Range< const char * > StringPiece
bool compareJson(StringPiece json1, StringPiece json2)
bool compareDynamicWithTolerance(const dynamic &obj1, const dynamic &obj2, double tolerance)