mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
tests: use loop test for long-running videocrop check
This should avoid timeouts on slow machines. Fixes #597739.
This commit is contained in:
parent
f1a75adcbc
commit
c4a9ed774e
1 changed files with 43 additions and 41 deletions
|
@ -374,8 +374,6 @@ GST_START_TEST (test_crop_to_1x1)
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GST_START_TEST (test_cropping)
|
GST_START_TEST (test_cropping)
|
||||||
{
|
{
|
||||||
GstVideoCropTestContext ctx;
|
GstVideoCropTestContext ctx;
|
||||||
|
@ -399,23 +397,23 @@ GST_START_TEST (test_cropping)
|
||||||
videocrop_test_cropping_init_context (&ctx);
|
videocrop_test_cropping_init_context (&ctx);
|
||||||
|
|
||||||
caps_list = video_crop_get_test_caps (ctx.crop);
|
caps_list = video_crop_get_test_caps (ctx.crop);
|
||||||
|
node = g_list_nth (caps_list, __i__);
|
||||||
|
|
||||||
for (node = caps_list; node != NULL; node = node->next) {
|
if (node != NULL) {
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
GstCaps *caps, *in_caps;
|
GstCaps *caps;
|
||||||
|
|
||||||
caps = gst_caps_copy (GST_CAPS (node->data));
|
caps = gst_caps_copy (GST_CAPS (node->data));
|
||||||
s = gst_caps_get_structure (caps, 0);
|
s = gst_caps_get_structure (caps, 0);
|
||||||
fail_unless (s != NULL);
|
fail_unless (s != NULL);
|
||||||
|
|
||||||
if (g_strcmp0 (gst_structure_get_name (s), "video/x-raw-gray") == 0) {
|
/* videotestsrc does not support this format, so ignore it */
|
||||||
/* videotestsrc does not support this format */
|
if (!g_str_equal (gst_structure_get_name (s), "video/x-raw-gray")) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
GST_INFO ("testing format: %" GST_PTR_FORMAT, caps);
|
GST_INFO ("testing format: %" GST_PTR_FORMAT, caps);
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (sizes_to_try); ++i) {
|
for (i = 0; i < G_N_ELEMENTS (sizes_to_try); ++i) {
|
||||||
|
GstCaps *in_caps;
|
||||||
|
|
||||||
GST_INFO (" - %d x %d", sizes_to_try[i].width, sizes_to_try[i].height);
|
GST_INFO (" - %d x %d", sizes_to_try[i].width, sizes_to_try[i].height);
|
||||||
|
|
||||||
gst_structure_set (s, "width", G_TYPE_INT, sizes_to_try[i].width,
|
gst_structure_set (s, "width", G_TYPE_INT, sizes_to_try[i].width,
|
||||||
|
@ -446,7 +444,11 @@ GST_START_TEST (test_cropping)
|
||||||
|
|
||||||
gst_caps_unref (in_caps);
|
gst_caps_unref (in_caps);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
} else {
|
||||||
|
GST_INFO ("no caps #%d", __i__);
|
||||||
}
|
}
|
||||||
g_list_foreach (caps_list, (GFunc) gst_caps_unref, NULL);
|
g_list_foreach (caps_list, (GFunc) gst_caps_unref, NULL);
|
||||||
g_list_free (caps_list);
|
g_list_free (caps_list);
|
||||||
|
@ -782,7 +784,7 @@ videocrop_suite (void)
|
||||||
tcase_add_test (tc_chain, test_caps_transform);
|
tcase_add_test (tc_chain, test_caps_transform);
|
||||||
tcase_add_test (tc_chain, test_passthrough);
|
tcase_add_test (tc_chain, test_passthrough);
|
||||||
tcase_add_test (tc_chain, test_unit_sizes);
|
tcase_add_test (tc_chain, test_unit_sizes);
|
||||||
tcase_add_test (tc_chain, test_cropping);
|
tcase_add_loop_test (tc_chain, test_cropping, 0, 25);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue