summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-01 00:26:34 +0100
committerMax Kellermann <max@duempel.org>2014-02-04 11:22:33 +0100
commitcf6281a5a758e4b93d67f7fd5804a8cff60ddbf9 (patch)
tree7368011b1ecf5ae6db6dcafb676fddf03ff9d823 /test
parentf00710a57e80738c33255eaa1347ab776fbce869 (diff)
Instance: add Database attribute
Move from db/DatabaseGlue.cxx, eliminating global variable.
Diffstat (limited to 'test')
-rw-r--r--test/test_translate_song.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/test_translate_song.cxx b/test/test_translate_song.cxx
index 3c94ed4bc..bc1ae82d6 100644
--- a/test/test_translate_song.cxx
+++ b/test/test_translate_song.cxx
@@ -137,6 +137,12 @@ DetachedSong::Update()
return false;
}
+const Database *
+Client::GetDatabase(gcc_unused Error &error) const
+{
+ return reinterpret_cast<const Database *>(this);
+}
+
bool
Client::AllowFile(gcc_unused Path path_fs, gcc_unused Error &error) const
{
@@ -220,7 +226,7 @@ class TranslateSongTest : public CppUnit::TestFixture {
void TestInsecure() {
/* illegal because secure=false */
DetachedSong song1 (uri1);
- const SongLoader loader(reinterpret_cast<const Client *>(1));
+ const SongLoader loader(*reinterpret_cast<const Client *>(1));
CPPUNIT_ASSERT(!playlist_check_translate_song(song1, nullptr,
loader));
}
@@ -261,7 +267,8 @@ class TranslateSongTest : public CppUnit::TestFixture {
void TestRelative() {
const Database &db = *reinterpret_cast<const Database *>(1);
const SongLoader secure_loader(&db);
- const SongLoader insecure_loader(reinterpret_cast<const Client *>(1), &db);
+ const SongLoader insecure_loader(*reinterpret_cast<const Client *>(1),
+ &db);
/* map to music_directory */
DetachedSong song1("bar.ogg", MakeTag2b());