1 package Math
::GSL
::Monte
::Test
;
2 use Math
::GSL
::Test qw
/:all/;
3 use base
q{Test::Class};
5 use Math
::GSL
::Monte qw
/:all/;
6 use Math
::GSL
::Errno qw
/:all/;
7 use Math
::GSL qw
/:all/;
10 sub make_fixture
: Test
(setup
) {
12 my $j = 1 + int(rand(20));
13 $self->{miser
} = gsl_monte_miser_alloc
($j);
14 $self->{vegas
} = gsl_monte_vegas_alloc
($j);
15 $self->{plain
} = gsl_monte_plain_alloc
($j);
19 sub teardown
: Test
(teardown
) {
21 gsl_monte_miser_free
($self->{miser
});
22 gsl_monte_plain_free
($self->{plain
});
23 gsl_monte_vegas_free
($self->{vegas
});
26 sub TEST_INIT
: Tests
{
28 ok_status
( gsl_monte_plain_init
($self->{plain
}) );
29 ok_status
( gsl_monte_vegas_init
($self->{vegas
}) );
30 ok_status
( gsl_monte_miser_init
($self->{miser
}) );
33 sub TEST_ALLOC
: Tests
{
35 isa_ok
($self->{miser
},'Math::GSL::Monte');
36 cmp_ok
($self->{miser
}->{dim
},'==',$self->{dim
});
38 isa_ok
($self->{vegas
},'Math::GSL::Monte');
39 cmp_ok
($self->{vegas
}->{dim
},'==',$self->{dim
});
41 isa_ok
($self->{plain
},'Math::GSL::Monte');
42 cmp_ok
($self->{plain
}->{dim
},'==',$self->{dim
});