ges: tests: Use correct variable types when setting properties

From https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/247

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4995>
This commit is contained in:
Doug Nazar 2021-05-01 16:50:11 -04:00 committed by Tim-Philipp Müller
parent bc294bd89d
commit 7c8397fb11
5 changed files with 32 additions and 24 deletions

View file

@ -53,7 +53,7 @@ GST_START_TEST (test_layer_properties)
fail_unless (clip != NULL); fail_unless (clip != NULL);
/* Set some properties */ /* Set some properties */
g_object_set (clip, "start", (guint64) 42, "duration", (guint64) 51, g_object_set (clip, "start", (guint64) 42, "duration", (gint64) 51,
"in-point", (guint64) 12, NULL); "in-point", (guint64) 12, NULL);
assert_equals_uint64 (_START (clip), 42); assert_equals_uint64 (_START (clip), 42);
assert_equals_uint64 (_DURATION (clip), 51); assert_equals_uint64 (_DURATION (clip), 51);
@ -144,9 +144,9 @@ GST_START_TEST (test_layer_priorities)
fail_unless (clip2 != NULL); fail_unless (clip2 != NULL);
fail_unless (clip3 != NULL); fail_unless (clip3 != NULL);
g_object_set (clip1, "start", 0, "duration", 10, NULL); g_object_set (clip1, "start", (guint64) 0, "duration", (gint64) 10, NULL);
g_object_set (clip2, "start", 10, "duration", 10, NULL); g_object_set (clip2, "start", (guint64) 10, "duration", (gint64) 10, NULL);
g_object_set (clip3, "start", 20, "duration", 10, NULL); g_object_set (clip3, "start", (guint64) 20, "duration", (gint64) 10, NULL);
/* Add objects to the timeline */ /* Add objects to the timeline */
fail_unless (ges_layer_add_clip (layer1, clip1)); fail_unless (ges_layer_add_clip (layer1, clip1));
@ -1606,7 +1606,7 @@ GST_START_TEST (test_layer_get_clips_in_interval)
clip = (GESClip *) ges_test_clip_new (); clip = (GESClip *) ges_test_clip_new ();
fail_unless (clip != NULL); fail_unless (clip != NULL);
g_object_set (clip, "start", 10, "duration", 30, NULL); g_object_set (clip, "start", (guint64) 10, "duration", (gint64) 30, NULL);
assert_equals_uint64 (_START (clip), 10); assert_equals_uint64 (_START (clip), 10);
assert_equals_uint64 (_DURATION (clip), 30); assert_equals_uint64 (_DURATION (clip), 30);
@ -1662,7 +1662,7 @@ GST_START_TEST (test_layer_get_clips_in_interval)
/* Multiple intersecting clips */ /* Multiple intersecting clips */
clip2 = (GESClip *) ges_test_clip_new (); clip2 = (GESClip *) ges_test_clip_new ();
fail_unless (clip2 != NULL); fail_unless (clip2 != NULL);
g_object_set (clip2, "start", 50, "duration", 10, NULL); g_object_set (clip2, "start", (guint64) 50, "duration", (gint64) 10, NULL);
assert_equals_uint64 (_START (clip2), 50); assert_equals_uint64 (_START (clip2), 50);
assert_equals_uint64 (_DURATION (clip2), 10); assert_equals_uint64 (_DURATION (clip2), 10);
@ -1670,7 +1670,7 @@ GST_START_TEST (test_layer_get_clips_in_interval)
clip3 = (GESClip *) ges_test_clip_new (); clip3 = (GESClip *) ges_test_clip_new ();
fail_unless (clip3 != NULL); fail_unless (clip3 != NULL);
g_object_set (clip3, "start", 0, "duration", 5, NULL); g_object_set (clip3, "start", (guint64) 0, "duration", (gint64) 5, NULL);
assert_equals_uint64 (_START (clip3), 0); assert_equals_uint64 (_START (clip3), 0);
assert_equals_uint64 (_DURATION (clip3), 5); assert_equals_uint64 (_DURATION (clip3), 5);

View file

