After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750863 - tests: dashdemux: added unit tests for parsing period element
tests: dashdemux: added unit tests for parsing period element
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 1.5.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-12 15:03 UTC by Florin Apostol
Modified: 2015-06-25 08:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
path to extend dash_mpd unit tests (76.49 KB, patch)
2015-06-12 15:03 UTC, Florin Apostol
none Details | Review
split the original patch into 5 parts. This is 1/5 (3.61 KB, patch)
2015-06-15 16:44 UTC, Florin Apostol
committed Details | Review
split the original patch into 5 parts. This is 2/5 (2.50 KB, patch)
2015-06-15 16:45 UTC, Florin Apostol
committed Details | Review
split the original patch into 5 parts. This is 3/5 (4.68 KB, patch)
2015-06-15 16:45 UTC, Florin Apostol
committed Details | Review
split the original patch into 5 parts. This is 4/5 (1.61 KB, patch)
2015-06-15 16:45 UTC, Florin Apostol
committed Details | Review
split the original patch into 5 parts. This is 5/5 (67.22 KB, patch)
2015-06-15 16:46 UTC, Florin Apostol
committed Details | Review

Description Florin Apostol 2015-06-12 15:03:28 UTC
Created attachment 305155 [details] [review]
path to extend dash_mpd unit tests

Improved dash_mpd unit tests by adding new tests that parse the Period element.

Code coverage reported by lcov for dash/gstmpdparser.c is:
  lines......: 43.0% (984 of 2287 lines)
  functions..: 47.5% (67 of 141 functions)
Comment 1 Sebastian Dröge (slomo) 2015-06-12 20:53:43 UTC
Comment on attachment 305155 [details] [review]
path to extend dash_mpd unit tests

Please split this patch a bit. There are at least three independent changes: changing times from gint64 to guint64 (maybe put that into the other bug you created about that?), the addition of the new tests you mention here, and some additional checks in existing tests.
Comment 2 Florin Apostol 2015-06-15 16:44:33 UTC
Created attachment 305321 [details] [review]
split the original patch into 5 parts. This is 1/5

As requested, I split the original patch into 5 parts. This is 1/5
Comment 3 Florin Apostol 2015-06-15 16:45:03 UTC
Created attachment 305322 [details] [review]
split the original patch into 5 parts. This is 2/5
Comment 4 Florin Apostol 2015-06-15 16:45:28 UTC
Created attachment 305323 [details] [review]
split the original patch into 5 parts. This is 3/5
Comment 5 Florin Apostol 2015-06-15 16:45:51 UTC
Created attachment 305324 [details] [review]
split the original patch into 5 parts. This is 4/5
Comment 6 Florin Apostol 2015-06-15 16:46:12 UTC
Created attachment 305325 [details] [review]
split the original patch into 5 parts. This is 5/5
Comment 7 Sebastian Dröge (slomo) 2015-06-22 11:52:39 UTC
Review of attachment 305321 [details] [review]:

