diff --git a/tests/test_fileref.cpp b/tests/test_fileref.cpp index 1fc5def9..f8e79afa 100644 --- a/tests/test_fileref.cpp +++ b/tests/test_fileref.cpp @@ -60,6 +60,18 @@ namespace return new Ogg::Vorbis::File(fileName); } }; + class DummyStreamResolver : public FileRef::StreamTypeResolver + { + public: + virtual File *createFile(FileName, bool, AudioProperties::ReadStyle) const + { + return 0; + } + virtual File *createFileFromStream(IOStream *s, bool, AudioProperties::ReadStyle) const + { + return new MP4::File(s); + } + }; } class TestFileRef : public CppUnit::TestFixture @@ -387,6 +399,15 @@ public: FileRef f(TEST_FILE_PATH_C("xing.mp3")); CPPUNIT_ASSERT(dynamic_cast(f.file()) != NULL); } + + DummyStreamResolver streamResolver; + FileRef::addFileTypeResolver(&streamResolver); + + { + FileStream s(TEST_FILE_PATH_C("xing.mp3")); + FileRef f(&s); + CPPUNIT_ASSERT(dynamic_cast(f.file()) != NULL); + } } };