diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7a5bbbf9..5012065e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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 ) diff --git a/tests/data/empty.dsf b/tests/data/empty.dsf new file mode 100644 index 00000000..373a73b4 Binary files /dev/null and b/tests/data/empty.dsf differ diff --git a/tests/test_dsf.cpp b/tests/test_dsf.cpp new file mode 100644 index 00000000..f6c33ff3 --- /dev/null +++ b/tests/test_dsf.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include +#include +#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);