Gilad Arnold | 4d740eb | 2012-05-15 08:48:13 -0700 | [diff] [blame] | 1 | // Copyright (c) 2012 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 CHROMEOS_PLATFORM_UPDATE_ENGINE_GPIO_HANDLER_UNITTEST_H__ |
| 6 | #define CHROMEOS_PLATFORM_UPDATE_ENGINE_GPIO_HANDLER_UNITTEST_H__ |
| 7 | |
| 8 | // This file contains various definitions that are shared by different mock |
| 9 | // implementations that emulate GPIO behavior in the system. |
| 10 | |
| 11 | // Some common strings used by the different cooperating mocks for this module. |
| 12 | // We use preprocessor constants to allow concatenation at compile-time. |
| 13 | #define MOCK_GPIO_CHIP_ID "100" |
| 14 | #define MOCK_DUTFLAGA_GPIO_ID "101" |
| 15 | #define MOCK_DUTFLAGB_GPIO_ID "102" |
| 16 | #define MOCK_SYSFS_PREFIX "/mock/sys/class/gpio" |
| 17 | |
| 18 | namespace chromeos_update_engine { |
| 19 | |
| 20 | // Mock GPIO identifiers, used by all mocks involved in unit testing the GPIO |
| 21 | // module. These represent the GPIOs which the unit tests can cover. They should |
| 22 | // generally match the GPIOs specified inside GpioHandler. |
| 23 | enum MockGpioId { |
| 24 | kMockGpioIdDutflaga = 0, |
| 25 | kMockGpioIdDutflagb, |
| 26 | kMockGpioIdMax // marker, do not remove! |
| 27 | }; |
| 28 | |
Gilad Arnold | 6eccc53 | 2012-05-17 15:44:22 -0700 | [diff] [blame] | 29 | // Mock GPIO directions, which are analogous to actual GPIO directions. |
| 30 | enum MockGpioDir { |
| 31 | kMockGpioDirIn = 0, |
| 32 | kMockGpioDirOut, |
| 33 | kMockGpioDirMax // marker, do not remove! |
| 34 | }; |
| 35 | |
| 36 | // Mock GPIO values, ditto. |
| 37 | enum MockGpioVal { |
| 38 | kMockGpioValUp = 0, |
| 39 | kMockGpioValDown, |
| 40 | kMockGpioValMax // marker, do not remove! |
| 41 | }; |
| 42 | |
Gilad Arnold | 4d740eb | 2012-05-15 08:48:13 -0700 | [diff] [blame] | 43 | } // chromeos_update_engine |
| 44 | |
| 45 | #endif /* CHROMEOS_PLATFORM_UPDATE_ENGINE_GPIO_HANDLER_UNITTEST_H__ */ |