GNOME Bugzilla – Bug 723953
mpegts: Unit test for library RFC
Last modified: 2014-02-24 15:28:46 UTC
Created attachment 268564 [details] [review] tests: Add test for mpegts library First draft for a unit test to the mpegts library For starters only PAT, PMT, and NIT are tested, as these are the only tables we have constructors for. Ideas on how we can test the integrity of descriptors are welcome. Problem is that i.e the network_name descriptor have practically endless possibilities. Likewise there is endless possibilities for combinations of sections and descriptors.
Review of attachment 268564 [details] [review]: It goes in the right direction. Some stuff missing: * More descriptor checks (starting by the ones you use) * Testing expected failures ::: tests/check/libs/mpegts.c @@ +91,3 @@ + if (data[i] != pat_data_check[i]) { + gchar *msg; + msg = g_strdup_printf ("0x%X != 0x%X in byte %d of PAT section", You don't need a temporary string for this, you can use varargs with fail
Created attachment 270015 [details] [review] tests: Add test for mpegts library Updates to the patch. Introduced tests for descriptors. Does only contain descriptors that can be created through the lib at the moment. I was contemplating on creating tests for the conversion of UTF-8 strings to different character maps, but the dvb_text_from_utf8 is private as it is now. Furthermore, I guess that the conversion is not guaranteed to be the same across different platforms?
Hmm... I'm getting quite this failure. You sure the checks are correct ? Running suite(s): MPEG Transport Stream helper library 80%: Checks: 5, Failures: 1, Errors: 0 libs/mpegts.c:347:F:general:test_mpegts_dvb_descriptors:0: Expected g_critical, got nothing
Created attachment 270124 [details] [review] mpegts: network_name: Check converted length Oh forgot about that, sorry. It is actually a small bug, which is fixed in this patch.
Commited, thx