diff options
author | Carl Hetherington <carl@carlh.net> | 2012-04-19 21:15:42 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-04-19 21:15:42 +0000 |
commit | caae89fd9b8cd21ffa12ff5204ce7bd655c292e2 (patch) | |
tree | 35747ab88c3d8c0cf96766cb0da990075c545d43 /libs | |
parent | 5b6721f657e9b5f64e80cedb775bfe22e2702f3a (diff) |
Another little test.
git-svn-id: svn://localhost/ardour2/branches/3.0@12037 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/test/playlist_read_test.cc | 25 | ||||
-rw-r--r-- | libs/ardour/test/playlist_read_test.h | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/libs/ardour/test/playlist_read_test.cc b/libs/ardour/test/playlist_read_test.cc index e016b3adc6..f0d450e1b0 100644 --- a/libs/ardour/test/playlist_read_test.cc +++ b/libs/ardour/test/playlist_read_test.cc @@ -171,6 +171,31 @@ PlaylistReadTest::transparentReadTest () } } +/* A few tests just to check that nothing nasty is happening with + memory corruption, really (for running with valgrind). +*/ +void +PlaylistReadTest::miscReadTest () +{ + boost::shared_ptr<AudioRegion> ar0 = boost::dynamic_pointer_cast<AudioRegion> (_region[0]); + ar0->set_name ("ar0"); + _apl->add_region (ar0, 0); + ar0->set_default_fade_in (); + ar0->set_default_fade_out (); + CPPUNIT_ASSERT_EQUAL (double (64), ar0->_fade_in->back()->when); + CPPUNIT_ASSERT_EQUAL (double (64), ar0->_fade_out->back()->when); + ar0->set_length (128); + + /* Read for just longer than the region */ + _apl->read (_buf, _mbuf, _gbuf, 0, 129, 0); + + /* Read for much longer than the region */ + _apl->read (_buf, _mbuf, _gbuf, 0, 1024, 0); + + /* Read one sample */ + _apl->read (_buf, _mbuf, _gbuf, 53, 54, 0); +} + void PlaylistReadTest::check_staircase (Sample* b, int offset, int N) { diff --git a/libs/ardour/test/playlist_read_test.h b/libs/ardour/test/playlist_read_test.h index 416ac41a88..be891a5004 100644 --- a/libs/ardour/test/playlist_read_test.h +++ b/libs/ardour/test/playlist_read_test.h @@ -7,6 +7,7 @@ class PlaylistReadTest : public TestNeedingPlaylistAndRegions CPPUNIT_TEST (singleReadTest); CPPUNIT_TEST (overlappingReadTest); CPPUNIT_TEST (transparentReadTest); + CPPUNIT_TEST (miscReadTest); CPPUNIT_TEST_SUITE_END (); public: @@ -16,6 +17,7 @@ public: void singleReadTest (); void overlappingReadTest (); void transparentReadTest (); + void miscReadTest (); private: int _N; |