Use std::make_unique

This commit is contained in:
Jonas Kvinge
2021-06-21 15:40:25 +02:00
parent 99ba2c2e8b
commit ed09627fdb
21 changed files with 52 additions and 30 deletions

View File

@@ -45,7 +45,7 @@ class CollectionBackendTest : public ::testing::Test {
protected:
void SetUp() override {
database_.reset(new MemoryDatabase(nullptr));
backend_.reset(new CollectionBackend);
backend_ = std::make_unique<CollectionBackend>();
backend_->Init(database_.get(), Song::Source_Collection, SCollection::kSongsTable, SCollection::kDirsTable, SCollection::kSubdirsTable, SCollection::kFtsTable);
}

View File

@@ -49,7 +49,7 @@ class SongPlaylistItemTest : public ::testing::TestWithParam<const char*> {
song_.Init("Title", "Artist", "Album", 123);
song_.set_url(QUrl::fromLocalFile(absolute_file_name_));
item_.reset(new SongPlaylistItem(song_));
item_ = std::make_unique<SongPlaylistItem>(song_);
if (!absolute_file_name_.startsWith('/'))
absolute_file_name_.prepend('/');