diff options
author | Max Kellermann <max@duempel.org> | 2013-01-29 17:23:35 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-29 18:09:39 +0100 |
commit | feb8d5b82f3e7c67806d5efbef1e0b86170ec6dd (patch) | |
tree | 8127b30bc339eae03226f3e97ea8ac99f62587b3 /test | |
parent | eb8922f3468fe664211911c49077a4e3442b7703 (diff) | |
download | mpd-feb8d5b82f3e7c67806d5efbef1e0b86170ec6dd.tar.gz mpd-feb8d5b82f3e7c67806d5efbef1e0b86170ec6dd.tar.xz mpd-feb8d5b82f3e7c67806d5efbef1e0b86170ec6dd.zip |
ConfigFile, CommandLine: use the Path class
Diffstat (limited to 'test')
-rw-r--r-- | test/DumpDatabase.cxx | 5 | ||||
-rw-r--r-- | test/dump_playlist.cxx | 6 | ||||
-rw-r--r-- | test/read_conf.cxx | 6 | ||||
-rw-r--r-- | test/run_filter.cxx | 6 | ||||
-rw-r--r-- | test/run_output.cxx | 6 |
5 files changed, 17 insertions, 12 deletions
diff --git a/test/DumpDatabase.cxx b/test/DumpDatabase.cxx index ea0ebb44c..501c80206 100644 --- a/test/DumpDatabase.cxx +++ b/test/DumpDatabase.cxx @@ -26,6 +26,7 @@ #include "PlaylistVector.hxx" #include "conf.h" #include "tag.h" +#include "fs/Path.hxx" #include <iostream> using std::cout; @@ -76,7 +77,7 @@ main(int argc, char **argv) return 1; } - const char *const config_path = argv[1]; + const Path config_path = Path::FromFS(argv[1]); const char *const plugin_name = argv[2]; const DatabasePlugin *plugin = GetDatabasePluginByName(plugin_name); @@ -94,7 +95,7 @@ main(int argc, char **argv) config_global_init(); - if (!config_read_file(config_path, &error)) { + if (!ReadConfigFile(config_path, &error)) { cerr << error->message << endl; g_error_free(error); return EXIT_FAILURE; diff --git a/test/dump_playlist.cxx b/test/dump_playlist.cxx index 175a407ec..ec09bcb29 100644 --- a/test/dump_playlist.cxx +++ b/test/dump_playlist.cxx @@ -28,6 +28,7 @@ #include "IOThread.hxx" #include "PlaylistRegistry.hxx" #include "PlaylistPlugin.hxx" +#include "fs/Path.hxx" extern "C" { #include "decoder_list.h" @@ -141,7 +142,6 @@ int main(int argc, char **argv) { const char *uri; struct input_stream *is = NULL; - bool success; GError *error = NULL; struct playlist_provider *playlist; struct song *song; @@ -151,6 +151,7 @@ int main(int argc, char **argv) return 1; } + const Path config_path = Path::FromFS(argv[1]); uri = argv[2]; /* initialize GLib */ @@ -161,8 +162,7 @@ int main(int argc, char **argv) /* initialize MPD */ config_global_init(); - success = config_read_file(argv[1], &error); - if (!success) { + if (!ReadConfigFile(config_path, &error)) { g_printerr("%s\n", error->message); g_error_free(error); return 1; diff --git a/test/read_conf.cxx b/test/read_conf.cxx index 859c8949d..a9135d892 100644 --- a/test/read_conf.cxx +++ b/test/read_conf.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "conf.h" +#include "fs/Path.hxx" #include <glib.h> @@ -42,7 +43,7 @@ int main(int argc, char **argv) return 1; } - const char *path = argv[1]; + const Path config_path = Path::FromFS(argv[1]); const char *name = argv[2]; g_log_set_default_handler(my_log_func, NULL); @@ -50,8 +51,7 @@ int main(int argc, char **argv) config_global_init(); GError *error = NULL; - bool success = config_read_file(path, &error); - if (!success) { + if (!ReadConfigFile(config_path, &error)) { g_printerr("%s:", error->message); g_error_free(error); return 1; diff --git a/test/run_filter.cxx b/test/run_filter.cxx index 990a57df0..b05e458aa 100644 --- a/test/run_filter.cxx +++ b/test/run_filter.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "conf.h" +#include "fs/Path.hxx" extern "C" { #include "audio_parser.h" @@ -107,6 +108,8 @@ int main(int argc, char **argv) return 1; } + const Path config_path = Path::FromFS(argv[1]); + audio_format_init(&audio_format, 44100, SAMPLE_FORMAT_S16, 2); /* initialize GLib */ @@ -117,8 +120,7 @@ int main(int argc, char **argv) /* read configuration file (mpd.conf) */ config_global_init(); - success = config_read_file(argv[1], &error); - if (!success) { + if (!ReadConfigFile(config_path, &error)) { g_printerr("%s:", error->message); g_error_free(error); return 1; diff --git a/test/run_output.cxx b/test/run_output.cxx index 505423479..38f24fe5f 100644 --- a/test/run_output.cxx +++ b/test/run_output.cxx @@ -25,6 +25,7 @@ #include "event/Loop.hxx" #include "GlobalEvents.hxx" #include "IOThread.hxx" +#include "fs/Path.hxx" extern "C" { #include "output_plugin.h" @@ -201,6 +202,8 @@ int main(int argc, char **argv) return 1; } + const Path config_path = Path::FromFS(argv[1]); + audio_format_init(&audio_format, 44100, SAMPLE_FORMAT_S16, 2); g_thread_init(NULL); @@ -208,8 +211,7 @@ int main(int argc, char **argv) /* read configuration file (mpd.conf) */ config_global_init(); - success = config_read_file(argv[1], &error); - if (!success) { + if (!ReadConfigFile(config_path, &error)) { g_printerr("%s:", error->message); g_error_free(error); return 1; |