[libinline-java-perl] 352/398: ok
Jonas Smedegaard
dr at jones.dk
Thu Feb 26 11:43:22 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 c686bf82175e41f3f3fe4e51b3a5094b27629e94
Author: patrick_leb <>
Date: Sun Sep 4 17:04:52 2005 +0000
ok
---
Java/Protocol.pm | 8 +++-----
MANIFEST | 3 ++-
t/13_handles.t | 15 ++++++++++++---
3 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/Java/Protocol.pm b/Java/Protocol.pm
index 27c54bc..51d4496 100644
--- a/Java/Protocol.pm
+++ b/Java/Protocol.pm
@@ -245,7 +245,6 @@ sub MakeJavaHandleBuffered {
my $this = shift ;
my $id = $this->{obj_priv}->{id} ;
- my $class = $this->{obj_priv}->{java_class} ;
Inline::Java::debug(3, "making handle object($id) buffered") ;
my $data = join(" ",
@@ -262,10 +261,10 @@ sub ReadLineFromJavaHandle {
my $id = undef ;
if (! defined($this->{obj_priv}->{buffered})){
- $this->{obj_priv}->{buffered} = $this->MakeJavaHandleBuffered() ;
+ my $nid = $this->MakeJavaHandleBuffered() ;
+ $this->{obj_priv}->{buffered} = Inline::Java::Object->__new('<buffer>', $this->{inline}, $nid) ;
}
- $id = $this->{obj_priv}->{buffered} ;
- my $class = $this->{obj_priv}->{java_class} ;
+ $id = $this->{obj_priv}->{buffered}->__get_private()->{id} ;
Inline::Java::debug(3, "reading line from handle object($id)") ;
my $data = join(" ",
@@ -282,7 +281,6 @@ sub WriteToJavaHandle {
my $str = shift ;
my $id = $this->{obj_priv}->{id} ;
- my $class = $this->{obj_priv}->{java_class} ;
Inline::Java::debug(3, "writing to handle object($id)") ;
my $data = join(" ",
diff --git a/MANIFEST b/MANIFEST
index c0a61bd..d47e815 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -71,7 +71,8 @@ t/10_5_shared_fork.t
t/10_6_shared_sim.t
t/11_exceptions.t
t/12_1_callbacks.t
-t/13_end.t
+t/13_handles.t
+t/99_end.t
t/types.java
t/types.class
t/no_const.java
diff --git a/t/13_handles.t b/t/13_handles.t
index 03aa4a0..31b0007 100755
--- a/t/13_handles.t
+++ b/t/13_handles.t
@@ -14,20 +14,29 @@ use Inline::Java qw(caught) ;
BEGIN {
# Leave previous server enough time to die...
sleep(1) ;
- plan(tests => 2) ;
+ plan(tests => 13) ;
}
my $t = new t13() ;
{
- my $o = t13->getWriter(File::Spec->catfile("t", "t13.txt")) ;
+ my $f = File::Spec->catfile("t", "t13.txt") ;
+ my $o = t13->getWriter($f) ;
my $h = new Inline::Java::Handle($o) ;
for (my $i = 1 ; $i <= 10 ; $i++){
print $h "$i\n" ;
}
- # close($h) ;
+ close($h) ;
ok(1) ;
+
+ $o = t13->getReader($f) ;
+ $h = new Inline::Java::Handle($o) ;
+ for (my $i = 1 ; $i <= 10 ; $i++){
+ my $l = <$h> ;
+ ok($l, $i) ;
+ }
+ ok(! defined(<$h>)) ;
}
ok($t->__get_private()->{proto}->ObjectCount(), 1) ;
--
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