Mir
mock_platform_authentication.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2015 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: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_TEST_DOUBLES_MOCK_PLATFORM_AUTHENTICATION_H_
20 #define MIR_TEST_DOUBLES_MOCK_PLATFORM_AUTHENTICATION_H_
21 
22 #include "mir/graphics/platform_authentication.h"
23 #include "mir/graphics/platform_operation_message.h"
24 #include <gmock/gmock.h>
25 
26 namespace mir
27 {
28 namespace graphics
29 {
30 inline bool operator==(PlatformOperationMessage const& msg1,
31  PlatformOperationMessage const& msg2)
32 {
33  return msg1.data == msg2.data && msg1.fds == msg2.fds;
34 }
35 
36 inline bool operator!=(PlatformOperationMessage const& msg1,
37  PlatformOperationMessage const& msg2)
38 {
39  return !(msg1 == msg2);
40 }
41 }
42 
43 namespace test
44 {
45 namespace doubles
46 {
47 
48 struct MockPlatformAuthentication : graphics::PlatformAuthentication
49 {
50  MOCK_METHOD0(platform_fd_items, std::vector<int>());
51  MOCK_METHOD2(platform_operation, graphics::PlatformOperationMessage(
52  unsigned int, graphics::PlatformOperationMessage const&));
53  MOCK_METHOD0(auth_extension, optional_value<std::shared_ptr<graphics::MesaAuthExtension>>());
54  MOCK_METHOD0(set_gbm_extension, optional_value<std::shared_ptr<graphics::SetGbmExtension>>());
56  MOCK_METHOD2(request_interface, void*(char const*, int));
57 };
58 
59 }
60 }
61 }
62 
63 #endif
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: blob.h:26
Definition: mock_platform_authentication.h:48
MOCK_METHOD2(platform_operation, graphics::PlatformOperationMessage(unsigned int, graphics::PlatformOperationMessage const &))
Definition: optional_value.h:28
MOCK_METHOD0(platform_fd_items, std::vector< int >())
bool operator==(PlatformOperationMessage const &msg1, PlatformOperationMessage const &msg2)
Definition: mock_platform_authentication.h:30
bool operator!=(PlatformOperationMessage const &msg1, PlatformOperationMessage const &msg2)
Definition: mock_platform_authentication.h:36

Copyright © 2012-2018 Canonical Ltd.
Generated on Sun Jun 17 06:26:29 UTC 2018