]> granicus.if.org Git - taglib/commitdiff
Added some test cases for FileRef about unsupported files
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 21 Jun 2013 06:29:00 +0000 (15:29 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 21 Jun 2013 06:29:00 +0000 (15:29 +0900)
tests/data/no-extension [new file with mode: 0644]
tests/data/unsupported-extension.xxx [new file with mode: 0644]
tests/test_fileref.cpp

diff --git a/tests/data/no-extension b/tests/data/no-extension
new file mode 100644 (file)
index 0000000..65f57c2
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 (file)
index 0000000..65f57c2
Binary files /dev/null and b/tests/data/unsupported-extension.xxx differ
index 06663c97c194d16eb14e0e494c948430ac17f9eb..197a9213038323fae8075ccc3b98d413378ce6c3 100644 (file)
@@ -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);