From 4902e8e2c7f57cd37ab7bbd7ee6363464c3d9ac3 Mon Sep 17 00:00:00 2001 From: John Maguire Date: Thu, 6 Feb 2014 18:24:46 +0100 Subject: [PATCH] Remove boost from tests. --- tests/closure_test.cpp | 9 +++++---- tests/database_test.cpp | 6 +++--- tests/librarybackend_test.cpp | 18 +++++++++--------- tests/librarymodel_test.cpp | 10 ++++++---- tests/mpris1_test.cpp | 8 +++++--- tests/playlist_test.cpp | 4 +++- tests/plsparser_test.cpp | 6 +++--- tests/songloader_test.cpp | 21 +++++++++++---------- tests/songplaylistitem_test.cpp | 7 ++++--- tests/utilities_test.cpp | 2 -- 10 files changed, 49 insertions(+), 42 deletions(-) diff --git a/tests/closure_test.cpp b/tests/closure_test.cpp index 7d8f768e9..248a9a915 100644 --- a/tests/closure_test.cpp +++ b/tests/closure_test.cpp @@ -1,12 +1,13 @@ #include "gtest/gtest.h" +#include +#include + #include #include #include #include -#include - #include "config.h" #include "core/closure.h" #include "test_utils.h" @@ -44,7 +45,7 @@ TEST(ClosureTest, ClosureDeletesSelf) { TEST(ClosureTest, ClosureDoesNotCrashWithSharedPointerSender) { TestQObject receiver; TestQObject* sender; - boost::scoped_ptr spy; + std::unique_ptr spy; QPointer<_detail::ObjectHelper> closure; { QSharedPointer sender_shared(new TestQObject); @@ -94,7 +95,7 @@ TEST(ClosureTest, ClosureWorksWithStandardFunctions) { bool called = false; int question = 42; int answer = 0; - boost::function callback(&Foo); + std::function callback(&Foo); NewClosure( &sender, SIGNAL(Emitted()), callback, &called, question, &answer); diff --git a/tests/database_test.cpp b/tests/database_test.cpp index ba95b4e44..e0235f64c 100644 --- a/tests/database_test.cpp +++ b/tests/database_test.cpp @@ -15,13 +15,13 @@ along with Clementine. If not, see . */ +#include + #include "test_utils.h" #include "gtest/gtest.h" #include "core/database.h" -#include - #include #include #include @@ -32,7 +32,7 @@ class DatabaseTest : public ::testing::Test { database_.reset(new MemoryDatabase); } - boost::scoped_ptr database_; + std::unique_ptr database_; }; TEST_F(DatabaseTest, DatabaseInitialises) { diff --git a/tests/librarybackend_test.cpp b/tests/librarybackend_test.cpp index 53fee439e..8d3f70a49 100644 --- a/tests/librarybackend_test.cpp +++ b/tests/librarybackend_test.cpp @@ -15,21 +15,21 @@ along with Clementine. If not, see . */ +#include + #include "test_utils.h" #include "gtest/gtest.h" -#include "library/librarybackend.h" -#include "library/library.h" -#include "core/song.h" -#include "core/database.h" - -#include - #include #include #include #include +#include "library/librarybackend.h" +#include "library/library.h" +#include "core/song.h" +#include "core/database.h" + namespace { class LibraryBackendTest : public ::testing::Test { @@ -53,8 +53,8 @@ class LibraryBackendTest : public ::testing::Test { return ret; } - boost::shared_ptr database_; - boost::scoped_ptr backend_; + std::shared_ptr database_; + std::unique_ptr backend_; }; TEST_F(LibraryBackendTest, EmptyDatabase) { diff --git a/tests/librarymodel_test.cpp b/tests/librarymodel_test.cpp index 7596c3a60..fc31b4e08 100644 --- a/tests/librarymodel_test.cpp +++ b/tests/librarymodel_test.cpp @@ -15,6 +15,8 @@ along with Clementine. If not, see . */ +#include + #include "test_utils.h" #include "gtest/gtest.h" @@ -70,10 +72,10 @@ class LibraryModelTest : public ::testing::Test { return AddSong(song); } - boost::shared_ptr database_; - boost::scoped_ptr backend_; - boost::scoped_ptr model_; - boost::scoped_ptr model_sorted_; + std::shared_ptr database_; + std::unique_ptr backend_; + std::unique_ptr model_; + std::unique_ptr model_sorted_; bool added_dir_; }; diff --git a/tests/mpris1_test.cpp b/tests/mpris1_test.cpp index 61a153368..6a3396132 100644 --- a/tests/mpris1_test.cpp +++ b/tests/mpris1_test.cpp @@ -15,6 +15,8 @@ along with Clementine. If not, see . */ +#include + #include "core/encoding.h" #include "core/mpris1.h" #include "core/song.h" @@ -64,14 +66,14 @@ protected: MockPlayer player_; MockPlaylistManager playlists_; - boost::scoped_ptr sequence_; + std::unique_ptr sequence_; }; TEST_F(Mpris1BasicTest, CreatesDBusService) { EXPECT_FALSE(QDBusConnection::sessionBus().interface()-> isServiceRegistered(service_name())); - boost::scoped_ptr mpris( + std::unique_ptr mpris( new mpris::Mpris1(&player_, NULL, NULL, service_name())); EXPECT_TRUE(QDBusConnection::sessionBus().interface()-> isServiceRegistered(service_name())); @@ -90,7 +92,7 @@ protected: mpris_.reset(new mpris::Mpris1(&player_, NULL, NULL, service_name())); } - boost::scoped_ptr mpris_; + std::unique_ptr mpris_; }; TEST_F(Mpris1Test, CorrectNameAndVersion) { diff --git a/tests/playlist_test.cpp b/tests/playlist_test.cpp index a55de6b54..98dcdb4af 100644 --- a/tests/playlist_test.cpp +++ b/tests/playlist_test.cpp @@ -15,6 +15,8 @@ along with Clementine. If not, see . */ +#include + #include "test_utils.h" #include "gtest/gtest.h" @@ -26,7 +28,7 @@ #include #include -using boost::shared_ptr; +using std::shared_ptr; using ::testing::Return; namespace { diff --git a/tests/plsparser_test.cpp b/tests/plsparser_test.cpp index 691895563..c92f1da02 100644 --- a/tests/plsparser_test.cpp +++ b/tests/plsparser_test.cpp @@ -15,6 +15,8 @@ along with Clementine. If not, see . */ +#include + #include "test_utils.h" #include "gtest/gtest.h" @@ -27,9 +29,7 @@ #include #include -#include - -using boost::shared_ptr; +using std::shared_ptr; class PLSParserTest : public ::testing::Test { protected: diff --git a/tests/songloader_test.cpp b/tests/songloader_test.cpp index dbbff390b..2bab9f585 100644 --- a/tests/songloader_test.cpp +++ b/tests/songloader_test.cpp @@ -15,13 +15,7 @@ along with Clementine. If not, see . */ -#include "test_utils.h" -#include "gmock/gmock-matchers.h" -#include "gtest/gtest.h" -#include "mock_librarybackend.h" - -#include "core/songloader.h" -#include "engines/gstengine.h" +#include #include #include @@ -29,9 +23,16 @@ #include #include -#include #include +#include "test_utils.h" +#include "gmock/gmock-matchers.h" +#include "gtest/gtest.h" +#include "mock_librarybackend.h" + +#include "core/songloader.h" +#include "engines/gstengine.h" + using ::testing::_; using ::testing::Return; @@ -63,8 +64,8 @@ protected: static const char* kRemoteUrl; static GstEngine* sGstEngine; - boost::scoped_ptr loader_; - boost::scoped_ptr library_; + std::unique_ptr loader_; + std::unique_ptr library_; }; const char* SongLoaderTest::kRemoteUrl = "http://remotetestdata.clementine-player.org"; diff --git a/tests/songplaylistitem_test.cpp b/tests/songplaylistitem_test.cpp index 7dee583f7..3d603686f 100644 --- a/tests/songplaylistitem_test.cpp +++ b/tests/songplaylistitem_test.cpp @@ -15,11 +15,12 @@ along with Clementine. If not, see . */ +#include + #include "playlist/songplaylistitem.h" #include "test_utils.h" #include -#include #include #include @@ -30,7 +31,7 @@ namespace { class SongPlaylistItemTest : public ::testing::TestWithParam { protected: SongPlaylistItemTest() : temp_file_(GetParam()) {} - + void SetUp() { // SongPlaylistItem::Url() checks if the file exists, so we need a real file temp_file_.open(); @@ -49,7 +50,7 @@ class SongPlaylistItemTest : public ::testing::TestWithParam { Song song_; QTemporaryFile temp_file_; QString absolute_file_name_; - boost::scoped_ptr item_; + std::unique_ptr item_; }; INSTANTIATE_TEST_CASE_P(RealFiles, SongPlaylistItemTest, testing::Values( diff --git a/tests/utilities_test.cpp b/tests/utilities_test.cpp index 40b07773b..85d60bab2 100644 --- a/tests/utilities_test.cpp +++ b/tests/utilities_test.cpp @@ -21,8 +21,6 @@ #include "core/utilities.h" -#include - #include TEST(UtilitiesTest, HmacFunctions) {