test/*: use class EventThread instead of ScopeIOThread

This commit is contained in:
Max Kellermann
2017-02-10 22:14:07 +01:00
parent 115af4f565
commit d1456ae039
10 changed files with 37 additions and 83 deletions

View File

@@ -19,7 +19,7 @@
#include "config.h"
#include "Log.hxx"
#include "ScopeIOThread.hxx"
#include "event/Thread.hxx"
#include "storage/Registry.hxx"
#include "storage/StorageInterface.hxx"
#include "storage/FileInfo.hxx"
@@ -34,9 +34,9 @@
#include <time.h>
static Storage *
MakeStorage(const char *uri)
MakeStorage(EventLoop &event_loop, const char *uri)
{
Storage *storage = CreateStorageURI(io_thread_get(), uri);
Storage *storage = CreateStorageURI(event_loop, uri);
if (storage == nullptr)
throw std::runtime_error("Unrecognized storage URI");
@@ -95,7 +95,8 @@ try {
const char *const command = argv[1];
const char *const storage_uri = argv[2];
const ScopeIOThread io_thread;
EventThread io_thread;
io_thread.Start();
if (strcmp(command, "ls") == 0) {
if (argc != 4) {
@@ -105,7 +106,8 @@ try {
const char *const path = argv[3];
std::unique_ptr<Storage> storage(MakeStorage(storage_uri));
std::unique_ptr<Storage> storage(MakeStorage(io_thread.GetEventLoop(),
storage_uri));
return Ls(*storage, path);
} else {