Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mock_android_hw.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 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 #ifndef MIR_TEST_DOUBLES_MOCK_ANDROID_HW_H_
19 #define MIR_TEST_DOUBLES_MOCK_ANDROID_HW_H_
20 
23 
24 #include <hardware/hardware.h>
25 #include <gmock/gmock.h>
26 #include <memory>
27 
28 namespace mir
29 {
30 namespace test
31 {
32 namespace doubles
33 {
34 
35 typedef struct hw_module_t hw_module;
37 {
38 public:
39  HardwareModuleStub(hw_device_t& device);
40 
41  static int hw_open(const struct hw_module_t* module, const char*, struct hw_device_t** device);
42  static int hw_close(struct hw_device_t*);
43 
44  hw_module_methods_t gr_methods;
45  hw_device_t& mock_hw_device;
46 };
47 
49 {
50 public:
52  static int hw_open(const struct hw_module_t* module, const char*, struct hw_device_t** device);
53  static int hw_close(struct hw_device_t*);
54  hw_module_methods_t gr_methods;
55 };
56 
58 {
59 public:
62 
63  MOCK_METHOD2(hw_get_module, int(const char *id, const struct hw_module_t**));
64 
66  std::shared_ptr<alloc_device_t> mock_alloc_device;
67  std::shared_ptr<hwc_composer_device_1> mock_hwc_device;
68 
69  std::shared_ptr<HardwareModuleStub> mock_gralloc_module;
70  std::shared_ptr<HardwareModuleStub> mock_hwc_module;
71 };
72 
73 }
74 }
75 }
76 
77 #endif /* MIR_TEST_DOUBLES_MOCK_ANDROID_HW_H_ */

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Oct 15 00:23:28 UTC 2013