File: ODEIV.t

package info (click to toggle)
libmath-gsl-perl 0.45-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192,156 kB
  • sloc: ansic: 895,524; perl: 24,682; makefile: 12
file content (47 lines) | stat: -rw-r--r-- 1,242 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package Math::GSL::ODEIV::Test;
use strict;
use base q{Test::Class};
use Test::More tests => 4;
use Math::GSL        qw/:all/;
use Math::GSL::ODEIV qw/:all/;
use Math::GSL::Errno qw/:all/;
use Math::GSL::Test  qw/:all/;
use Data::Dumper;

BEGIN { gsl_set_error_handler_off(); }

sub make_fixture : Test(setup) {
    my $self = shift;
}

sub teardown : Test(teardown) {
}

sub GSL_ODEIV_STEP_ALLOC : Tests {
    my $step = gsl_odeiv_step_alloc($gsl_odeiv_step_rk2, 3);
    isa_ok( $step, 'Math::GSL::ODEIV' );
}

sub GSL_ODEIV_EVOLVE_ALLOC : Tests {
    my $evolver = gsl_odeiv_evolve_alloc(2);
    isa_ok( $evolver, 'Math::GSL::ODEIV' );
}

sub NAME : Tests {
    my $s = gsl_odeiv_step_alloc($gsl_odeiv_step_rk2, 3);
    my $name = gsl_odeiv_step_name ($s);
    ok($name eq "rk2");
}

sub GSL_ODEIV_CONTROL_ALLOC : Tests {
    local $TODO = "need a way to create a gsl_odeiv_control_type struct";
    my $control;

    ok( defined $gsl_odeiv_control_standard,'standard control type exists');
    # This will blowup with an undef control type
    if (defined $gsl_odeiv_control_standard ){
        $control = gsl_odeiv_control_alloc($gsl_odeiv_control_standard);
        isa_ok( $control, 'Math::GSL::ODEIV' );
    }
}
Test::Class->runtests;