@ -346,12 +346,12 @@ _add_properties (GESTimeline * timeline)
gst_object_unref (source); gst_object_unref (source);
} else if (GES_IS_VIDEO_SOURCE (element)) { } else if (GES_IS_VIDEO_SOURCE (element)) {
/* Adding children properties */ /* Adding children properties */
gint64 posx = 42; gint posx = 42;
ges_timeline_element_set_child_properties (GES_TIMELINE_ELEMENT ges_timeline_element_set_child_properties (GES_TIMELINE_ELEMENT
(element), "posx", posx, NULL); (element), "posx", posx, NULL);
ges_timeline_element_get_child_properties (GES_TIMELINE_ELEMENT ges_timeline_element_get_child_properties (GES_TIMELINE_ELEMENT
(element), "posx", &posx, NULL); (element), "posx", &posx, NULL);
fail_unless_equals_int64 (posx, 42); fail_unless_equals_int (posx, 42);
} }
} }
@ -419,10 +419,10 @@ _check_properties (GESTimeline * timeline)
/* Checking children properties */ /* Checking children properties */
else if (GES_IS_VIDEO_SOURCE (element)) { else if (GES_IS_VIDEO_SOURCE (element)) {
/* Init 'posx' with a wrong value */ /* Init 'posx' with a wrong value */
gint64 posx = 27; gint posx = 27;
ges_timeline_element_get_child_properties (GES_TIMELINE_ELEMENT ges_timeline_element_get_child_properties (GES_TIMELINE_ELEMENT
(element), "posx", &posx, NULL); (element), "posx", &posx, NULL);
fail_unless_equals_int64 (posx, 42); fail_unless_equals_int (posx, 42);
} }
} }
g_list_free_full (track_elements, g_object_unref); g_list_free_full (track_elements, g_object_unref);

View file

@ -55,13 +55,16 @@ void
free_children_properties (GParamSpec ** list, guint num_props); free_children_properties (GParamSpec ** list, guint num_props);
#define nle_object_check(nleobj, start, duration, mstart, mduration, priority, active) { \ #define nle_object_check(nleobj, start, duration, mstart, mduration, priority, active) { \
guint64 pstart, pdur, inpoint, pprio, pact; \ guint64 pstart, inpoint; \
gint64 pdur; \
guint pprio; \
gboolean pact; \
g_object_get (nleobj, "start", &pstart, "duration", &pdur, \ g_object_get (nleobj, "start", &pstart, "duration", &pdur, \
"inpoint", &inpoint, "priority", &pprio, "active", &pact, \ "inpoint", &inpoint, "priority", &pprio, "active", &pact, \
NULL); \ NULL); \
assert_equals_uint64 (pstart, start); \ assert_equals_uint64 (pstart, start); \
assert_equals_uint64 (pdur, duration); \ assert_equals_int64 (pdur, duration); \
assert_equals_uint64 (inpoint, mstart); \ assert_equals_uint64 (inpoint, mstart); \
assert_equals_int (pprio, priority); \ assert_equals_int (pprio, priority); \
assert_equals_int (pact, active); \ assert_equals_int (pact, active); \
} }

View file

@ -228,7 +228,8 @@ GST_START_TEST (test_remove_last_object)
audiotestsrc = gst_element_factory_make ("audiotestsrc", "audiotestsrc1"); audiotestsrc = gst_element_factory_make ("audiotestsrc", "audiotestsrc1");
gst_bin_add (GST_BIN (source1), audiotestsrc); gst_bin_add (GST_BIN (source1), audiotestsrc);
g_object_set (source1, "start", (guint64) 0 * GST_SECOND, g_object_set (source1, "start", (guint64) 0 * GST_SECOND,
"duration", 10 * GST_SECOND, "inpoint", (guint64) 0, "priority", 1, NULL); "duration", (gint64) 10 * GST_SECOND, "inpoint", (guint64) 0, "priority",
1, NULL);
nle_composition_add (composition, source1); nle_composition_add (composition, source1);
@ -236,7 +237,8 @@ GST_START_TEST (test_remove_last_object)
audiotestsrc2 = gst_element_factory_make ("audiotestsrc", "audiotestsrc1"); audiotestsrc2 = gst_element_factory_make ("audiotestsrc", "audiotestsrc1");
gst_bin_add (GST_BIN (source2), audiotestsrc2); gst_bin_add (GST_BIN (source2), audiotestsrc2);
g_object_set (source2, "start", (guint64) 10 * GST_SECOND, g_object_set (source2, "start", (guint64) 10 * GST_SECOND,
"duration", 10 * GST_SECOND, "inpoint", (guint64) 0, "priority", 1, NULL); "duration", (gint64) 10 * GST_SECOND, "inpoint", (guint64) 0, "priority",
1, NULL);
nle_composition_add (composition, source2); nle_composition_add (composition, source2);
@ -317,7 +319,8 @@ GST_START_TEST (test_dispose_on_commit)
audiotestsrc = gst_element_factory_make ("audiotestsrc", "audiotestsrc1"); audiotestsrc = gst_element_factory_make ("audiotestsrc", "audiotestsrc1");
gst_bin_add (GST_BIN (nlesource), audiotestsrc); gst_bin_add (GST_BIN (nlesource), audiotestsrc);
g_object_set (nlesource, "start", (guint64) 0 * GST_SECOND, g_object_set (nlesource, "start", (guint64) 0 * GST_SECOND,
"duration", 10 * GST_SECOND, "inpoint", (guint64) 0, "priority", 1, NULL); "duration", (gint64) 10 * GST_SECOND, "inpoint", (guint64) 0, "priority",
1, NULL);
fail_unless (nle_composition_add (GST_BIN (composition), nlesource)); fail_unless (nle_composition_add (GST_BIN (composition), nlesource));
gst_bin_add_many (GST_BIN (pipeline), composition, fakesink, NULL); gst_bin_add_many (GST_BIN (pipeline), composition, fakesink, NULL);
@ -373,7 +376,8 @@ GST_START_TEST (test_simple_audiomixer)
audiotestsrc1 = gst_element_factory_make ("audiotestsrc", "audiotestsrc1"); audiotestsrc1 = gst_element_factory_make ("audiotestsrc", "audiotestsrc1");
gst_bin_add (GST_BIN (nlesource1), audiotestsrc1); gst_bin_add (GST_BIN (nlesource1), audiotestsrc1);
g_object_set (nlesource1, "start", (guint64) 0 * GST_SECOND, g_object_set (nlesource1, "start", (guint64) 0 * GST_SECOND,
"duration", total_time / 2, "inpoint", (guint64) 0, "priority", 1, NULL); "duration", (gint64) total_time / 2, "inpoint", (guint64) 0, "priority",
1, NULL);
fail_unless (nle_composition_add (GST_BIN (composition), nlesource1)); fail_unless (nle_composition_add (GST_BIN (composition), nlesource1));
/* nlesource2 */ /* nlesource2 */
@ -463,7 +467,8 @@ create_nested_source (gint nesting_depth)
name = g_strdup_printf ("nested_src%d", i); name = g_strdup_printf ("nested_src%d", i);
source = gst_element_factory_make_or_warn ("nlesource", name); source = gst_element_factory_make_or_warn ("nlesource", name);
g_free (name); g_free (name);
g_object_set (source, "start", 0, "duration", 2 * GST_SECOND, NULL); g_object_set (source, "start", (guint64) 0, "duration",
(gint64) 2 * GST_SECOND, NULL);
gst_bin_add (GST_BIN (source), bin); gst_bin_add (GST_BIN (source), bin);
} }

