Littles changes to the Integration doc
[Math-GSL.git] / t / Monte.t
blob0696e5bb2c061c14af1e951380a2fb5073fa8b7f
1 package Math::GSL::Monte::Test;
2 use Math::GSL::Test qw/:all/;
3 use base q{Test::Class};
4 use Test::More;
5 use Math::GSL::Monte qw/:all/;
6 use Math::GSL::Errno qw/:all/;
7 use Math::GSL qw/:all/;
8 use strict;
10 sub make_fixture : Test(setup) {
11     my $self = shift;
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);
16     $self->{dim}   = $j;
19 sub teardown : Test(teardown) {
20     my $self = shift;
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 {
27     my $self = shift;
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 {
34     my $self = shift;
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});
44 Test::Class->runtests;