storage/Plugin: return std::unique_ptr<Storage>
This commit is contained in:
@@ -34,10 +34,10 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
static Storage *
|
||||
static std::unique_ptr<Storage>
|
||||
MakeStorage(EventLoop &event_loop, const char *uri)
|
||||
{
|
||||
Storage *storage = CreateStorageURI(event_loop, uri);
|
||||
auto storage = CreateStorageURI(event_loop, uri);
|
||||
if (storage == nullptr)
|
||||
throw std::runtime_error("Unrecognized storage URI");
|
||||
|
||||
@@ -108,8 +108,8 @@ try {
|
||||
|
||||
const char *const path = argv[3];
|
||||
|
||||
std::unique_ptr<Storage> storage(MakeStorage(io_thread.GetEventLoop(),
|
||||
storage_uri));
|
||||
auto storage = MakeStorage(io_thread.GetEventLoop(),
|
||||
storage_uri);
|
||||
|
||||
return Ls(*storage, path);
|
||||
} else {
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include "ls.hxx"
|
||||
#include "Log.hxx"
|
||||
#include "db/DatabaseSong.hxx"
|
||||
#include "storage/StorageInterface.hxx"
|
||||
#include "storage/plugins/LocalStorage.hxx"
|
||||
#include "Mapper.hxx"
|
||||
#include "util/ChronoUtil.hxx"
|
||||
@@ -309,7 +310,8 @@ CPPUNIT_TEST_SUITE_REGISTRATION(TranslateSongTest);
|
||||
int
|
||||
main(gcc_unused int argc, gcc_unused char **argv)
|
||||
{
|
||||
storage = CreateLocalStorage(Path::FromFS(music_directory));
|
||||
auto _storage = CreateLocalStorage(Path::FromFS(music_directory));
|
||||
storage = _storage.get();
|
||||
|
||||
CppUnit::TextUi::TestRunner runner;
|
||||
auto ®istry = CppUnit::TestFactoryRegistry::getRegistry();
|
||||
|
Reference in New Issue
Block a user