From cf6281a5a758e4b93d67f7fd5804a8cff60ddbf9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 1 Feb 2014 00:26:34 +0100 Subject: Instance: add Database attribute Move from db/DatabaseGlue.cxx, eliminating global variable. --- test/test_translate_song.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'test') 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(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(1)); + const SongLoader loader(*reinterpret_cast(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(1); const SongLoader secure_loader(&db); - const SongLoader insecure_loader(reinterpret_cast(1), &db); + const SongLoader insecure_loader(*reinterpret_cast(1), + &db); /* map to music_directory */ DetachedSong song1("bar.ogg", MakeTag2b()); -- cgit v1.2.3