File: Sys.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 (38 lines) | stat: -rw-r--r-- 1,187 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
package Math::GSL::Sys::Test;
use base q{Test::Class};
use Test::More tests => 17;
use Math::GSL::Sys  qw/:all/;
use Math::GSL::Errno  qw/:all/;
use Math::GSL::Test qw/:all/;
use Data::Dumper;
use strict;

BEGIN { gsl_set_error_handler_off() }

sub make_fixture : Test(setup) {
}

sub teardown : Test(teardown) {
}

sub SANITY : Tests {
    ok( gsl_isnan(gsl_nan()), 'I like nan');
    ok(!gsl_isnan(0.0), '0 is a number');
    ok(!gsl_isnan(1.0), '1 is a number');
    ok(!gsl_isnan(-1.0), '-1 is a number');
    ok( gsl_isnan(gsl_log1p(-1)), 'ln(0)=nan');
    ok(!gsl_isnan(gsl_posinf()), 'posinf is a number');
    ok( gsl_isinf(gsl_posinf()),'posinf is inf' );
    ok( gsl_isinf(gsl_neginf()),'neginf is inf' );
    ok(!gsl_isinf(gsl_nan()),'nan is not inf' );
    ok( gsl_isinf($GSL_POSINF), 'GSL_POSINF' );
    ok( gsl_isinf($GSL_NEGINF), 'GSL_NEGINF' );
    ok( gsl_finite(0.0), '0 is finite' );
    ok( gsl_finite(1.0), '1 is finite' );
    ok( gsl_finite(-1.0), '-1 is finite' );
    ok(!gsl_finite(gsl_nan()), 'nan is not finite' );
    ok(!gsl_finite(gsl_posinf()),'posinf is not finite' );
    ok(!gsl_finite(gsl_neginf()),'neginf is not finite' );
}

Test::Class->runtests;