From 8fc110dfd0cbd2266845f6020a0283720c82a7b9 Mon Sep 17 00:00:00 2001 From: "Stephen F. Booth" Date: Sat, 5 Oct 2013 13:59:59 -0400 Subject: [PATCH] Added some basic tests for DSF --- tests/CMakeLists.txt | 2 ++ tests/data/empty.dsf | Bin 0 -> 92 bytes tests/test_dsf.cpp | 31 +++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 tests/data/empty.dsf create mode 100644 tests/test_dsf.cpp 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 0000000000000000000000000000000000000000..373a73b46c1d74cbcc8370f1920a9cbe31fd74e7 GIT binary patch literal 92 ucmZ<>c2SUFfPfe%4WrU>OB76?97ZG>%ofyUfQf;n1Rx4h5=# +#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);