FileRef: Allow an IOStream to be used

This commit is contained in:
Hugo Beauzée-Luyssen
2015-04-28 11:56:07 +02:00
parent 5ca4cd2f52
commit e750cb491d
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()