mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
tests: Fix stream based resolver test
This commit is contained in:
parent
bdd8ff2af0
commit
0de8b45612
@ -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<Ogg::Vorbis::File *>(f.file()) != NULL);
|
||||
}
|
||||
|
||||
DummyStreamResolver streamResolver;
|
||||
FileRef::addFileTypeResolver(&streamResolver);
|
||||
|
||||
{
|
||||
FileStream s(TEST_FILE_PATH_C("xing.mp3"));
|
||||
FileRef f(&s);
|
||||
CPPUNIT_ASSERT(dynamic_cast<MP4::File *>(f.file()) != NULL);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user