~ubuntu-branches/ubuntu/wily/perl/wily

« back to all changes in this revision

Viewing changes to .pc/debian/hurd_test_skip_libc.diff/dist/threads/t/libc.t

  • Committer: Package Import Robot
  • Author(s): Dominic Hargreaves, Niko Tyni, Dominic Hargreaves
  • Date: 2011-11-28 19:48:05 UTC
  • mfrom: (8.1.30 sid)
  • Revision ID: package-import@ubuntu.com-20111128194805-8bkpc1gmgnakssjk
Tags: 5.14.2-6
[ Niko Tyni ]
* debian/rules: correctly handle subject line wraps in patch headers.

[ Dominic Hargreaves ]
* Add versioned Conflicts on update-inetd (<< 4.41) (Closes: #649177)
* Conflict on rather than Break doc-base (<< 0.10.3); aptitude
  runs doc-base triggers before the new version has been unpacked
* Update Lintian override for perl-module-uses-perl4-libs-without-dep
  to reflect new path to CGI.pm
* Disable various tests which fail on GNU/Hurd (see #648623)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use strict;
 
2
use warnings;
 
3
 
 
4
BEGIN {
 
5
    require($ENV{PERL_CORE} ? '../../t/test.pl' : './t/test.pl');
 
6
 
 
7
    use Config;
 
8
    if (! $Config{'useithreads'}) {
 
9
        skip_all(q/Perl not compiled with 'useithreads'/);
 
10
    }
 
11
 
 
12
    plan(11);
 
13
}
 
14
 
 
15
use ExtUtils::testlib;
 
16
 
 
17
use_ok('threads');
 
18
 
 
19
### Start of Testing ###
 
20
 
 
21
my $i = 10;
 
22
my $y = 20000;
 
23
 
 
24
my %localtime;
 
25
for (1..$i) {
 
26
    $localtime{$_} = localtime($_);
 
27
};
 
28
 
 
29
my @threads;
 
30
for (1..$i) {
 
31
    $threads[$_] = threads->create(sub {
 
32
                        my $arg = shift;
 
33
                        my $localtime = $localtime{$arg};
 
34
                        my $error = 0;
 
35
                        for (1..$y) {
 
36
                            my $lt = localtime($arg);
 
37
                            if ($localtime ne $lt) {
 
38
                                $error++;
 
39
                            }
 
40
                        }
 
41
                        return $error;
 
42
                    }, $_);
 
43
}
 
44
 
 
45
for (1..$i) {
 
46
    is($threads[$_]->join(), 0, 'localtime() thread-safe');
 
47
}
 
48
 
 
49
exit(0);
 
50
 
 
51
# EOF