aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-03-09 12:48:18 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-03-09 12:48:18 -0500
commit16b0ab32fe1b849523931ed33dbdd7ce0f9bac3f (patch)
tree36c29b628c5c2bb0985bde6b2a4ff77f4bf8de3e
parented9d932ef17fd55d8858a9391ab81d237a6be5ad (diff)
downloadayatana-indicator-datetime-16b0ab32fe1b849523931ed33dbdd7ce0f9bac3f.tar.gz
ayatana-indicator-datetime-16b0ab32fe1b849523931ed33dbdd7ce0f9bac3f.tar.bz2
ayatana-indicator-datetime-16b0ab32fe1b849523931ed33dbdd7ce0f9bac3f.zip
sync unit tests
-rw-r--r--tests/test-planner.cpp6
-rw-r--r--tests/timezone-mock.h40
2 files changed, 43 insertions, 3 deletions
diff --git a/tests/test-planner.cpp b/tests/test-planner.cpp
index e5c11f9..6f602f4 100644
--- a/tests/test-planner.cpp
+++ b/tests/test-planner.cpp
@@ -18,13 +18,13 @@
*/
#include "glib-fixture.h"
+#include "timezone-mock.h"
#include <datetime/appointment.h>
#include <datetime/clock-mock.h>
#include <datetime/date-time.h>
#include <datetime/planner.h>
#include <datetime/planner-eds.h>
-#include <datetime/timezones.h>
#include <langinfo.h>
#include <locale.h>
@@ -44,8 +44,8 @@ TEST_F(PlannerFixture, EDS)
g_date_time_unref(tmp);
std::shared_ptr<Clock> clock(new MockClock(now));
- std::shared_ptr<Timezones> timezones(new Timezones);
- PlannerEds planner(clock, timezones);
+ std::shared_ptr<Timezone> tz(new MockTimezone);
+ PlannerEds planner(clock, tz);
wait_msec(100);
planner.time.set(now);
diff --git a/tests/timezone-mock.h b/tests/timezone-mock.h
new file mode 100644
index 0000000..67584cb
--- /dev/null
+++ b/tests/timezone-mock.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2014 Canonical Ltd.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 3, as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranties of
+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ * Charles Kerr <charles.kerr@canonical.com>
+ */
+
+#ifndef INDICATOR_DATETIME_TIMEZONE_MOCK_H
+#define INDICATOR_DATETIME_TIMEZONE_MOCK_H
+
+#include <datetime/timezone.h>
+
+namespace unity {
+namespace indicator {
+namespace datetime {
+
+class MockTimezone: public Timezone
+{
+public:
+ MockTimezone() =default;
+ ~MockTimezone() =default;
+};
+
+} // namespace datetime
+} // namespace indicator
+} // namespace unity
+
+#endif // INDICATOR_DATETIME_TIMEZONE_MOCK_H