mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 04:54:19 -04:00
Proper .oga file handling in FileRef
This fixes a problem introduced in r983337. OGA files are mostly likely going to be Ogg::FLAC, if applications are following the Xiph recommendation. But they can be using any Ogg codec, so we must check multiple formats (Sound Juicer on Ubuntu used to produce .oga files for Ogg Vorbis, I believe it doesn't do that anymore). git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1039708 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
@ -3,6 +3,8 @@
|
||||
#include <stdio.h>
|
||||
#include <tag.h>
|
||||
#include <fileref.h>
|
||||
#include <oggflacfile.h>
|
||||
#include <vorbisfile.h>
|
||||
#include "utils.h"
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@ -22,6 +24,8 @@ class TestFileRef : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testSpeex);
|
||||
CPPUNIT_TEST(testFLAC);
|
||||
CPPUNIT_TEST(testMP3);
|
||||
CPPUNIT_TEST(testOGA_FLAC);
|
||||
CPPUNIT_TEST(testOGA_Vorbis);
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
CPPUNIT_TEST(testMP4_1);
|
||||
CPPUNIT_TEST(testMP4_2);
|
||||
@ -131,6 +135,20 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
void testOGA_FLAC()
|
||||
{
|
||||
FileRef *f = new FileRef("data/empty_flac.oga");
|
||||
CPPUNIT_ASSERT(dynamic_cast<Ogg::Vorbis::File *>(f->file()) == NULL);
|
||||
CPPUNIT_ASSERT(dynamic_cast<Ogg::FLAC::File *>(f->file()) != NULL);
|
||||
}
|
||||
|
||||
void testOGA_Vorbis()
|
||||
{
|
||||
FileRef *f = new FileRef("data/empty_vorbis.oga");
|
||||
CPPUNIT_ASSERT(dynamic_cast<Ogg::Vorbis::File *>(f->file()) != NULL);
|
||||
CPPUNIT_ASSERT(dynamic_cast<Ogg::FLAC::File *>(f->file()) == NULL);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestFileRef);
|
||||
|
Reference in New Issue
Block a user