-
Notifications
You must be signed in to change notification settings - Fork 25
/
Errno.t
34 lines (27 loc) · 1.03 KB
/
Errno.t
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
package Math::GSL::Errno::Test;
use base q{Test::Class};
use Test::More tests => 8;
use Math::GSL qw/:all/;
use Math::GSL::Errno qw/:all/;
use Math::GSL::Test qw/:all/;
use Data::Dumper;
use strict;
sub make_fixture : Test(setup) {
}
sub teardown : Test(teardown) {
}
sub TEST_STRERROR : Tests {
ok( gsl_strerror($GSL_SUCCESS) eq 'success', q{gsl_strerror(GSL_SUCCESS) = 'success'} );
ok( gsl_strerror($GSL_EOF) eq 'end of file', q{gsl_strerror(GSL_EOF) = 'end of file'} );
ok( gsl_strerror($GSL_CONTINUE) eq 'the iteration has not converged yet');
ok( gsl_strerror($GSL_EDOM) eq 'input domain error');
ok( gsl_strerror($GSL_ERANGE) eq 'output range error');
ok( gsl_strerror($GSL_EFAULT) eq 'invalid pointer');
}
sub TEST_HANDLER_OFF: Tests {
my $handler = gsl_set_error_handler_off();
ok(!$@, 'gsl_set_error_handler_off() turns off error handling');
local $TODO="gsl_set_error_handler_off() does not return a gsl_error_handler_t";
isa_ok($handler, 'Math::GSL::Errno' );
}
Test::Class->runtests;