xref: /aosp_15_r20/external/libbrillo/brillo/udev/mock_udev_device.h (revision 1a96fba65179ea7d3f56207137718607415c5953)
1 // Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef LIBBRILLO_BRILLO_UDEV_MOCK_UDEV_DEVICE_H_
6 #define LIBBRILLO_BRILLO_UDEV_MOCK_UDEV_DEVICE_H_
7 
8 #include <memory>
9 
10 #include <brillo/brillo_export.h>
11 #include <brillo/udev/udev_device.h>
12 #include <gmock/gmock.h>
13 
14 namespace brillo {
15 
16 class BRILLO_EXPORT MockUdevDevice : public UdevDevice {
17  public:
18   MockUdevDevice() = default;
19   ~MockUdevDevice() override = default;
20 
21   MOCK_METHOD(std::unique_ptr<UdevDevice>, GetParent, (), (const, override));
22   MOCK_METHOD(std::unique_ptr<UdevDevice>,
23               GetParentWithSubsystemDeviceType,
24               (const char*, const char*),
25               (const, override));
26   MOCK_METHOD(bool, IsInitialized, (), (const, override));
27   MOCK_METHOD(uint64_t, GetMicrosecondsSinceInitialized, (), (const, override));
28   MOCK_METHOD(uint64_t, GetSequenceNumber, (), (const, override));
29   MOCK_METHOD(const char*, GetDevicePath, (), (const, override));
30   MOCK_METHOD(const char*, GetDeviceNode, (), (const, override));
31   MOCK_METHOD(dev_t, GetDeviceNumber, (), (const, override));
32   MOCK_METHOD(const char*, GetDeviceType, (), (const, override));
33   MOCK_METHOD(const char*, GetDriver, (), (const, override));
34   MOCK_METHOD(const char*, GetSubsystem, (), (const, override));
35   MOCK_METHOD(const char*, GetSysPath, (), (const, override));
36   MOCK_METHOD(const char*, GetSysName, (), (const, override));
37   MOCK_METHOD(const char*, GetSysNumber, (), (const, override));
38   MOCK_METHOD(const char*, GetAction, (), (const, override));
39   MOCK_METHOD(std::unique_ptr<UdevListEntry>,
40               GetDeviceLinksListEntry,
41               (),
42               (const, override));
43   MOCK_METHOD(std::unique_ptr<UdevListEntry>,
44               GetPropertiesListEntry,
45               (),
46               (const, override));
47   MOCK_METHOD(const char*, GetPropertyValue, (const char*), (const, override));
48   MOCK_METHOD(std::unique_ptr<UdevListEntry>,
49               GetTagsListEntry,
50               (),
51               (const, override));
52   MOCK_METHOD(std::unique_ptr<UdevListEntry>,
53               GetSysAttributeListEntry,
54               (),
55               (const, override));
56   MOCK_METHOD(const char*,
57               GetSysAttributeValue,
58               (const char*),
59               (const, override));
60   MOCK_METHOD(std::unique_ptr<UdevDevice>, Clone, (), (override));
61 
62  private:
63   DISALLOW_COPY_AND_ASSIGN(MockUdevDevice);
64 };
65 
66 }  // namespace brillo
67 
68 #endif  // LIBBRILLO_BRILLO_UDEV_MOCK_UDEV_DEVICE_H_
69