mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-29 02:29:56 +01:00
Remove boost from tests.
This commit is contained in:
parent
1ac3f53a89
commit
4902e8e2c7
@ -1,12 +1,13 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QPointer>
|
||||
#include <QSharedPointer>
|
||||
#include <QSignalSpy>
|
||||
|
||||
#include <boost/function.hpp>
|
||||
|
||||
#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<QSignalSpy> spy;
|
||||
std::unique_ptr<QSignalSpy> spy;
|
||||
QPointer<_detail::ObjectHelper> closure;
|
||||
{
|
||||
QSharedPointer<TestQObject> sender_shared(new TestQObject);
|
||||
@ -94,7 +95,7 @@ TEST(ClosureTest, ClosureWorksWithStandardFunctions) {
|
||||
bool called = false;
|
||||
int question = 42;
|
||||
int answer = 0;
|
||||
boost::function<void(bool*,int,int*)> callback(&Foo);
|
||||
std::function<void(bool*,int,int*)> callback(&Foo);
|
||||
NewClosure(
|
||||
&sender, SIGNAL(Emitted()),
|
||||
callback, &called, question, &answer);
|
||||
|
@ -15,13 +15,13 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "test_utils.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "core/database.h"
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include <QtDebug>
|
||||
#include <QSqlQuery>
|
||||
#include <QVariant>
|
||||
@ -32,7 +32,7 @@ class DatabaseTest : public ::testing::Test {
|
||||
database_.reset(new MemoryDatabase);
|
||||
}
|
||||
|
||||
boost::scoped_ptr<Database> database_;
|
||||
std::unique_ptr<Database> database_;
|
||||
};
|
||||
|
||||
TEST_F(DatabaseTest, DatabaseInitialises) {
|
||||
|
@ -15,21 +15,21 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#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 <boost/scoped_ptr.hpp>
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QSignalSpy>
|
||||
#include <QThread>
|
||||
#include <QtDebug>
|
||||
|
||||
#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> database_;
|
||||
boost::scoped_ptr<LibraryBackend> backend_;
|
||||
std::shared_ptr<Database> database_;
|
||||
std::unique_ptr<LibraryBackend> backend_;
|
||||
};
|
||||
|
||||
TEST_F(LibraryBackendTest, EmptyDatabase) {
|
||||
|
@ -15,6 +15,8 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "test_utils.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
@ -70,10 +72,10 @@ class LibraryModelTest : public ::testing::Test {
|
||||
return AddSong(song);
|
||||
}
|
||||
|
||||
boost::shared_ptr<Database> database_;
|
||||
boost::scoped_ptr<LibraryBackend> backend_;
|
||||
boost::scoped_ptr<LibraryModel> model_;
|
||||
boost::scoped_ptr<QSortFilterProxyModel> model_sorted_;
|
||||
std::shared_ptr<Database> database_;
|
||||
std::unique_ptr<LibraryBackend> backend_;
|
||||
std::unique_ptr<LibraryModel> model_;
|
||||
std::unique_ptr<QSortFilterProxyModel> model_sorted_;
|
||||
|
||||
bool added_dir_;
|
||||
};
|
||||
|
@ -15,6 +15,8 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "core/encoding.h"
|
||||
#include "core/mpris1.h"
|
||||
#include "core/song.h"
|
||||
@ -64,14 +66,14 @@ protected:
|
||||
MockPlayer player_;
|
||||
MockPlaylistManager playlists_;
|
||||
|
||||
boost::scoped_ptr<PlaylistSequence> sequence_;
|
||||
std::unique_ptr<PlaylistSequence> sequence_;
|
||||
};
|
||||
|
||||
TEST_F(Mpris1BasicTest, CreatesDBusService) {
|
||||
EXPECT_FALSE(QDBusConnection::sessionBus().interface()->
|
||||
isServiceRegistered(service_name()));
|
||||
|
||||
boost::scoped_ptr<mpris::Mpris1> mpris(
|
||||
std::unique_ptr<mpris::Mpris1> 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::Mpris1> mpris_;
|
||||
std::unique_ptr<mpris::Mpris1> mpris_;
|
||||
};
|
||||
|
||||
TEST_F(Mpris1Test, CorrectNameAndVersion) {
|
||||
|
@ -15,6 +15,8 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "test_utils.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
@ -26,7 +28,7 @@
|
||||
#include <QtDebug>
|
||||
#include <QUndoStack>
|
||||
|
||||
using boost::shared_ptr;
|
||||
using std::shared_ptr;
|
||||
using ::testing::Return;
|
||||
|
||||
namespace {
|
||||
|
@ -15,6 +15,8 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "test_utils.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
@ -27,9 +29,7 @@
|
||||
#include <QUrl>
|
||||
#include <QtDebug>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
using boost::shared_ptr;
|
||||
using std::shared_ptr;
|
||||
|
||||
class PLSParserTest : public ::testing::Test {
|
||||
protected:
|
||||
|
@ -15,13 +15,7 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#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 <memory>
|
||||
|
||||
#include <QBuffer>
|
||||
#include <QDir>
|
||||
@ -29,9 +23,16 @@
|
||||
#include <QSignalSpy>
|
||||
#include <QtDebug>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <cstdlib>
|
||||
|
||||
#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<SongLoader> loader_;
|
||||
boost::scoped_ptr<MockLibraryBackend> library_;
|
||||
std::unique_ptr<SongLoader> loader_;
|
||||
std::unique_ptr<MockLibraryBackend> library_;
|
||||
};
|
||||
|
||||
const char* SongLoaderTest::kRemoteUrl = "http://remotetestdata.clementine-player.org";
|
||||
|
@ -15,11 +15,12 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "playlist/songplaylistitem.h"
|
||||
#include "test_utils.h"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include <QTemporaryFile>
|
||||
#include <QFileInfo>
|
||||
@ -30,7 +31,7 @@ namespace {
|
||||
class SongPlaylistItemTest : public ::testing::TestWithParam<const char*> {
|
||||
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<const char*> {
|
||||
Song song_;
|
||||
QTemporaryFile temp_file_;
|
||||
QString absolute_file_name_;
|
||||
boost::scoped_ptr<SongPlaylistItem> item_;
|
||||
std::unique_ptr<SongPlaylistItem> item_;
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(RealFiles, SongPlaylistItemTest, testing::Values(
|
||||
|
@ -21,8 +21,6 @@
|
||||
|
||||
#include "core/utilities.h"
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
TEST(UtilitiesTest, HmacFunctions) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user