CORBA-omniORB

 view release on metacpan or  search on metacpan

omnithreads/shared/t/hv_simple.t  view on Meta::CPAN

ok(9, !exists($hash{"4"}), "Exists on non existing key");
my %seen;
foreach my $key ( keys %hash) {
    $seen{$key}++;
}
ok(10, $seen{1} == 1, "Keys..");
ok(11, $seen{2} == 1, "Keys..");
ok(12, $seen{3} == 1, "Keys..");
ok(13, $seen{"foo"} == 1, "Keys..");

# bugid #24407: the stringification of the numeric 1 got allocated to the
# wrong thread memory pool, which crashes on Windows.
ok(14, exists $hash{1}, "Check numeric key");

omnithreads->create(sub { %hash = () })->join();
ok(15, keys %hash == 0, "Check clear");

omnithreads/t/problems.t  view on Meta::CPAN

        omnithreads->create( sub {1} )->join;
        my $not = eval { Config::myconfig() } ? '' : 'not ';
        print "${not}ok $test - Are we able to call Config::myconfig after clone\n";
    } else {
        print "ok $test # Skip Are we able to call Config::myconfig after clone\n";
    }
    $test++;
}


# bugid 24383 - :unique hashes weren't being made readonly on interpreter
# clone; check that they are.

our $unique_scalar : unique;
our @unique_array : unique;
our %unique_hash : unique;
omnithreads->create(sub {
        lock($test);
        my $TODO = ":unique needs to be re-implemented in a non-broken way";
        eval { $unique_scalar = 1 };
        print $@ =~ /read-only/

omnithreads/t/problems.t  view on Meta::CPAN

        if ($] >= 5.008003 && $^O ne 'MSWin32') {
            eval { $unique_hash{abc} = 1 };
            print $@ =~ /disallowed/
              ? '' : 'not ', "ok $test # TODO $TODO - unique_hash\n";
        } else {
            print("ok $test # Skip $TODO - unique_hash\n");
        }
        $test++;
    })->join;

# bugid #24940 :unique should fail on my and sub declarations

for my $decl ('my $x : unique', 'sub foo : unique') {
    {
        lock($test);
        if ($] >= 5.008005) {
            eval $decl;
            print $@ =~ /^The 'unique' attribute may only be applied to 'our' variables/
                    ? '' : 'not ', "ok $test - $decl\n";
        } else {
            print("ok $test # Skip $decl\n");

omnithreads/t/thread.t  view on Meta::CPAN

{
    # There is a miniscule chance this test case may falsely fail
    # since it tests using rand()
    my %rand : shared;
    rand(10);
    omnithreads->create( sub { $rand{int(rand(10000000000))}++ } ) foreach 1..25;
    $_->join foreach omnithreads->list;
    ok((keys %rand >= 23), "Check that rand() is randomized in new threads");
}

# bugid #24165

run_perl(prog => 'use omnithreads;' .
                 'sub a{omnithreads->create(shift)} $t = a sub{};' .
                 '$t->tid; $t->join; $t->tid',
         nolib => ($ENV{PERL_CORE}) ? 0 : 1,
         switches => ($ENV{PERL_CORE}) ? [] : [ '-Mblib' ]);
is($?, 0, 'coredump in global destruction');

# test CLONE_SKIP() functionality
if ($] >= 5.008007) {



( run in 1.380 second using v1.01-cache-2.11-cpan-5735350b133 )