[libinline-java-perl] 370/398: new callback interface

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:43:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.55
in repository libinline-java-perl.

commit 48d7397c258f2975219676a1d27889aad489ba66
Author: patrick_leb <>
Date:   Sat Jan 21 14:42:03 2006 +0000

    new callback interface
---
 t/12_1_callbacks.t | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/t/12_1_callbacks.t b/t/12_1_callbacks.t
index 576ffcd..e479506 100755
--- a/t/12_1_callbacks.t
+++ b/t/12_1_callbacks.t
@@ -14,7 +14,7 @@ use Inline::Java qw(caught) ;
 
 
 BEGIN {
-	my $cnt = 25 ;
+	my $cnt = 37 ;
 	plan(tests => $cnt) ;
 }
 
@@ -67,7 +67,7 @@ my $t = new t15() ;
 
 		ok($t->perlt()->add(5, 6), 11) ;
 
-		eval {$t->perldummy()} ; ok($@, qr/Can't propagate non-/) ;
+		eval {$t->perldummy()} ; ok($@, qr/Can't propagate non-/) ; #'
 
 		$t->mtc_callbacks(20) ;
 		$t->StartCallbackLoop() ;
@@ -84,6 +84,24 @@ my $t = new t15() ;
 		$t->StartCallbackLoop() ;
 		ok($mtc_cnt, 20) ;
 
+		$mtc_cnt = 0 ;
+		$mtc_mode = 2 ;
+		$t->mtc_callbacks2(20) ;
+		$t->OpenCallbackStream() ;
+		while (($mtc_cnt < 20)&&($t->WaitForCallback(-1) > 0)){
+			$t->ProcessNextCallback() ;
+		}
+		ok($mtc_cnt, 20) ;
+
+		$mtc_cnt = 0 ;
+		$mtc_mode = 2 ;
+		$t->mtc_callbacks2(10) ;
+		while ($t->WaitForCallback(3.1416) > 0){
+			ok($t->WaitForCallback(0) >= 1) ;
+			$t->ProcessNextCallback() ;
+		}
+		ok($mtc_cnt, 10) ;
+
 		# Unfortunately we can't test this because the Thread.run method doesn't allow us
 		# to throw any exceptions...
 		# $t->mtc_callbacks_error() ;
@@ -188,10 +206,10 @@ sub mt_callback {
 	my $pc = shift ;
 	$mtc_cnt++ ;
 	if ($mtc_cnt >= 20){
-		if (! $mtc_mode){
+		if ($mtc_mode == 0){
 			$pc->StopCallbackLoop() ;
 		}
-		else{
+		elsif ($mtc_mode == 1){
 			my $o = new org::perl::inline::java::InlineJavaPerlCaller() ;
 			$o->StopCallbackLoop() ;
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libinline-java-perl.git



More information about the Pkg-perl-cvs-commits mailing list