1 : // Copyright 2012 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 : //
15 : // Declares utilities for building unittests dealing with BlockGraphs.
16 :
17 : #ifndef SYZYGY_BLOCK_GRAPH_UNITTEST_UTIL_H_
18 : #define SYZYGY_BLOCK_GRAPH_UNITTEST_UTIL_H_
19 :
20 : #include "syzygy/block_graph/block_graph.h"
21 : #include "syzygy/block_graph/block_graph_serializer.h"
22 :
23 m : namespace testing {
24 :
25 : // TODO(chrisha): Once we transition fully to BlockGraphSerializer, remove
26 : // the redundant comparison functions.
27 :
28 : // Compares two Blocks (from different BlockGraphs) to each other. Intended for
29 : // testing BlockGraph serialization.
30 m : bool BlocksEqual(const block_graph::BlockGraph::Block& b1,
31 m : const block_graph::BlockGraph::Block& b2,
32 m : const block_graph::BlockGraphSerializer& bgs);
33 :
34 : // Compares two BlockGraphs to each other. Intended for testing BlockGraph
35 : // serialization.
36 m : bool BlockGraphsEqual(
37 m : const block_graph::BlockGraph& b1,
38 m : const block_graph::BlockGraph& b2,
39 m : const block_graph::BlockGraphSerializer& bgs);
40 :
41 : // Generate a block-graph to use in the tests.
42 m : bool GenerateTestBlockGraph(block_graph::BlockGraph* image);
43 :
44 m : } // namespace testing
45 :
46 : #endif // SYZYGY_BLOCK_GRAPH_UNITTEST_UTIL_H_
|