]> granicus.if.org Git - taglib/commitdiff
Added some tests for fuzzed APE files.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Tue, 23 Dec 2014 12:02:00 +0000 (21:02 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Tue, 23 Dec 2014 12:02:00 +0000 (21:02 +0900)
tests/data/longloop.ape [new file with mode: 0644]
tests/data/zerodiv.ape [new file with mode: 0644]
tests/test_ape.cpp

diff --git a/tests/data/longloop.ape b/tests/data/longloop.ape
new file mode 100644 (file)
index 0000000..3800387
Binary files /dev/null and b/tests/data/longloop.ape differ
diff --git a/tests/data/zerodiv.ape b/tests/data/zerodiv.ape
new file mode 100644 (file)
index 0000000..683bc2d
Binary files /dev/null and b/tests/data/zerodiv.ape differ
index c95ff0c22d6663719706bc2a29154bb39da77a54..e79e8f08a4e649cc712c6e337b2d56d48e1fa824 100644 (file)
@@ -16,6 +16,7 @@ class TestAPE : public CppUnit::TestFixture
   CPPUNIT_TEST(testProperties399);
   CPPUNIT_TEST(testProperties396);
   CPPUNIT_TEST(testProperties390);
+  CPPUNIT_TEST(testFuzzedFiles);
   CPPUNIT_TEST_SUITE_END();
 
 public:
@@ -47,6 +48,15 @@ public:
     CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
   }
 
+  void testFuzzedFiles()
+  {
+    APE::File f1(TEST_FILE_PATH_C("longloop.ape"));
+    CPPUNIT_ASSERT(f1.isValid());
+
+    APE::File f2(TEST_FILE_PATH_C("zerodiv.ape"));
+    CPPUNIT_ASSERT(f2.isValid());
+  }
+
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION(TestAPE);