mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
Added some basic tests for DSF
This commit is contained in:
parent
b949e23be3
commit
8fc110dfd0
@ -24,6 +24,7 @@ INCLUDE_DIRECTORIES(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/s3m
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/it
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/xm
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/dsf
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ebml
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ebml/matroska
|
||||
)
|
||||
@ -66,6 +67,7 @@ SET(test_runner_SRCS
|
||||
test_xm.cpp
|
||||
test_mpc.cpp
|
||||
test_opus.cpp
|
||||
test_dsf.cpp
|
||||
test_matroska.cpp
|
||||
)
|
||||
|
||||
|
BIN
tests/data/empty.dsf
Normal file
BIN
tests/data/empty.dsf
Normal file
Binary file not shown.
31
tests/test_dsf.cpp
Normal file
31
tests/test_dsf.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include <tag.h>
|
||||
#include <tbytevectorlist.h>
|
||||
#include <dsffile.h>
|
||||
#include "utils.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace TagLib;
|
||||
|
||||
class TestDSF : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(TestDSF);
|
||||
CPPUNIT_TEST(testBasic);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
|
||||
void testBasic()
|
||||
{
|
||||
DSF::File f(TEST_FILE_PATH_C("empty.dsf"));
|
||||
DSF::AudioProperties *props = f.audioProperties();
|
||||
CPPUNIT_ASSERT_EQUAL(2822400, props->sampleRate());
|
||||
CPPUNIT_ASSERT_EQUAL(1, props->channels());
|
||||
CPPUNIT_ASSERT_EQUAL(1, props->bitsPerSample());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestDSF);
|
Loading…
x
Reference in New Issue
Block a user