aboutsummaryrefslogtreecommitdiffstats
path: root/brillo/udev/mock_udev_device.h
blob: 9e0c2ef2941784e01ae2bc002aa5e3c050dfa263 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef LIBBRILLO_BRILLO_UDEV_MOCK_UDEV_DEVICE_H_
#define LIBBRILLO_BRILLO_UDEV_MOCK_UDEV_DEVICE_H_

#include <memory>

#include <brillo/brillo_export.h>
#include <brillo/udev/udev_device.h>
#include <gmock/gmock.h>

namespace brillo {

class BRILLO_EXPORT MockUdevDevice : public UdevDevice {
 public:
  MockUdevDevice() = default;
  ~MockUdevDevice() override = default;

  MOCK_METHOD(std::unique_ptr<UdevDevice>, GetParent, (), (const, override));
  MOCK_METHOD(std::unique_ptr<UdevDevice>,
              GetParentWithSubsystemDeviceType,
              (const char*, const char*),
              (const, override));
  MOCK_METHOD(bool, IsInitialized, (), (const, override));
  MOCK_METHOD(uint64_t, GetMicrosecondsSinceInitialized, (), (const, override));
  MOCK_METHOD(uint64_t, GetSequenceNumber, (), (const, override));
  MOCK_METHOD(const char*, GetDevicePath, (), (const, override));
  MOCK_METHOD(const char*, GetDeviceNode, (), (const, override));
  MOCK_METHOD(dev_t, GetDeviceNumber, (), (const, override));
  MOCK_METHOD(const char*, GetDeviceType, (), (const, override));
  MOCK_METHOD(const char*, GetDriver, (), (const, override));
  MOCK_METHOD(const char*, GetSubsystem, (), (const, override));
  MOCK_METHOD(const char*, GetSysPath, (), (const, override));
  MOCK_METHOD(const char*, GetSysName, (), (const, override));
  MOCK_METHOD(const char*, GetSysNumber, (), (const, override));
  MOCK_METHOD(const char*, GetAction, (), (const, override));
  MOCK_METHOD(std::unique_ptr<UdevListEntry>,
              GetDeviceLinksListEntry,
              (),
              (const, override));
  MOCK_METHOD(std::unique_ptr<UdevListEntry>,
              GetPropertiesListEntry,
              (),
              (const, override));
  MOCK_METHOD(const char*, GetPropertyValue, (const char*), (const, override));
  MOCK_METHOD(std::unique_ptr<UdevListEntry>,
              GetTagsListEntry,
              (),
              (const, override));
  MOCK_METHOD(std::unique_ptr<UdevListEntry>,
              GetSysAttributeListEntry,
              (),
              (const, override));
  MOCK_METHOD(const char*,
              GetSysAttributeValue,
              (const char*),
              (const, override));

 private:
  DISALLOW_COPY_AND_ASSIGN(MockUdevDevice);
};

}  // namespace brillo

#endif  // LIBBRILLO_BRILLO_UDEV_MOCK_UDEV_DEVICE_H_