Upgrade to threads 1.75
[p5sagit/p5-mst-13.2.git] / dist / threads / t / stack_env.t
CommitLineData
514612b7 1use strict;
2use warnings;
3
4BEGIN {
514612b7 5 use Config;
6 if (! $Config{'useithreads'}) {
561ee912 7 print("1..0 # SKIP Perl not compiled with 'useithreads'\n");
514612b7 8 exit(0);
9 }
10}
11
12use ExtUtils::testlib;
13
14sub ok {
15 my ($id, $ok, $name) = @_;
16
17 # You have to do it this way or VMS will get confused.
18 if ($ok) {
19 print("ok $id - $name\n");
20 } else {
21 print("not ok $id - $name\n");
22 printf("# Failed test at line %d\n", (caller)[2]);
23 }
24
25 return ($ok);
26}
27
28BEGIN {
29 $| = 1;
30 print("1..4\n"); ### Number of tests that will be run ###
31
a662d730 32 $ENV{'PERL5_ITHREADS_STACK_SIZE'} = 128*4096;
514612b7 33};
34
35use threads;
36ok(1, 1, 'Loaded');
37
38### Start of Testing ###
39
a662d730 40ok(2, threads->get_stack_size() == 128*4096,
514612b7 41 '$ENV{PERL5_ITHREADS_STACK_SIZE}');
a662d730 42ok(3, threads->set_stack_size(144*4096) == 128*4096,
514612b7 43 'Set returns previous value');
a662d730 44ok(4, threads->get_stack_size() == 144*4096,
514612b7 45 'Get stack size');
46
561ee912 47exit(0);
48
514612b7 49# EOF