blob: a5cb0e4f3a121a619bc49ab80a17b8d85ce69c89 [file] [log] [blame]
Chris Masone3bd3c8c2011-06-13 08:20:26 -07001// 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"
Chris Masone7aa5f902011-07-11 11:13:35 -070020#include "shill/mock_glib.h"
Chris Masoneb925cc82011-06-22 15:39:57 -070021#include "shill/property_store.h"
Chris Masone3bd3c8c2011-06-13 08:20:26 -070022#include "shill/shill_event.h"
23
24namespace shill {
25
Chris Masoneb925cc82011-06-22 15:39:57 -070026class PropertyStoreTest : public testing::TestWithParam< ::DBus::Variant > {
Chris Masone3bd3c8c2011-06-13 08:20:26 -070027 public:
Chris Masoneb925cc82011-06-22 15:39:57 -070028 // In real code, it's frowned upon to have non-POD static members, as there
29 // can be ordering issues if your constructors have side effects.
30 // These constructors don't, and declaring these as static lets me
31 // autogenerate a bunch of unit test code that I would otherwise need to
32 // copypasta. So I think it's safe and worth it.
33 static const ::DBus::Variant kBoolV;
34 static const ::DBus::Variant kByteV;
35 static const ::DBus::Variant kInt16V;
36 static const ::DBus::Variant kInt32V;
37 static const ::DBus::Variant kStringV;
38 static const ::DBus::Variant kStringmapV;
39 static const ::DBus::Variant kStringmapsV;
40 static const ::DBus::Variant kStringsV;
Chris Masone889666b2011-07-03 12:58:50 -070041 static const ::DBus::Variant kStrIntPairV;
Chris Masoneb925cc82011-06-22 15:39:57 -070042 static const ::DBus::Variant kUint16V;
43 static const ::DBus::Variant kUint32V;
Chris Masone3bd3c8c2011-06-13 08:20:26 -070044
Chris Masoneb925cc82011-06-22 15:39:57 -070045 PropertyStoreTest();
46 virtual ~PropertyStoreTest();
Chris Masone3bd3c8c2011-06-13 08:20:26 -070047
48 protected:
Chris Masone3bd3c8c2011-06-13 08:20:26 -070049 MockControl control_interface_;
50 EventDispatcher dispatcher_;
51 Manager manager_;
Chris Masone7aa5f902011-07-11 11:13:35 -070052 MockGLib glib_;
Chris Masone3bd3c8c2011-06-13 08:20:26 -070053 std::string invalid_args_;
54 std::string invalid_prop_;
55};
56
57} // namespace shill
58#endif // SHILL_PROPERTY_STORE_UNITTEST_H_