tests: Implement tests for ges_formatter_can_load_uri

This commit is contained in:
Thibault Saunier 2012-09-23 02:24:14 +02:00
parent 6462b86ac4
commit b731a42145
3 changed files with 69 additions and 0 deletions

View file

@ -17,6 +17,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "test-utils.h"
#include <ges/ges.h>
#include <gst/check/gstcheck.h>
#include <string.h>
@ -56,6 +57,22 @@ compare (GKeyFile * cmp, GESFormatter * formatter, GESTimeline * timeline)
return result;
}
GST_START_TEST (test_simple)
{
gchar *uri = ges_test_file_uri ("test.xptv");
ges_init ();
fail_unless (ges_formatter_can_load_uri (uri, NULL));
g_free (uri);
uri = ges_test_file_uri ("wrong_test.xptv");
fail_if (ges_formatter_can_load_uri (uri, NULL));
g_free (uri);
}
GST_END_TEST;
GST_START_TEST (test_keyfile_save)
{
GESTimeline *timeline;
@ -764,6 +781,7 @@ ges_suite (void)
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_simple);
tcase_add_test (tc_chain, test_keyfile_save);
tcase_add_test (tc_chain, test_keyfile_load);
tcase_add_test (tc_chain, test_keyfile_identity);

50
tests/check/ges/test.xptv Normal file
View file

@ -0,0 +1,50 @@
<pitivi formatter="GES" version="0.2">
<factories>
<sources>
<source filename="file://./audio_video.ogg" id="1"/>
</sources>
</factories>
<timeline>
<tracks>
<track>
<stream caps="video/x-raw-yuv; video/x-raw-rgb" type="pitivi.stream.VideoStream"/>
<track-objects>
<track-object active="(bool)True" locked="(bool)True" priority="(int)0" duration="(gint64)14400000000" start="(gint64)14400000000" in_point="(gint64)0" id="0" type="pitivi.timeline.track.SourceTrackObject">
<factory-ref id="1"/>
</track-object>
<track-object active="(bool)True" locked="(bool)True" priority="(int)0" duration="(gint64)14400000000" start="(gint64)0" in_point="(gint64)0" id="1" type="pitivi.timeline.track.SourceTrackObject">
<factory-ref id="1"/>
</track-object>
</track-objects>
</track>
<track>
<stream caps="audio/x-raw-int; audio/x-raw-float" type="pitivi.stream.AudioStream"/>
<track-objects>
<track-object active="(bool)True" locked="(bool)True" priority="(int)0" duration="(gint64)14400000000" start="(gint64)14400000000" in_point="(gint64)0" id="2" type="pitivi.timeline.track.SourceTrackObject">
<factory-ref id="1"/>
</track-object>
<track-object active="(bool)True" locked="(bool)True" priority="(int)0" duration="(gint64)14400000000" start="(gint64)0" in_point="(gint64)0" id="3" type="pitivi.timeline.track.SourceTrackObject">
<factory-ref id="1"/>
</track-object>
</track-objects>
</track>
</tracks>
<timeline-objects>
<timeline-object>
<factory-ref id="1"/>
<track-object-refs>
<track-object-ref id="2"/>
<track-object-ref id="0"/>
</track-object-refs>
</timeline-object>
<timeline-object>
<factory-ref id="1"/>
<track-object-refs>
<track-object-ref id="3"/>
<track-object-ref id="1"/>
</track-object-refs>
</timeline-object>
</timeline-objects>
</timeline>
</pitivi>

View file

@ -0,0 +1 @@
<Nothing/>