Repository: lucy-clownfish
Updated Branches:
  refs/heads/master ad3faa90d -> d0296b14a


Fix 038-lock_free_registry.t

- Allow CLONEing of LFReg, Class, and Method from Perl.
- Use an immortal string subclass for LFReg test.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/3c5de5cf
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/3c5de5cf
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/3c5de5cf

Branch: refs/heads/master
Commit: 3c5de5cfe5e263e3d056f3825cd387de99582568
Parents: ad3faa9
Author: Nick Wellnhofer <[email protected]>
Authored: Sun Nov 23 16:32:44 2014 +0100
Committer: Nick Wellnhofer <[email protected]>
Committed: Sun Nov 23 16:32:44 2014 +0100

----------------------------------------------------------------------
 runtime/perl/lib/Clownfish.pm                   | 3 +++
 runtime/perl/t/binding/038-lock_free_registry.t | 9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3c5de5cf/runtime/perl/lib/Clownfish.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/lib/Clownfish.pm b/runtime/perl/lib/Clownfish.pm
index 42bf493..51eca77 100644
--- a/runtime/perl/lib/Clownfish.pm
+++ b/runtime/perl/lib/Clownfish.pm
@@ -77,6 +77,7 @@ sub error {$Clownfish::Err::error}
     our $VERSION = '0.004000';
     $VERSION = eval $VERSION;
     no warnings 'redefine';
+    sub CLONE_SKIP { 0; }
     sub DESTROY { }    # leak all
 }
 
@@ -137,6 +138,7 @@ sub error {$Clownfish::Err::error}
     }
 
     no warnings 'redefine';
+    sub CLONE_SKIP { 0; }
     sub DESTROY { }    # leak all
 }
 
@@ -145,6 +147,7 @@ sub error {$Clownfish::Err::error}
     our $VERSION = '0.004000';
     $VERSION = eval $VERSION;
     no warnings 'redefine';
+    sub CLONE_SKIP { 0; }
     sub DESTROY { }    # leak all
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3c5de5cf/runtime/perl/t/binding/038-lock_free_registry.t
----------------------------------------------------------------------
diff --git a/runtime/perl/t/binding/038-lock_free_registry.t 
b/runtime/perl/t/binding/038-lock_free_registry.t
index 0c9f60a..4793884 100644
--- a/runtime/perl/t/binding/038-lock_free_registry.t
+++ b/runtime/perl/t/binding/038-lock_free_registry.t
@@ -38,6 +38,13 @@ use Time::HiRes qw( time usleep );
 use List::Util qw( shuffle );
 use Clownfish;
 
+package ImmortalString;
+use base qw(Clownfish::String);
+
+sub DESTROY {}
+
+package main;
+
 my $registry = Clownfish::LockFreeRegistry->new( capacity => 32 );
 
 sub register_many {
@@ -50,7 +57,7 @@ sub register_many {
 
     my $succeeded = 0;
     for my $number (@$nums) {
-        my $obj = Clownfish::String->new($number);
+        my $obj = ImmortalString->new($number);
         $succeeded += $registry->register( key => $obj, value => $obj );
     }
 

Reply via email to