View file

@ -295,20 +295,20 @@ _setup_test (GstElement * pipeline, gdouble rate)
nle_source = nle_source =
audiotest_bin_src ("nle_source", 3 * GST_SECOND, 4 * GST_SECOND, 3, audiotest_bin_src ("nle_source", 3 * GST_SECOND, 4 * GST_SECOND, 3,
FALSE); FALSE);
g_object_set (nle_source, "inpoint", 7 * GST_SECOND, NULL); g_object_set (nle_source, "inpoint", (guint64) 7 * GST_SECOND, NULL);
src = _get_source (nle_source); src = _get_source (nle_source);
g_object_set (src, "name", "middle-source", NULL); g_object_set (src, "name", "middle-source", NULL);
nle_prev = nle_prev =
audiotest_bin_src ("nle_previous", 0 * GST_SECOND, 3 * GST_SECOND, 2, audiotest_bin_src ("nle_previous", 0 * GST_SECOND, 3 * GST_SECOND, 2,
FALSE); FALSE);
g_object_set (nle_prev, "inpoint", 99 * GST_SECOND, NULL); g_object_set (nle_prev, "inpoint", (guint64) 99 * GST_SECOND, NULL);
prev = _get_source (nle_prev); prev = _get_source (nle_prev);
g_object_set (src, "name", "previous-source", NULL); g_object_set (src, "name", "previous-source", NULL);
nle_post = nle_post =
audiotest_bin_src ("post", 7 * GST_SECOND, 5 * GST_SECOND, 2, FALSE); audiotest_bin_src ("post", 7 * GST_SECOND, 5 * GST_SECOND, 2, FALSE);
g_object_set (nle_post, "inpoint", 20 * GST_SECOND, NULL); g_object_set (nle_post, "inpoint", (guint64) 20 * GST_SECOND, NULL);
post = _get_source (nle_post); post = _get_source (nle_post);
g_object_set (src, "name", "post-source", NULL); g_object_set (src, "name", "post-source", NULL);
@ -325,7 +325,7 @@ _setup_test (GstElement * pipeline, gdouble rate)
* duration */ * duration */
nle_identity = nle_identity =
new_operation ("nle_identity", "identity", 0, 12 * GST_SECOND, 1); new_operation ("nle_identity", "identity", 0, 12 * GST_SECOND, 1);
g_object_set (nle_identity, "inpoint", 5 * GST_SECOND, NULL); g_object_set (nle_identity, "inpoint", (guint64) 5 * GST_SECOND, NULL);
fail_unless (g_list_length (GST_BIN_CHILDREN (nle_oper)) == 1); fail_unless (g_list_length (GST_BIN_CHILDREN (nle_oper)) == 1);
identity = GST_ELEMENT (GST_BIN_CHILDREN (nle_identity)->data); identity = GST_ELEMENT (GST_BIN_CHILDREN (nle_identity)->data);