blob: 608ae52b8773718d10afac80353df9791b01943d [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 Masoneb925cc82011-06-22 15:39:57 -070020#include "shill/property_store.h"
Chris Masone3bd3c8c2011-06-13 08:20:26 -070021#include "shill/shill_event.h"
22
23namespace shill {
24
Chris Masoneb925cc82011-06-22 15:39:57 -070025class PropertyStoreTest : public testing::TestWithParam< ::DBus::Variant > {
Chris Masone3bd3c8c2011-06-13 08:20:26 -070026 public:
Chris Masoneb925cc82011-06-22 15:39:57 -070027 // In real code, it's frowned upon to have non-POD static members, as there
28 // can be ordering issues if your constructors have side effects.
29 // These constructors don't, and declaring these as static lets me
30 // autogenerate a bunch of unit test code that I would otherwise need to
31 // copypasta. So I think it's safe and worth it.
32 static const ::DBus::Variant kBoolV;
33 static const ::DBus::Variant kByteV;
34 static const ::DBus::Variant kInt16V;
35 static const ::DBus::Variant kInt32V;
36 static const ::DBus::Variant kStringV;
37 static const ::DBus::Variant kStringmapV;
38 static const ::DBus::Variant kStringmapsV;
39 static const ::DBus::Variant kStringsV;
40 static const ::DBus::Variant kUint16V;
41 static const ::DBus::Variant kUint32V;
Chris Masone3bd3c8c2011-06-13 08:20:26 -070042
Chris Masoneb925cc82011-06-22 15:39:57 -070043 PropertyStoreTest();
44 virtual ~PropertyStoreTest();
Chris Masone3bd3c8c2011-06-13 08:20:26 -070045
46 protected:
Chris Masone3bd3c8c2011-06-13 08:20:26 -070047 MockControl control_interface_;
48 EventDispatcher dispatcher_;
49 Manager manager_;
50 std::string invalid_args_;
51 std::string invalid_prop_;
52};
53
54} // namespace shill
55#endif // SHILL_PROPERTY_STORE_UNITTEST_H_