From: Tsuda Kageyu Date: Tue, 23 Dec 2014 12:02:00 +0000 (+0900) Subject: Added some tests for fuzzed APE files. X-Git-Tag: v1.10beta~133^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16ac2cd24015fcafa8529ede06f56a1dd5c4f13b;p=taglib Added some tests for fuzzed APE files. --- diff --git a/tests/data/longloop.ape b/tests/data/longloop.ape new file mode 100644 index 00000000..3800387a 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 index 00000000..683bc2dd Binary files /dev/null and b/tests/data/zerodiv.ape differ diff --git a/tests/test_ape.cpp b/tests/test_ape.cpp index c95ff0c2..e79e8f08 100644 --- a/tests/test_ape.cpp +++ b/tests/test_ape.cpp @@ -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);