Completed testcases and fixed some bugs, that were found because of the them

This commit is contained in:
Sebastian Rachuj
2013-05-21 11:58:03 +02:00
parent c972b0c080
commit 6bf8177796
3 changed files with 18 additions and 9 deletions

View File

@ -6,6 +6,7 @@
#include "utils.h"
#include <ebmlmatroskafile.h>
#include <ebmlmatroskaaudio.h>
using namespace std;
using namespace TagLib;
@ -15,6 +16,7 @@ class TestMatroska : public CppUnit::TestFixture
CPPUNIT_TEST_SUITE(TestMatroska);
CPPUNIT_TEST(testPredefined);
CPPUNIT_TEST(testInsertAndExtract);
CPPUNIT_TEST(testAudioProperties);
CPPUNIT_TEST_SUITE_END();
public:
@ -94,6 +96,12 @@ public:
AudioProperties* a = f.audioProperties();
CPPUNIT_ASSERT(a != 0);
// Not a very nice assertion...
CPPUNIT_ASSERT_EQUAL(a->length(), 0);
// Bitrate is not nice and thus not tested.
CPPUNIT_ASSERT_EQUAL(a->sampleRate(), 44100);
CPPUNIT_ASSERT_EQUAL(a->channels(), 2);
}
};