Merge pull request #528 from chouquette/master

FileRef: Allow an IOStream to be used
This commit is contained in:
Tsuda Kageyu
2015-11-21 09:51:03 +09:00
3 changed files with 60 additions and 18 deletions

View File

@ -6,6 +6,7 @@
#include <vorbisfile.h>
#include <cppunit/extensions/HelperMacros.h>
#include "utils.h"
#include <tfilestream.h>
using namespace std;
using namespace TagLib;
@ -74,6 +75,17 @@ public:
CPPUNIT_ASSERT_EQUAL(f->tag()->track(), TagLib::uint(7));
CPPUNIT_ASSERT_EQUAL(f->tag()->year(), TagLib::uint(2080));
delete f;
FileStream fs(newname.c_str());
f = new FileRef(&fs);
CPPUNIT_ASSERT(!f->isNull());
CPPUNIT_ASSERT_EQUAL(f->tag()->artist(), String("ttest artist"));
CPPUNIT_ASSERT_EQUAL(f->tag()->title(), String("ytest title"));
CPPUNIT_ASSERT_EQUAL(f->tag()->genre(), String("uTest!"));
CPPUNIT_ASSERT_EQUAL(f->tag()->album(), String("ialbummmm"));
CPPUNIT_ASSERT_EQUAL(f->tag()->track(), TagLib::uint(7));
CPPUNIT_ASSERT_EQUAL(f->tag()->year(), TagLib::uint(2080));
delete f;
}
void testMusepack()