From: Tsuda Kageyu Date: Fri, 21 Jun 2013 06:29:00 +0000 (+0900) Subject: Added some test cases for FileRef about unsupported files X-Git-Tag: v1.9~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a845f70c490aa2f62acd66604695ec00bf272f78;p=taglib Added some test cases for FileRef about unsupported files --- diff --git a/tests/data/no-extension b/tests/data/no-extension new file mode 100644 index 00000000..65f57c2e Binary files /dev/null and b/tests/data/no-extension differ diff --git a/tests/data/unsupported-extension.xxx b/tests/data/unsupported-extension.xxx new file mode 100644 index 00000000..65f57c2e Binary files /dev/null and b/tests/data/unsupported-extension.xxx differ diff --git a/tests/test_fileref.cpp b/tests/test_fileref.cpp index 06663c97..197a9213 100644 --- a/tests/test_fileref.cpp +++ b/tests/test_fileref.cpp @@ -27,6 +27,7 @@ class TestFileRef : public CppUnit::TestFixture CPPUNIT_TEST(testTrueAudio); CPPUNIT_TEST(testAPE); CPPUNIT_TEST(testWav); + CPPUNIT_TEST(testUnsupported); CPPUNIT_TEST_SUITE_END(); public: @@ -148,6 +149,15 @@ public: { fileRefSave("mac-399", ".ape"); } + + void testUnsupported() + { + FileRef f1(TEST_FILE_PATH_C("no-extension")); + CPPUNIT_ASSERT(f1.isNull()); + + FileRef f2(TEST_FILE_PATH_C("unsupported-extension.xxx")); + CPPUNIT_ASSERT(f2.isNull()); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(TestFileRef);