perl-GStreamer r103 - in trunk: . t



Author: tsch
Date: Sun Jan 18 12:53:21 2009
New Revision: 103
URL: http://svn.gnome.org/viewvc/perl-GStreamer?rev=103&view=rev

Log:
Skip the wait_async test for now as it appears to be broken.


Modified:
   trunk/ChangeLog
   trunk/t/GstClock.t

Modified: trunk/t/GstClock.t
==============================================================================
--- trunk/t/GstClock.t	(original)
+++ trunk/t/GstClock.t	Sun Jan 18 12:53:21 2009
@@ -45,44 +45,52 @@
   ok($clock -> get_internal_time() >= 0);
   ok($clock -> adjust_unlocked(23) >= 0);
 
-  my $id = $clock -> new_single_shot_id($clock -> get_time() + 100);
+  my $id = $clock -> new_single_shot_id($clock -> get_time());
   isa_ok($id, "GStreamer::ClockID");
 
-  $id = $clock -> new_periodic_id($clock -> get_time(), 100);
+  $id = $clock -> new_periodic_id($clock -> get_time(), GST_SECOND);
   isa_ok($id, "GStreamer::ClockID");
 
   ok($id -> get_time() > 0);
+  $id -> unschedule();
 
-  my ($return, $jitter) = $id -> wait();
-  is($return, "ok");
-  ok($jitter >= 0);
+  # wait()
+  {
+    my $id = $clock -> new_periodic_id($clock -> get_time(), GST_SECOND);
+    my ($return, $jitter) = $id -> wait();
+    is($return, "ok");
+    ok($jitter >= 0);
+  }
 
-  my $loop = Glib::MainLoop -> new();
+  # wait_async
+  SKIP: {
+    skip 'wait_async is broken currently', 5;
 
-  # FIXME: I don't like this race condition.
-  $id = $clock -> new_single_shot_id($clock -> get_time() + GST_SECOND / 10);
+    my $id = $clock -> new_periodic_id($clock -> get_time(), GST_SECOND);
 
-  my $been_here = 0;
-  is($id -> wait_async(sub {
-    my ($clock, $time, $id, $data) = @_;
+    my $loop = Glib::MainLoop -> new();
 
-    return TRUE if $been_here++;
+    my $been_here = 0;
+    my $status = $id -> wait_async(sub {
+      my ($clock, $time, $id, $data) = @_;
 
-    isa_ok($clock, "GStreamer::Clock");
-    ok($time > 0);
-    isa_ok($id, "GStreamer::ClockID");
-    is($data, "bla");
+      return TRUE if $been_here++;
 
-    $loop -> quit();
+      isa_ok($clock, "GStreamer::Clock");
+      ok($time > 0);
+      isa_ok($id, "GStreamer::ClockID");
+      is($data, "bla");
 
-    return TRUE;
-  }, "bla"), "ok");
+      $loop -> quit();
 
-  # It might happen that the callback has already been invoked.  If so, don't
-  # run the main loop or we will cause a dead lock!
-  if (!$been_here) {
-    $loop -> run();
-  }
+      return TRUE;
+    }, "bla");
+    is($status, "ok");
 
-  $id -> unschedule();
+    # It might happen that the callback has already been invoked.  If so, don't
+    # run the main loop or we will cause a dead lock!
+    if (!$been_here) {
+      $loop -> run();
+    }
+  }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]