Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame^] | 1 | // Copyright (c) 2011 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 SHILL_PROPERTY_STORE_UNITTEST_H_ |
| 6 | #define SHILL_PROPERTY_STORE_UNITTEST_H_ |
| 7 | |
| 8 | #include <map> |
| 9 | #include <string> |
| 10 | #include <vector> |
| 11 | |
| 12 | #include <dbus-c++/dbus.h> |
| 13 | #include <gtest/gtest.h> |
| 14 | #include <gmock/gmock.h> |
| 15 | |
| 16 | #include "shill/dbus_adaptor.h" |
| 17 | #include "shill/error.h" |
| 18 | #include "shill/manager.h" |
| 19 | #include "shill/mock_control.h" |
| 20 | #include "shill/property_store_interface.h" |
| 21 | #include "shill/shill_event.h" |
| 22 | |
| 23 | namespace shill { |
| 24 | |
| 25 | class PropertyStoreTest : public ::testing::Test { |
| 26 | public: |
| 27 | PropertyStoreTest() |
| 28 | : bool_v_(DBusAdaptor::BoolToVariant(0)), |
| 29 | byte_v_(DBusAdaptor::ByteToVariant(0)), |
| 30 | uint16_v_(DBusAdaptor::Uint16ToVariant(0)), |
| 31 | uint32_v_(DBusAdaptor::Uint32ToVariant(0)), |
| 32 | int16_v_(DBusAdaptor::Int16ToVariant(0)), |
| 33 | int32_v_(DBusAdaptor::Int32ToVariant(0)), |
| 34 | string_v_(DBusAdaptor::StringToVariant("")), |
| 35 | stringmap_v_(DBusAdaptor::StringmapToVariant( |
| 36 | std::map<std::string, std::string>())), |
| 37 | strings_v_(DBusAdaptor::StringsToVariant( |
| 38 | std::vector<std::string>(1, ""))), |
| 39 | manager_(&control_interface_, &dispatcher_), |
| 40 | invalid_args_(Error::kErrorNames[Error::kInvalidArguments]), |
| 41 | invalid_prop_(Error::kErrorNames[Error::kInvalidProperty]) { |
| 42 | } |
| 43 | |
| 44 | virtual ~PropertyStoreTest() {} |
| 45 | |
| 46 | protected: |
| 47 | ::DBus::Variant bool_v_; |
| 48 | ::DBus::Variant byte_v_; |
| 49 | ::DBus::Variant uint16_v_; |
| 50 | ::DBus::Variant uint32_v_; |
| 51 | ::DBus::Variant int16_v_; |
| 52 | ::DBus::Variant int32_v_; |
| 53 | ::DBus::Variant string_v_; |
| 54 | ::DBus::Variant stringmap_v_; |
| 55 | ::DBus::Variant strings_v_; |
| 56 | |
| 57 | MockControl control_interface_; |
| 58 | EventDispatcher dispatcher_; |
| 59 | Manager manager_; |
| 60 | std::string invalid_args_; |
| 61 | std::string invalid_prop_; |
| 62 | }; |
| 63 | |
| 64 | } // namespace shill |
| 65 | #endif // SHILL_PROPERTY_STORE_UNITTEST_H_ |