aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-30 22:00:32 +0100
committerMax Kellermann <max@duempel.org>2013-01-30 22:20:14 +0100
commitd9ea3082fb608935c72620e272f4b3e74b2c3a44 (patch)
tree5353513725721f49c0296520b0f55f760dacf8a5 /test
parent2d63c26936b2b9acfb8f2f81a109e4aff0b26fe7 (diff)
downloadmpd-d9ea3082fb608935c72620e272f4b3e74b2c3a44.tar.gz
mpd-d9ea3082fb608935c72620e272f4b3e74b2c3a44.tar.xz
mpd-d9ea3082fb608935c72620e272f4b3e74b2c3a44.zip
ConfigData: add constructors/destructors
Diffstat (limited to '')
-rw-r--r--test/DumpDatabase.cxx9
-rw-r--r--test/run_encoder.cxx7
-rw-r--r--test/test_vorbis_encoder.cxx6
3 files changed, 10 insertions, 12 deletions
diff --git a/test/DumpDatabase.cxx b/test/DumpDatabase.cxx
index 501c80206..172d00491 100644
--- a/test/DumpDatabase.cxx
+++ b/test/DumpDatabase.cxx
@@ -106,13 +106,12 @@ main(int argc, char **argv)
/* do it */
const struct config_param *path = config_get_param(CONF_DB_FILE);
- struct config_param *param = config_new_param("database", path->line);
+ config_param param("database", path->line);
if (path != nullptr)
- config_add_block_param(param, "path", path->value, path->line);
+ config_add_block_param(&param, "path", path->value,
+ path->line);
- Database *db = plugin->create(param, &error);
-
- config_param_free(param);
+ Database *db = plugin->create(&param, &error);
if (db == nullptr) {
cerr << error->message << endl;
diff --git a/test/run_encoder.cxx b/test/run_encoder.cxx
index 3d500d0b2..e2ecab583 100644
--- a/test/run_encoder.cxx
+++ b/test/run_encoder.cxx
@@ -49,7 +49,6 @@ int main(int argc, char **argv)
const char *encoder_name;
const struct encoder_plugin *plugin;
struct encoder *encoder;
- struct config_param *param;
static char buffer[32768];
/* parse command line */
@@ -74,10 +73,10 @@ int main(int argc, char **argv)
return 1;
}
- param = config_new_param(NULL, -1);
- config_add_block_param(param, "quality", "5.0", -1);
+ config_param param;
+ config_add_block_param(&param, "quality", "5.0", -1);
- encoder = encoder_init(plugin, param, &error);
+ encoder = encoder_init(plugin, &param, &error);
if (encoder == NULL) {
g_printerr("Failed to initialize encoder: %s\n",
error->message);
diff --git a/test/test_vorbis_encoder.cxx b/test/test_vorbis_encoder.cxx
index 887fd1a77..aad48acde 100644
--- a/test/test_vorbis_encoder.cxx
+++ b/test/test_vorbis_encoder.cxx
@@ -53,10 +53,10 @@ main(G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv)
const struct encoder_plugin *plugin = encoder_plugin_get("vorbis");
assert(plugin != NULL);
- struct config_param *param = config_new_param(NULL, -1);
- config_add_block_param(param, "quality", "5.0", -1);
+ config_param param;
+ config_add_block_param(&param, "quality", "5.0", -1);
- struct encoder *encoder = encoder_init(plugin, param, NULL);
+ struct encoder *encoder = encoder_init(plugin, &param, NULL);
assert(encoder != NULL);
/* open the encoder */