From df1bdfb63e74219430409e2f44b53ff91391422e Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 5 May 2021 15:18:06 +0200 Subject: tests/test-dbus-fixture.h: Turn TestDBusFixture::TestDBusFixture into an explicitly declared constructor. Resolves issues like these: ``` In file included from /rootdir/tests/test-actions.cpp:22: In file included from /rootdir/tests/state-fixture.h:23: In file included from /rootdir/tests/test-dbus-fixture.h:23: In file included from /rootdir/tests/glib-fixture.h:29: In file included from /usr/include/gtest/gtest.h:62: /usr/include/gtest/internal/gtest-internal.h:472:44: error: call to implicitly-deleted default constructor of 'ActionsFixture_DesktopOpenCalendarApp_Test' Test* CreateTest() override { return new TestClass; } ^ /rootdir/tests/test-actions.cpp:188:1: note: in instantiation of member function 'testing::internal::TestFactoryImpl::CreateTest' requested here TEST_F(ActionsFixture, DesktopOpenCalendarApp) ^ /usr/include/gtest/gtest.h:2381:3: note: expanded from macro 'TEST_F' GTEST_TEST_(test_fixture, test_name, test_fixture, \ ^ /usr/include/gtest/internal/gtest-internal.h:1565:15: note: expanded from macro 'GTEST_TEST_' new ::testing::internal::TestFactoryImpl:101:1: note: expanded from here ActionsFixture_DesktopOpenCalendarApp_Test ^ /rootdir/tests/test-actions.cpp:188:1: note: default constructor of 'ActionsFixture_DesktopOpenCalendarApp_Test' is implicitly deleted because base class 'ActionsFixture' has a deleted default constructor /usr/include/gtest/gtest.h:2381:3: note: expanded from macro 'TEST_F' GTEST_TEST_(test_fixture, test_name, test_fixture, \ ^ /usr/include/gtest/internal/gtest-internal.h:1542:9: note: expanded from macro 'GTEST_TEST_' : public parent_class { \ ^ /rootdir/tests/test-actions.cpp:26:23: note: default constructor of 'ActionsFixture' is implicitly deleted because base class 'ayatana::indicator::datetime::StateFixture' has a deleted default constructor class ActionsFixture: public StateFixture ^ /rootdir/tests/state-fixture.h:36:21: note: default constructor of 'StateFixture' is implicitly deleted because base class 'TestDBusFixture' has a deleted default constructor class StateFixture: public TestDBusFixture ^ /rootdir/tests/test-dbus-fixture.h:33:5: note: explicitly defaulted function was implicitly deleted here TestDBusFixture() =default; ^ /rootdir/tests/test-dbus-fixture.h:70:36: note: default constructor of 'TestDBusFixture' is implicitly deleted because field 'service_dirs' of const-qualified type 'const std::vector' (aka 'const vector>') would not be initialized const std::vector service_dirs; ^ ``` --- tests/test-dbus-fixture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-dbus-fixture.h b/tests/test-dbus-fixture.h index a894f11..0f19b50 100644 --- a/tests/test-dbus-fixture.h +++ b/tests/test-dbus-fixture.h @@ -30,7 +30,7 @@ class TestDBusFixture: public GlibFixture { public: - TestDBusFixture() =default; + explicit TestDBusFixture() {}; virtual ~TestDBusFixture() =default; explicit TestDBusFixture(const std::vector& service_dirs_in): service_dirs(service_dirs_in) {} -- cgit v1.2.3