Mir
display_config_matchers.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 2 or 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_TEST_DISPLAY_CONFIG_MATCHERS_H_
20 #define MIR_TEST_DISPLAY_CONFIG_MATCHERS_H_
21 
23 
24 #include <memory>
25 #include <gmock/gmock.h>
26 
27 
28 //avoid a valgrind complaint by defining printer for this type
29 static void PrintTo(MirDisplayConfiguration const&, ::std::ostream*) __attribute__ ((unused));
30 void PrintTo(MirDisplayConfiguration const&, ::std::ostream*)
31 {
32 }
33 
34 namespace mir
35 {
36 namespace protobuf
37 {
38 
39 class DisplayConfiguration;
40 class Connection;
41 static void PrintTo(mir::protobuf::DisplayConfiguration const&, ::std::ostream*) __attribute__ ((unused));
42 void PrintTo(mir::protobuf::DisplayConfiguration const&, ::std::ostream*) {}
43 
44 static void PrintTo(mir::protobuf::Connection const&, ::std::ostream*) __attribute__ ((unused));
45 void PrintTo(mir::protobuf::Connection const&, ::std::ostream*)
46 {
47 }
48 
49 }
50 
51 namespace graphics
52 {
53 class DisplayConfiguration;
54 }
55 
56 namespace test
57 {
58 
60  testing::MatchResultListener* listener,
61  graphics::DisplayConfiguration const& display_config1,
62  graphics::DisplayConfiguration const& display_config2);
63 
65  testing::MatchResultListener* listener,
66  MirDisplayConfiguration const& client_config,
67  graphics::DisplayConfiguration const& display_config);
68 
70  testing::MatchResultListener* listener,
71  protobuf::DisplayConfiguration const& protobuf_config,
72  graphics::DisplayConfiguration const& display_config);
73 
75  testing::MatchResultListener* listener,
76  MirDisplayConfiguration const* client_config1,
77  MirDisplayConfiguration const* client_config2);
78 
80  testing::MatchResultListener* listener,
81  MirDisplayConfiguration const& client_config,
82  protobuf::DisplayConfiguration const& protobuf_config);
83 
85  testing::MatchResultListener* listener,
86  graphics::DisplayConfiguration const& display_config1,
87  MirDisplayConfiguration const* display_config2);
88 
90  testing::MatchResultListener* listener,
91  std::shared_ptr<graphics::DisplayConfiguration const> & display_config1,
92  MirDisplayConfiguration const* display_config2);
93 
95  testing::MatchResultListener* listener,
96  MirDisplayConfiguration const* display_config2,
97  graphics::DisplayConfiguration const& display_config1);
98 
100  testing::MatchResultListener* listener,
101  MirDisplayConfig const* client_config,
102  graphics::DisplayConfiguration const& server_config);
103 
105  testing::MatchResultListener* listener,
106  graphics::DisplayConfiguration const& server_config,
107  MirDisplayConfig const* client_config);
108 
110  testing::MatchResultListener* listener,
111  MirDisplayConfig const* config1,
112  MirDisplayConfig const* config2);
113 
115  testing::MatchResultListener* listener,
116  std::shared_ptr<graphics::DisplayConfiguration> const& config1,
117  MirDisplayConfig const* config2);
118 
119 MATCHER_P(DisplayConfigMatches, config, "")
120 {
121  return compare_display_configurations(result_listener, arg, config);
122 }
123 
124 }
125 }
126 
127 #endif /* MIR_TEST_DISPLAY_CONFIG_MATCHERS_H_ */
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: sw_splash.h:26
Definition: client_types.h:380
struct MirDisplayConfig MirDisplayConfig
Definition: client_types.h:53
MATCHER_P(DisplayConfigMatches, config, "")
Definition: display_config_matchers.h:119
bool compare_display_configurations(testing::MatchResultListener *listener, std::shared_ptr< graphics::DisplayConfiguration > const &config1, MirDisplayConfig const *config2)

Copyright © 2012-2018 Canonical Ltd.
Generated on Mon Feb 19 14:06:43 UTC 2018