summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-04-02 16:40:18 +0200
committerMax Kellermann <max@musicpd.org>2020-04-02 17:16:05 +0200
commit9c66b0414a02ff03fcf3c122dbeb83d8017ff1b8 (patch)
tree0145bb57656e208ede8e102059804ad0eb17ecca /test
parent4d453a8313c1eab29880666f3e34164c4e73d35c (diff)
test/*: fix Windows build using class FromNarrowPath
Diffstat (limited to 'test')
-rw-r--r--test/ContainerScan.cxx3
-rw-r--r--test/DumpDatabase.cxx3
-rw-r--r--test/ReadApeTags.cxx3
-rw-r--r--test/WriteFile.cxx3
-rw-r--r--test/dump_playlist.cxx3
-rw-r--r--test/read_conf.cxx4
-rw-r--r--test/read_tags.cxx9
-rw-r--r--test/run_decoder.cxx7
-rw-r--r--test/run_filter.cxx3
-rw-r--r--test/run_gunzip.cxx3
-rw-r--r--test/run_input.cxx5
-rw-r--r--test/run_output.cxx3
12 files changed, 30 insertions, 19 deletions
diff --git a/test/ContainerScan.cxx b/test/ContainerScan.cxx
index 6512ba9cb..ac1fca3d3 100644
--- a/test/ContainerScan.cxx
+++ b/test/ContainerScan.cxx
@@ -23,6 +23,7 @@
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
#include "fs/Path.hxx"
+#include "fs/NarrowPath.hxx"
#include "fs/io/StdioOutputStream.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "util/UriUtil.hxx"
@@ -63,7 +64,7 @@ try {
return EXIT_FAILURE;
}
- const Path path = Path::FromFS(argv[1]);
+ const FromNarrowPath path = argv[1];
const ScopeDecoderPluginsInit decoder_plugins_init({});
diff --git a/test/DumpDatabase.cxx b/test/DumpDatabase.cxx
index 76315c133..39801baf2 100644
--- a/test/DumpDatabase.cxx
+++ b/test/DumpDatabase.cxx
@@ -29,6 +29,7 @@
#include "ConfigGlue.hxx"
#include "tag/Config.hxx"
#include "fs/Path.hxx"
+#include "fs/NarrowPath.hxx"
#include "event/Thread.hxx"
#include "util/ScopeExit.hxx"
#include "util/PrintException.hxx"
@@ -107,7 +108,7 @@ try {
return 1;
}
- const Path config_path = Path::FromFS(argv[1]);
+ const FromNarrowPath config_path = argv[1];
const char *const plugin_name = argv[2];
const DatabasePlugin *plugin = GetDatabasePluginByName(plugin_name);
diff --git a/test/ReadApeTags.cxx b/test/ReadApeTags.cxx
index 7afba2b49..028874edc 100644
--- a/test/ReadApeTags.cxx
+++ b/test/ReadApeTags.cxx
@@ -21,6 +21,7 @@
#include "tag/ApeLoader.hxx"
#include "thread/Mutex.hxx"
#include "fs/Path.hxx"
+#include "fs/NarrowPath.hxx"
#include "input/InputStream.hxx"
#include "input/LocalOpen.hxx"
#include "util/StringView.hxx"
@@ -58,7 +59,7 @@ try {
return EXIT_FAILURE;
}
- const Path path = Path::FromFS(argv[1]);
+ const FromNarrowPath path = argv[1];
Mutex mutex;
diff --git a/test/WriteFile.cxx b/test/WriteFile.cxx
index 9cba451e9..1feeed1d8 100644
--- a/test/WriteFile.cxx
+++ b/test/WriteFile.cxx
@@ -18,6 +18,7 @@
*/
#include "fs/io/FileOutputStream.hxx"
+#include "fs/NarrowPath.hxx"
#include "util/PrintException.hxx"
#include <unistd.h>
@@ -54,7 +55,7 @@ try {
return EXIT_FAILURE;
}
- const Path path = Path::FromFS(argv[1]);
+ const FromNarrowPath path = argv[1];
FileOutputStream fos(path);
diff --git a/test/dump_playlist.cxx b/test/dump_playlist.cxx
index c4aea7de8..ea3be3a3f 100644
--- a/test/dump_playlist.cxx
+++ b/test/dump_playlist.cxx
@@ -28,6 +28,7 @@
#include "playlist/PlaylistRegistry.hxx"
#include "playlist/PlaylistPlugin.hxx"
#include "fs/Path.hxx"
+#include "fs/NarrowPath.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/StdioOutputStream.hxx"
#include "thread/Cond.hxx"
@@ -54,7 +55,7 @@ try {
return EXIT_FAILURE;
}
- const Path config_path = Path::FromFS(argv[1]);
+ const FromNarrowPath config_path = argv[1];
uri = argv[2];
/* initialize MPD */
diff --git a/test/read_conf.cxx b/test/read_conf.cxx
index f6a8019e7..0f9873056 100644
--- a/test/read_conf.cxx
+++ b/test/read_conf.cxx
@@ -21,7 +21,7 @@
#include "config/Param.hxx"
#include "config/File.hxx"
#include "fs/Path.hxx"
-#include "fs/Path.hxx"
+#include "fs/NarrowPath.hxx"
#include "util/PrintException.hxx"
#include "util/RuntimeError.hxx"
@@ -36,7 +36,7 @@ try {
return EXIT_FAILURE;
}
- const Path config_path = Path::FromFS(argv[1]);
+ const FromNarrowPath config_path = argv[1];
const char *name = argv[2];
const auto option = ParseConfigOptionName(name);
diff --git a/test/read_tags.cxx b/test/read_tags.cxx
index a8ab2a061..7c392dc2b 100644
--- a/test/read_tags.cxx
+++ b/test/read_tags.cxx
@@ -27,6 +27,7 @@
#include "tag/Handler.hxx"
#include "tag/Generic.hxx"
#include "fs/Path.hxx"
+#include "fs/NarrowPath.hxx"
#include "AudioFormat.hxx"
#include "util/ScopeExit.hxx"
#include "util/StringBuffer.hxx"
@@ -88,7 +89,7 @@ try {
}
decoder_name = argv[1];
- const Path path = Path::FromFS(argv[2]);
+ const char *path = argv[2];
EventThread io_thread;
io_thread.Start();
@@ -107,7 +108,7 @@ try {
DumpTagHandler h;
bool success;
try {
- success = plugin->ScanFile(path, h);
+ success = plugin->ScanFile(FromNarrowPath(path), h);
} catch (...) {
PrintException(std::current_exception());
success = false;
@@ -117,7 +118,7 @@ try {
InputStreamPtr is;
if (!success && plugin->scan_stream != NULL) {
- is = InputStream::OpenReady(path.c_str(), mutex);
+ is = InputStream::OpenReady(path, mutex);
success = plugin->ScanStream(*is, h);
}
@@ -130,7 +131,7 @@ try {
if (is)
ScanGenericTags(*is, h);
else
- ScanGenericTags(path, h);
+ ScanGenericTags(FromNarrowPath(path), h);
}
return 0;
diff --git a/test/run_decoder.cxx b/test/run_decoder.cxx
index f7e3d6739..8d78534da 100644
--- a/test/run_decoder.cxx
+++ b/test/run_decoder.cxx
@@ -26,6 +26,7 @@
#include "input/Init.hxx"
#include "input/InputStream.hxx"
#include "fs/Path.hxx"
+#include "fs/NarrowPath.hxx"
#include "AudioFormat.hxx"
#include "util/OptionDef.hxx"
#include "util/OptionParser.hxx"
@@ -44,7 +45,7 @@ struct CommandLine {
const char *decoder = nullptr;
const char *uri = nullptr;
- Path config_path = nullptr;
+ FromNarrowPath config_path;
bool verbose = false;
};
@@ -68,7 +69,7 @@ ParseCommandLine(int argc, char **argv)
while (auto o = option_parser.Next()) {
switch (Option(o.index)) {
case OPTION_CONFIG:
- c.config_path = Path::FromFS(o.value);
+ c.config_path = o.value;
break;
case OPTION_VERBOSE:
@@ -118,7 +119,7 @@ try {
DumpDecoderClient client;
if (plugin->file_decode != nullptr) {
try {
- plugin->FileDecode(client, Path::FromFS(c.uri));
+ plugin->FileDecode(client, FromNarrowPath(c.uri));
} catch (StopDecoder) {
}
} else if (plugin->stream_decode != nullptr) {
diff --git a/test/run_filter.cxx b/test/run_filter.cxx
index 31452f440..5a70d6828 100644
--- a/test/run_filter.cxx
+++ b/test/run_filter.cxx
@@ -19,6 +19,7 @@
#include "ConfigGlue.hxx"
#include "fs/Path.hxx"
+#include "fs/NarrowPath.hxx"
#include "AudioParser.hxx"
#include "AudioFormat.hxx"
#include "filter/LoadOne.hxx"
@@ -68,7 +69,7 @@ try {
return EXIT_FAILURE;
}
- const Path config_path = Path::FromFS(argv[1]);
+ const FromNarrowPath config_path = argv[1];
AudioFormat audio_format(44100, SampleFormat::S16, 2);
diff --git a/test/run_gunzip.cxx b/test/run_gunzip.cxx
index f8a0e618e..3a8619836 100644
--- a/test/run_gunzip.cxx
+++ b/test/run_gunzip.cxx
@@ -20,6 +20,7 @@
#include "fs/io/GunzipReader.hxx"
#include "fs/io/FileReader.hxx"
#include "fs/io/StdioOutputStream.hxx"
+#include "fs/NarrowPath.hxx"
#include "util/PrintException.hxx"
#include <stdio.h>
@@ -62,7 +63,7 @@ try {
return EXIT_FAILURE;
}
- Path path = Path::FromFS(argv[1]);
+ FromNarrowPath path = argv[1];
CopyGunzip(stdout, path);
return EXIT_SUCCESS;
diff --git a/test/run_input.cxx b/test/run_input.cxx
index e5deafda8..a3b5e7277 100644
--- a/test/run_input.cxx
+++ b/test/run_input.cxx
@@ -32,6 +32,7 @@
#include "Log.hxx"
#include "LogBackend.hxx"
#include "fs/Path.hxx"
+#include "fs/NarrowPath.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/StdioOutputStream.hxx"
#include "util/ConstBuffer.hxx"
@@ -51,7 +52,7 @@
struct CommandLine {
const char *uri = nullptr;
- Path config_path = nullptr;
+ FromNarrowPath config_path;
bool verbose = false;
@@ -79,7 +80,7 @@ ParseCommandLine(int argc, char **argv)
while (auto o = option_parser.Next()) {
switch (Option(o.index)) {
case OPTION_CONFIG:
- c.config_path = Path::FromFS(o.value);
+ c.config_path = o.value;
break;
case OPTION_VERBOSE:
diff --git a/test/run_output.cxx b/test/run_output.cxx
index c69e8f67b..d6fc0ada6 100644
--- a/test/run_output.cxx
+++ b/test/run_output.cxx
@@ -23,6 +23,7 @@
#include "ConfigGlue.hxx"
#include "event/Thread.hxx"
#include "fs/Path.hxx"
+#include "fs/NarrowPath.hxx"
#include "AudioParser.hxx"
#include "pcm/PcmConvert.hxx"
#include "util/StringBuffer.hxx"
@@ -111,7 +112,7 @@ try {
return EXIT_FAILURE;
}
- const Path config_path = Path::FromFS(argv[1]);
+ const FromNarrowPath config_path = argv[1];
AudioFormat audio_format(44100, SampleFormat::S16, 2);