tests: make few tests more valgrind-friendly
This commit is contained in:
parent
0c49dcd0c6
commit
6a0339bf24
@ -18,6 +18,14 @@
|
|||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_VALGRIND
|
||||||
|
# include <valgrind/valgrind.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <gst/check/gstcheck.h>
|
#include <gst/check/gstcheck.h>
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
@ -149,9 +157,17 @@ flvmux_suite (void)
|
|||||||
{
|
{
|
||||||
Suite *s = suite_create ("flvmux");
|
Suite *s = suite_create ("flvmux");
|
||||||
TCase *tc_chain = tcase_create ("general");
|
TCase *tc_chain = tcase_create ("general");
|
||||||
|
gint loop = 499;
|
||||||
|
|
||||||
suite_add_tcase (s, tc_chain);
|
suite_add_tcase (s, tc_chain);
|
||||||
tcase_add_loop_test (tc_chain, test_index_writing, 1, 499);
|
|
||||||
|
#ifdef HAVE_VALGRIND
|
||||||
|
if (RUNNING_ON_VALGRIND) {
|
||||||
|
loop = 140;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
tcase_add_loop_test (tc_chain, test_index_writing, 1, loop);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,10 @@
|
|||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_VALGRIND
|
||||||
|
# include <valgrind/valgrind.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <gst/check/gstcheck.h>
|
#include <gst/check/gstcheck.h>
|
||||||
#include <gst/audio/audio.h>
|
#include <gst/audio/audio.h>
|
||||||
#include <gst/audio/audio-enumtypes.h>
|
#include <gst/audio/audio-enumtypes.h>
|
||||||
@ -109,10 +113,13 @@ interleave_chain_func (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
|||||||
fail_unless_equals_int (map.size, 48000 * 2 * sizeof (gfloat));
|
fail_unless_equals_int (map.size, 48000 * 2 * sizeof (gfloat));
|
||||||
fail_unless (outdata != NULL);
|
fail_unless (outdata != NULL);
|
||||||
|
|
||||||
for (i = 0; i < 48000 * 2; i += 2) {
|
#ifdef HAVE_VALGRIND
|
||||||
fail_unless_equals_float (outdata[i], input[0]);
|
if (!(RUNNING_ON_VALGRIND))
|
||||||
fail_unless_equals_float (outdata[i + 1], input[1]);
|
#endif
|
||||||
}
|
for (i = 0; i < 48000 * 2; i += 2) {
|
||||||
|
fail_unless_equals_float (outdata[i], input[0]);
|
||||||
|
fail_unless_equals_float (outdata[i + 1], input[1]);
|
||||||
|
}
|
||||||
gst_buffer_unmap (buffer, &map);
|
gst_buffer_unmap (buffer, &map);
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
|
|
||||||
@ -473,10 +480,13 @@ sink_handoff_float32 (GstElement * element, GstBuffer * buffer, GstPad * pad,
|
|||||||
gst_caps_unref (ccaps);
|
gst_caps_unref (ccaps);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
for (i = 0; i < 48000 * 2; i += 2) {
|
#ifdef HAVE_VALGRIND
|
||||||
fail_unless_equals_float (data[i], -1.0);
|
if (!(RUNNING_ON_VALGRIND))
|
||||||
fail_unless_equals_float (data[i + 1], 1.0);
|
#endif
|
||||||
}
|
for (i = 0; i < 48000 * 2; i += 2) {
|
||||||
|
fail_unless_equals_float (data[i], -1.0);
|
||||||
|
fail_unless_equals_float (data[i + 1], 1.0);
|
||||||
|
}
|
||||||
gst_buffer_unmap (buffer, &map);
|
gst_buffer_unmap (buffer, &map);
|
||||||
|
|
||||||
have_data++;
|
have_data++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user