Restore FileRef::create() in order not to change the previous behavior.

This commit is contained in:
Tsuda Kageyu
2017-06-06 09:17:34 +09:00
parent 682ea77c2b
commit c2fe93c12b
3 changed files with 88 additions and 2 deletions

View File

@ -80,6 +80,7 @@ class TestFileRef : public CppUnit::TestFixture
CPPUNIT_TEST(testAIFF_1);
CPPUNIT_TEST(testAIFF_2);
CPPUNIT_TEST(testUnsupported);
CPPUNIT_TEST(testCreate);
CPPUNIT_TEST(testFileResolver);
CPPUNIT_TEST_SUITE_END();
@ -297,6 +298,19 @@ public:
CPPUNIT_ASSERT(f2.isNull());
}
void testCreate()
{
// This is depricated. But worth it to test.
File *f = FileRef::create(TEST_FILE_PATH_C("empty_vorbis.oga"));
CPPUNIT_ASSERT(dynamic_cast<Ogg::Vorbis::File*>(f));
delete f;
f = FileRef::create(TEST_FILE_PATH_C("xing.mp3"));
CPPUNIT_ASSERT(dynamic_cast<MPEG::File*>(f));
delete f;
}
void testFileResolver()
{
{