[Swfdec] 3 commits - test/swfdec_test_test.c

Benjamin Otte company at kemper.freedesktop.org
Tue Jan 8 03:23:24 PST 2008


 test/swfdec_test_test.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 5626f91aff8934b5fef443c9086b6466ec4a9425
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Jan 8 11:58:14 2008 +0100

    reset variables when finishing

diff --git a/test/swfdec_test_test.c b/test/swfdec_test_test.c
index d3cbeac..bb61d43 100644
--- a/test/swfdec_test_test.c
+++ b/test/swfdec_test_test.c
@@ -111,7 +111,6 @@ swfdec_test_test_trace_stop (SwfdecTestTest *test)
   g_slist_foreach (test->trace_captured, (GFunc) g_free, NULL);
   g_slist_free (test->trace_captured);
   test->trace_captured = NULL;
-  test->trace_failed = FALSE;
 }
 
 static void
@@ -120,8 +119,10 @@ swfdec_test_test_trace_start (SwfdecTestTest *test, const char *filename)
   GError *error = NULL;
 
   g_assert (test->trace_filename == NULL);
+  g_assert (test->trace_captured == NULL);
 
   test->trace_filename = g_strdup (filename);
+  test->trace_failed = FALSE;
   test->trace_buffer = swfdec_buffer_new_from_file (filename, &error);
   if (test->trace_buffer == NULL) {
     swfdec_test_throw (SWFDEC_AS_OBJECT (test)->context, "Could not start trace: %s", error->message);
@@ -226,10 +227,10 @@ swfdec_test_test_ensure_player (SwfdecTestTest *test)
 {
   if (test->filename == NULL)
     return FALSE;
-
   if (test->player)
     return TRUE;
-  test->player_quit = FALSE;
+
+  g_assert (test->player_quit == FALSE);
   test->player = swfdec_player_new_from_file (test->filename);
   g_signal_connect (test->player, "fscommand", G_CALLBACK (swfdec_test_test_fscommand), test);
   g_signal_connect (test->player, "trace", G_CALLBACK (swfdec_test_test_trace_cb), test);
@@ -248,6 +249,7 @@ swfdec_test_do_reset (SwfdecTestTest *test, const char *filename)
     return;
 
   test->filename = g_strdup (filename);
+  test->player_quit = FALSE;
 }
 
 SWFDEC_TEST_FUNCTION ("Test_advance", swfdec_test_test_advance, 0)
commit 1882d9352a5375ad711121cf333a5057f7745252
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Jan 8 11:49:09 2008 +0100

    actually catch fscommand:quit

diff --git a/test/swfdec_test_test.c b/test/swfdec_test_test.c
index e4c35bd..d3cbeac 100644
--- a/test/swfdec_test_test.c
+++ b/test/swfdec_test_test.c
@@ -216,7 +216,7 @@ static void
 swfdec_test_test_fscommand (SwfdecPlayer *player, const char *command, 
     const char *para, SwfdecTestTest *test)
 {
-  if (g_ascii_strcasecmp (command, "quit")) {
+  if (g_ascii_strcasecmp (command, "quit") == 0) {
     test->player_quit = TRUE;
   }
 }
@@ -229,6 +229,7 @@ swfdec_test_test_ensure_player (SwfdecTestTest *test)
 
   if (test->player)
     return TRUE;
+  test->player_quit = FALSE;
   test->player = swfdec_player_new_from_file (test->filename);
   g_signal_connect (test->player, "fscommand", G_CALLBACK (swfdec_test_test_fscommand), test);
   g_signal_connect (test->player, "trace", G_CALLBACK (swfdec_test_test_trace_cb), test);
commit 2730095a5c4fea5bfc29d9088c522f40741f0f28
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Jan 8 11:41:15 2008 +0100

    when resetting trace capturing, reset "failed" member, too

diff --git a/test/swfdec_test_test.c b/test/swfdec_test_test.c
index 53af9d6..e4c35bd 100644
--- a/test/swfdec_test_test.c
+++ b/test/swfdec_test_test.c
@@ -111,6 +111,7 @@ swfdec_test_test_trace_stop (SwfdecTestTest *test)
   g_slist_foreach (test->trace_captured, (GFunc) g_free, NULL);
   g_slist_free (test->trace_captured);
   test->trace_captured = NULL;
+  test->trace_failed = FALSE;
 }
 
 static void


More information about the Swfdec mailing list