From e906c4b452d4ca394e327b2ccaa3a3d4083e1a08 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 6 Mar 2015 09:21:47 -0600 Subject: Pulling stuff from indicator-sound --- tests/indicator-test.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 tests/indicator-test.cpp (limited to 'tests/indicator-test.cpp') diff --git a/tests/indicator-test.cpp b/tests/indicator-test.cpp new file mode 100644 index 0000000..1aef466 --- /dev/null +++ b/tests/indicator-test.cpp @@ -0,0 +1,53 @@ +/* + * Copyright © 2015 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY 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 . + * + * Authors: + * Ted Gould + */ + +#include +#include + +#include "indicator-fixture.h" + +class IndicatorTest : public IndicatorFixture +{ +protected: + IndicatorTest (void) : + IndicatorFixture(INDICATOR_MESSAGES_SERVICE_BINARY, "com.canonical.indicator.messages") + { + } + + virtual void SetUp() override + { + g_setenv("GSETTINGS_SCHEMA_DIR", SCHEMA_DIR, TRUE); + g_setenv("GSETTINGS_BACKEND", "memory", TRUE); + + IndicatorFixture::SetUp(); + } + + virtual void TearDown() override + { + IndicatorFixture::TearDown(); + } + +}; + + +TEST_F(IndicatorTest, PhoneMenu) { + setMenu("/com/canonical/indicator/messages/phone"); + +} + -- cgit v1.2.3 From 4bef5575c83bd34e467c4aa043e9bec221354feb Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 6 Mar 2015 16:19:41 -0600 Subject: Bringing in AS mock and getting a base test of the root action going --- tests/accounts-service-mock.h | 122 ++++++++++++++++++++++++++++++++++++++++++ tests/indicator-fixture.h | 4 +- tests/indicator-test.cpp | 16 +++++- 3 files changed, 138 insertions(+), 4 deletions(-) create mode 100644 tests/accounts-service-mock.h (limited to 'tests/indicator-test.cpp') diff --git a/tests/accounts-service-mock.h b/tests/accounts-service-mock.h new file mode 100644 index 0000000..1d0c1fe --- /dev/null +++ b/tests/accounts-service-mock.h @@ -0,0 +1,122 @@ +/* + * 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 as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY 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 . + * + * Authors: + * Ted Gould + */ + +#include +#include + +class AccountsServiceMock +{ + DbusTestDbusMock * mock = nullptr; + DbusTestDbusMockObject * soundobj = nullptr; + DbusTestDbusMockObject * userobj = nullptr; + DbusTestDbusMockObject * syssoundobj = nullptr; + + public: + AccountsServiceMock () { + mock = dbus_test_dbus_mock_new("org.freedesktop.Accounts"); + + dbus_test_task_set_bus(DBUS_TEST_TASK(mock), DBUS_TEST_SERVICE_BUS_SYSTEM); + + DbusTestDbusMockObject * baseobj = dbus_test_dbus_mock_get_object(mock, "/org/freedesktop/Accounts", "org.freedesktop.Accounts", NULL); + + dbus_test_dbus_mock_object_add_method(mock, baseobj, + "CacheUser", G_VARIANT_TYPE_STRING, G_VARIANT_TYPE_OBJECT_PATH, + "ret = dbus.ObjectPath('/user')\n", NULL); + dbus_test_dbus_mock_object_add_method(mock, baseobj, + "FindUserById", G_VARIANT_TYPE_INT64, G_VARIANT_TYPE_OBJECT_PATH, + "ret = dbus.ObjectPath('/user')\n", NULL); + dbus_test_dbus_mock_object_add_method(mock, baseobj, + "FindUserByName", G_VARIANT_TYPE_STRING, G_VARIANT_TYPE_OBJECT_PATH, + "ret = dbus.ObjectPath('/user')\n", NULL); + dbus_test_dbus_mock_object_add_method(mock, baseobj, + "ListCachedUsers", NULL, G_VARIANT_TYPE_OBJECT_PATH_ARRAY, + "ret = [ dbus.ObjectPath('/user') ]\n", NULL); + dbus_test_dbus_mock_object_add_method(mock, baseobj, + "UncacheUser", G_VARIANT_TYPE_STRING, NULL, + "", NULL); + + userobj = dbus_test_dbus_mock_get_object(mock, "/user", "org.freedesktop.Accounts.User", NULL); + dbus_test_dbus_mock_object_add_property(mock, userobj, + "UserName", G_VARIANT_TYPE_STRING, + g_variant_new_string(g_get_user_name()), NULL); + + soundobj = dbus_test_dbus_mock_get_object(mock, "/user", "com.canonical.indicator.sound.AccountsService", NULL); + dbus_test_dbus_mock_object_add_property(mock, soundobj, + "Timestamp", G_VARIANT_TYPE_UINT64, + g_variant_new_uint64(0), NULL); + dbus_test_dbus_mock_object_add_property(mock, soundobj, + "PlayerName", G_VARIANT_TYPE_STRING, + g_variant_new_string(""), NULL); + dbus_test_dbus_mock_object_add_property(mock, soundobj, + "PlayerIcon", G_VARIANT_TYPE_VARIANT, + g_variant_new_variant(g_variant_new_string("")), NULL); + dbus_test_dbus_mock_object_add_property(mock, soundobj, + "Running", G_VARIANT_TYPE_BOOLEAN, + g_variant_new_boolean(FALSE), NULL); + dbus_test_dbus_mock_object_add_property(mock, soundobj, + "State", G_VARIANT_TYPE_STRING, + g_variant_new_string(""), NULL); + dbus_test_dbus_mock_object_add_property(mock, soundobj, + "Title", G_VARIANT_TYPE_STRING, + g_variant_new_string(""), NULL); + dbus_test_dbus_mock_object_add_property(mock, soundobj, + "Artist", G_VARIANT_TYPE_STRING, + g_variant_new_string(""), NULL); + dbus_test_dbus_mock_object_add_property(mock, soundobj, + "Album", G_VARIANT_TYPE_STRING, + g_variant_new_string(""), NULL); + dbus_test_dbus_mock_object_add_property(mock, soundobj, + "ArtUrl", G_VARIANT_TYPE_STRING, + g_variant_new_string(""), NULL); + + syssoundobj = dbus_test_dbus_mock_get_object(mock, "/user", "com.ubuntu.touch.AccountsService.Sound", NULL); + dbus_test_dbus_mock_object_add_property(mock, syssoundobj, + "SilentMode", G_VARIANT_TYPE_BOOLEAN, + g_variant_new_boolean(FALSE), NULL); + } + + ~AccountsServiceMock () { + g_debug("Destroying the Accounts Service Mock"); + g_clear_object(&mock); + } + + void setSilentMode (bool modeValue) { + dbus_test_dbus_mock_object_update_property(mock, syssoundobj, + "SilentMode", g_variant_new_boolean(modeValue ? TRUE : FALSE), + NULL); + } + + operator std::shared_ptr () { + return std::shared_ptr( + DBUS_TEST_TASK(g_object_ref(mock)), + [](DbusTestTask * task) { g_clear_object(&task); }); + } + + operator DbusTestTask* () { + return DBUS_TEST_TASK(mock); + } + + operator DbusTestDbusMock* () { + return mock; + } + + DbusTestDbusMockObject * get_sound () { + return soundobj; + } +}; diff --git a/tests/indicator-fixture.h b/tests/indicator-fixture.h index e725a50..aa191ae 100644 --- a/tests/indicator-fixture.h +++ b/tests/indicator-fixture.h @@ -272,9 +272,9 @@ class IndicatorFixture : public ::testing::Test return result; } - template testing::AssertionResult expectEventuallyActionStateExists (Args&& ... args) { + template testing::AssertionResult expectEventuallyActionExists (Args&& ... args) { std::function func = [&]() { - return expectActionStateExists(std::forward(args)...); + return expectActionExists(std::forward(args)...); }; return expectEventually(func); } diff --git a/tests/indicator-test.cpp b/tests/indicator-test.cpp index 1aef466..3a5ef6d 100644 --- a/tests/indicator-test.cpp +++ b/tests/indicator-test.cpp @@ -21,6 +21,7 @@ #include #include "indicator-fixture.h" +#include "accounts-service-mock.h" class IndicatorTest : public IndicatorFixture { @@ -30,24 +31,35 @@ protected: { } + std::shared_ptr as; + virtual void SetUp() override { g_setenv("GSETTINGS_SCHEMA_DIR", SCHEMA_DIR, TRUE); g_setenv("GSETTINGS_BACKEND", "memory", TRUE); + as = std::make_shared(); + addMock(*as); + IndicatorFixture::SetUp(); } virtual void TearDown() override { + as.reset(); + IndicatorFixture::TearDown(); } }; -TEST_F(IndicatorTest, PhoneMenu) { - setMenu("/com/canonical/indicator/messages/phone"); +TEST_F(IndicatorTest, RootAction) { + setActions("/com/canonical/indicator/messages"); + + EXPECT_EVENTUALLY_ACTION_EXISTS("messages"); + EXPECT_ACTION_STATE_TYPE("messages", G_VARIANT_TYPE("a{sv}")); + EXPECT_ACTION_STATE("messages", g_variant_new_parsed("{'icon': <('themed', <['indicator-messages-offline', 'indicator-messages', 'indicator']>)>, 'title': <'Notifications'>, 'accessible-desc': <'Messages'>, 'visible': }")); } -- cgit v1.2.3 From 474099ef1d4010fa918da698707b644cbc3fe5da Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 6 Mar 2015 21:46:30 -0600 Subject: A test that puts a message in the menu --- Makefile.am | 2 +- tests/Makefile.am | 3 +++ tests/applications/test.desktop | 3 +++ tests/indicator-test.cpp | 25 ++++++++++++++++++++++++- 4 files changed, 31 insertions(+), 2 deletions(-) (limited to 'tests/indicator-test.cpp') diff --git a/Makefile.am b/Makefile.am index fe247b6..a48804e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,7 +15,7 @@ SUBDIRS += \ tests # build src first -tests: src +tests: src libmessaging-menu endif diff --git a/tests/Makefile.am b/tests/Makefile.am index ee0b9d7..6dabf89 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -47,6 +47,8 @@ indicator_test_SOURCES = \ indicator_test_CPPFLAGS = \ -DINDICATOR_MESSAGES_SERVICE_BINARY="\"$(abs_top_builddir)/src/indicator-messages-service\"" \ -DSCHEMA_DIR="\"$(abs_builddir)/gsettings-schemas-compiled/\"" \ + -DXDG_DATA_DIRS="\"$(abs_srcdir)/\"" \ + -I$(top_srcdir)/libmessaging-menu \ -std=c++11 \ $(APPLET_CFLAGS) \ $(DBUSTEST_CFLAGS) \ @@ -55,6 +57,7 @@ indicator_test_CPPFLAGS = \ indicator_test_LDADD = \ $(APPLET_LIBS) \ $(DBUSTEST_LIBS) \ + $(top_builddir)/libmessaging-menu/libmessaging-menu.la \ libgtest.la \ -lc -lpthread diff --git a/tests/applications/test.desktop b/tests/applications/test.desktop index c2332b9..63ccb6b 100644 --- a/tests/applications/test.desktop +++ b/tests/applications/test.desktop @@ -1,2 +1,5 @@ [Desktop Entry] Type=Application +Name=Test +Exec=test +Icon=test-app diff --git a/tests/indicator-test.cpp b/tests/indicator-test.cpp index 3a5ef6d..afb55d0 100644 --- a/tests/indicator-test.cpp +++ b/tests/indicator-test.cpp @@ -23,6 +23,9 @@ #include "indicator-fixture.h" #include "accounts-service-mock.h" +#include "messaging-menu-app.h" +#include "messaging-menu-message.h" + class IndicatorTest : public IndicatorFixture { protected: @@ -38,6 +41,8 @@ protected: g_setenv("GSETTINGS_SCHEMA_DIR", SCHEMA_DIR, TRUE); g_setenv("GSETTINGS_BACKEND", "memory", TRUE); + g_setenv("XDG_DATA_DIRS", XDG_DATA_DIRS, TRUE); + as = std::make_shared(); addMock(*as); @@ -60,6 +65,24 @@ TEST_F(IndicatorTest, RootAction) { EXPECT_EVENTUALLY_ACTION_EXISTS("messages"); EXPECT_ACTION_STATE_TYPE("messages", G_VARIANT_TYPE("a{sv}")); EXPECT_ACTION_STATE("messages", g_variant_new_parsed("{'icon': <('themed', <['indicator-messages-offline', 'indicator-messages', 'indicator']>)>, 'title': <'Notifications'>, 'accessible-desc': <'Messages'>, 'visible': }")); - } +TEST_F(IndicatorTest, SingleMessage) { + setActions("/com/canonical/indicator/messages"); + + auto app = std::shared_ptr(messaging_menu_app_new("test.desktop"), [](MessagingMenuApp * app) { g_clear_object(&app); }); + ASSERT_NE(nullptr, app); + messaging_menu_app_register(app.get()); + + auto msg = std::shared_ptr(messaging_menu_message_new( + "test-id", + nullptr, /* no icon */ + "Test Title", + "A subtitle too", + "You only like me for my body", + 0), [](MessagingMenuMessage * msg) { g_clear_object(&msg); }); + messaging_menu_app_append_message(app.get(), msg.get(), nullptr, FALSE); + + EXPECT_EVENTUALLY_ACTION_EXISTS("test.launch"); + +} -- cgit v1.2.3 From e4b55aa627bba56186b8df30cbd9f27177cfe1ad Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 6 Mar 2015 22:21:09 -0600 Subject: Check the message's menu --- tests/indicator-test.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tests/indicator-test.cpp') diff --git a/tests/indicator-test.cpp b/tests/indicator-test.cpp index afb55d0..2a711f0 100644 --- a/tests/indicator-test.cpp +++ b/tests/indicator-test.cpp @@ -74,8 +74,10 @@ TEST_F(IndicatorTest, SingleMessage) { ASSERT_NE(nullptr, app); messaging_menu_app_register(app.get()); + EXPECT_EVENTUALLY_ACTION_EXISTS("test.launch"); + auto msg = std::shared_ptr(messaging_menu_message_new( - "test-id", + "testid", nullptr, /* no icon */ "Test Title", "A subtitle too", @@ -83,6 +85,12 @@ TEST_F(IndicatorTest, SingleMessage) { 0), [](MessagingMenuMessage * msg) { g_clear_object(&msg); }); messaging_menu_app_append_message(app.get(), msg.get(), nullptr, FALSE); - EXPECT_EVENTUALLY_ACTION_EXISTS("test.launch"); + EXPECT_EVENTUALLY_ACTION_EXISTS("test.msg.testid"); + + setMenu("/com/canonical/indicator/messages/phone"); + EXPECT_EVENTUALLY_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-type", "com.canonical.indicator.messages.messageitem"); + EXPECT_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-message-id", "testid"); + EXPECT_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-subtitle", "A subtitle too"); + EXPECT_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-text", "You only like me for my body"); } -- cgit v1.2.3 From 3bd0c14d33d444f02f3a35961fafa11d866b1b0d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 9 Mar 2015 14:20:27 -0500 Subject: Added a test for message replying --- tests/indicator-test.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'tests/indicator-test.cpp') diff --git a/tests/indicator-test.cpp b/tests/indicator-test.cpp index 2a711f0..d8c79df 100644 --- a/tests/indicator-test.cpp +++ b/tests/indicator-test.cpp @@ -90,7 +90,57 @@ TEST_F(IndicatorTest, SingleMessage) { setMenu("/com/canonical/indicator/messages/phone"); EXPECT_EVENTUALLY_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-type", "com.canonical.indicator.messages.messageitem"); + EXPECT_MENU_ATTRIB(std::vector({0, 0, 0}), "label", "Test Title"); EXPECT_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-message-id", "testid"); EXPECT_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-subtitle", "A subtitle too"); EXPECT_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-text", "You only like me for my body"); } + +static void +messageReplyActivate (GObject * obj, gchar * name, GVariant * value, gpointer user_data) { + std::string * res = reinterpret_cast(user_data); + *res = g_variant_get_string(value, nullptr); +} + +TEST_F(IndicatorTest, MessageReply) { + setActions("/com/canonical/indicator/messages"); + + auto app = std::shared_ptr(messaging_menu_app_new("test.desktop"), [](MessagingMenuApp * app) { g_clear_object(&app); }); + ASSERT_NE(nullptr, app); + messaging_menu_app_register(app.get()); + + EXPECT_EVENTUALLY_ACTION_EXISTS("test.launch"); + + auto msg = std::shared_ptr(messaging_menu_message_new( + "messageid", + nullptr, /* no icon */ + "Reply Message", + "A message to reply to", + "In-app replies are for wimps, reply here to save yourself time and be cool.", + 0), [](MessagingMenuMessage * msg) { g_clear_object(&msg); }); + messaging_menu_message_add_action(msg.get(), + "replyid", + "Reply", + G_VARIANT_TYPE_STRING, + nullptr); + messaging_menu_app_append_message(app.get(), msg.get(), nullptr, FALSE); + + EXPECT_EVENTUALLY_ACTION_EXISTS("test.msg.messageid"); + EXPECT_EVENTUALLY_ACTION_EXISTS("test.msg-actions.messageid.replyid"); + EXPECT_ACTION_ACTIVATION_TYPE("test.msg-actions.messageid.replyid", G_VARIANT_TYPE_STRING); + + EXPECT_ACTION_ENABLED("remove-all", true); + + setMenu("/com/canonical/indicator/messages/phone"); + + EXPECT_EVENTUALLY_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-type", "com.canonical.indicator.messages.messageitem"); + + std::string activateResponse; + g_signal_connect(msg.get(), "activate", G_CALLBACK(messageReplyActivate), &activateResponse); + + activateAction("test.msg-actions.messageid.replyid", g_variant_new_string("Reply to me")); + + EXPECT_EVENTUALLY_EQ("Reply to me", activateResponse); + + EXPECT_EVENTUALLY_ACTION_ENABLED("remove-all", false); +} -- cgit v1.2.3 From 54ae3da705f9babeec8f2bf5c220d533eef425cc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 9 Mar 2015 17:07:03 -0500 Subject: Test the messaging menu changing color on and off --- tests/applications/test2.desktop | 5 ++++ tests/indicator-test.cpp | 63 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 tests/applications/test2.desktop (limited to 'tests/indicator-test.cpp') diff --git a/tests/applications/test2.desktop b/tests/applications/test2.desktop new file mode 100644 index 0000000..63ccb6b --- /dev/null +++ b/tests/applications/test2.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Type=Application +Name=Test +Exec=test +Icon=test-app diff --git a/tests/indicator-test.cpp b/tests/indicator-test.cpp index d8c79df..8f87191 100644 --- a/tests/indicator-test.cpp +++ b/tests/indicator-test.cpp @@ -144,3 +144,66 @@ TEST_F(IndicatorTest, MessageReply) { EXPECT_EVENTUALLY_ACTION_ENABLED("remove-all", false); } + +TEST_F(IndicatorTest, IconNotification) { + auto normalicon = std::shared_ptr(g_variant_ref_sink(g_variant_new_parsed("{'icon': <('themed', <['indicator-messages-offline', 'indicator-messages', 'indicator']>)>, 'title': <'Notifications'>, 'accessible-desc': <'Messages'>, 'visible': }")), [](GVariant *var) {if (var != nullptr) g_variant_unref(var); }); + auto blueicon = std::shared_ptr(g_variant_ref_sink(g_variant_new_parsed("{'icon': <('themed', <['indicator-messages-new-offline', 'indicator-messages-new', 'indicator-messages', 'indicator']>)>, 'title': <'Notifications'>, 'accessible-desc': <'New Messages'>, 'visible': }")), [](GVariant *var) {if (var != nullptr) g_variant_unref(var); }); + + setActions("/com/canonical/indicator/messages"); + + auto app = std::shared_ptr(messaging_menu_app_new("test.desktop"), [](MessagingMenuApp * app) { g_clear_object(&app); }); + ASSERT_NE(nullptr, app); + messaging_menu_app_register(app.get()); + + EXPECT_EVENTUALLY_ACTION_EXISTS("test.launch"); + + EXPECT_ACTION_STATE("messages", normalicon); + + auto app2 = std::shared_ptr(messaging_menu_app_new("test2.desktop"), [](MessagingMenuApp * app) { g_clear_object(&app); }); + ASSERT_NE(nullptr, app2); + messaging_menu_app_register(app2.get()); + + EXPECT_EVENTUALLY_ACTION_EXISTS("test2.launch"); + + messaging_menu_app_append_source_with_count(app2.get(), + "countsource", + nullptr, + "Count Source", + 500); + messaging_menu_app_draw_attention(app2.get(), "countsource"); + + EXPECT_EVENTUALLY_ACTION_STATE("messages", blueicon); + + auto msg = std::shared_ptr(messaging_menu_message_new( + "messageid", + nullptr, /* no icon */ + "Message", + "A secret message", + "asdfa;lkweraoweprijas;dvlknasvdoiewur;aslkd", + 0), [](MessagingMenuMessage * msg) { g_clear_object(&msg); }); + messaging_menu_message_set_draws_attention(msg.get(), true); + messaging_menu_app_append_message(app.get(), msg.get(), nullptr, FALSE); + + EXPECT_EVENTUALLY_ACTION_EXISTS("test.msg.messageid"); + EXPECT_ACTION_STATE("messages", blueicon); + + messaging_menu_app_unregister(app2.get()); + app2.reset(); + + EXPECT_EVENTUALLY_ACTION_DOES_NOT_EXIST("test2.msg.countsource"); + EXPECT_ACTION_STATE("messages", blueicon); + + messaging_menu_app_remove_message(app.get(), msg.get()); + + EXPECT_EVENTUALLY_ACTION_STATE("messages", normalicon); + EXPECT_ACTION_ENABLED("remove-all", false); + + messaging_menu_app_append_message(app.get(), msg.get(), nullptr, FALSE); + + EXPECT_EVENTUALLY_ACTION_STATE("messages", blueicon); + EXPECT_ACTION_ENABLED("remove-all", true); + + activateAction("remove-all"); + + EXPECT_EVENTUALLY_ACTION_STATE("messages", normalicon); +} -- cgit v1.2.3 From 5133bf06e0398d43861ac0d2b19ca9bc9a03ec1e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 10 Mar 2015 16:18:02 -0500 Subject: Pedantic use of auto --- tests/indicator-test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/indicator-test.cpp') diff --git a/tests/indicator-test.cpp b/tests/indicator-test.cpp index 8f87191..0991db5 100644 --- a/tests/indicator-test.cpp +++ b/tests/indicator-test.cpp @@ -98,7 +98,7 @@ TEST_F(IndicatorTest, SingleMessage) { static void messageReplyActivate (GObject * obj, gchar * name, GVariant * value, gpointer user_data) { - std::string * res = reinterpret_cast(user_data); + auto res = reinterpret_cast(user_data); *res = g_variant_get_string(value, nullptr); } -- cgit v1.2.3