::: tests/check/elements/dash_mpd.c
@@ -121,3 @@
   assert_equals_int (gst_date_time_get_second (availabilityEndTime), 50);
 
   assert_equals_int64 (mpdclient->mpd_node->mediaPresentationDuration,

Why not assert_equals_uint64() instead?
Comment 8 Sebastian Dröge (slomo) 2015-06-22 11:53:36 UTC
Review of attachment 305323 [details] [review]:

::: tests/check/elements/dash_mpd.c
@@ +59,3 @@
   GstMpdClient *mpdclient = gst_mpd_client_new ();
 
+  ret = gst_mpd_parse (mpdclient, xml, (gint) strlen (xml));

Does it make sense to use gint for this function? Shouldn't it be gsize or guint instead?
Comment 9 Sebastian Dröge (slomo) 2015-06-22 11:57:14 UTC
Review of attachment 305325 [details] [review]:

Looks generally good, but needs changing if the first two patches need changes

::: tests/check/elements/dash_mpd.c
@@ +354,3 @@
+  GstMpdClient *mpdclient = gst_mpd_client_new ();
+
+  ret = gst_mpd_parse (mpdclient, xml, (gint) strlen (xml));

Same comment about the gint here

@@ +360,3 @@
+  assert_equals_string (periodNode->id, "TestId");
+  assert_equals_int64 (periodNode->start,
+      (gint64) duration_to_ms (0, 1, 2, 12, 10, 20, 123));

and assert_equals_uint64() here
Comment 10 Florin Apostol 2015-06-24 09:52:27 UTC
(In reply to Sebastian Dröge (slomo) from comment #7)
> Review of attachment 305321 [details] [review] [review]:
> 
> ::: tests/check/elements/dash_mpd.c
> @@ -121,3 @@
>    assert_equals_int (gst_date_time_get_second (availabilityEndTime), 50);
>  
>    assert_equals_int64 (mpdclient->mpd_node->mediaPresentationDuration,
> 
> Why not assert_equals_uint64() instead?

Because mediaPresentationDuration has type gint64. I also think it should be unsigned, so I raised a ticket to review all durations and change their type from signed to unsigned (https://bugzilla.gnome.org/show_bug.cgi?id=750847).
Comment 11 Florin Apostol 2015-06-24 09:56:43 UTC
(In reply to Sebastian Dröge (slomo) from comment #8)
> Review of attachment 305323 [details] [review] [review]:
> 
> ::: tests/check/elements/dash_mpd.c
> @@ +59,3 @@
>    GstMpdClient *mpdclient = gst_mpd_client_new ();
>  
> +  ret = gst_mpd_parse (mpdclient, xml, (gint) strlen (xml));
> 
> Does it make sense to use gint for this function? Shouldn't it be gsize or
> guint instead?

The declaration of gst_mpd_parse is:
gboolean gst_mpd_parse (GstMpdClient *client, const gchar *data, gint size);

In my opinion size should have the type gsize. But I don't want to make changes in the interface of dashdemux parser. I don't think somebody will use a negative value for size, but you never know.
Comment 12 Florin Apostol 2015-06-24 09:58:41 UTC
(In reply to Sebastian Dröge (slomo) from comment #9)
> Review of attachment 305325 [details] [review] [review]:
> 
> Looks generally good, but needs changing if the first two patches need
> changes
> 
> ::: tests/check/elements/dash_mpd.c
> @@ +354,3 @@
> +  GstMpdClient *mpdclient = gst_mpd_client_new ();
> +
> +  ret = gst_mpd_parse (mpdclient, xml, (gint) strlen (xml));
> 
> Same comment about the gint here
> 
> @@ +360,3 @@
> +  assert_equals_string (periodNode->id, "TestId");
> +  assert_equals_int64 (periodNode->start,
> +      (gint64) duration_to_ms (0, 1, 2, 12, 10, 20, 123));
> 
> and assert_equals_uint64() here

start has type gint64. I don't think it can be negative, but until we correct its type, we must use assert_equals_int64
Comment 13 Sebastian Dröge (slomo) 2015-06-24 10:23:22 UTC
(In reply to Florin Apostol from comment #11)
> (In reply to Sebastian Dröge (slomo) from comment #8)
> > Review of attachment 305323 [details] [review] [review] [review]:
> > 
> > ::: tests/check/elements/dash_mpd.c
> > @@ +59,3 @@
> >    GstMpdClient *mpdclient = gst_mpd_client_new ();
> >  
> > +  ret = gst_mpd_parse (mpdclient, xml, (gint) strlen (xml));
> > 
> > Does it make sense to use gint for this function? Shouldn't it be gsize or
> > guint instead?
> 
> The declaration of gst_mpd_parse is:
> gboolean gst_mpd_parse (GstMpdClient *client, const gchar *data, gint size);
> 
> In my opinion size should have the type gsize. But I don't want to make
> changes in the interface of dashdemux parser. I don't think somebody will
> use a negative value for size, but you never know.

Change it in a separate patch then, thanks :)
Comment 14 Sebastian Dröge (slomo) 2015-06-24 10:24:15 UTC
(In reply to Florin Apostol from comment #10)
> (In reply to Sebastian Dröge (slomo) from comment #7)
> > Review of attachment 305321 [details] [review] [review] [review]:
> > 
> > ::: tests/check/elements/dash_mpd.c
> > @@ -121,3 @@
> >    assert_equals_int (gst_date_time_get_second (availabilityEndTime), 50);
> >  
> >    assert_equals_int64 (mpdclient->mpd_node->mediaPresentationDuration,
> > 
> > Why not assert_equals_uint64() instead?
> 
> Because mediaPresentationDuration has type gint64. I also think it should be
> unsigned, so I raised a ticket to review all durations and change their type
> from signed to unsigned (https://bugzilla.gnome.org/show_bug.cgi?id=750847).

Alright, let's handle that in the other bug then :)
Comment 15 Florin Apostol 2015-06-24 10:31:15 UTC
Thank you for applying the patches. You forgot to review and apply patch 2/5