Commenting Out typemaps in Poly for the moment and adding
[Math-GSL.git] / lib / Math / GSL / Matrix / Test.pm
blob2199691280439c6e521861a34339aa33fed7acd3
1 package Math::GSL::Matrix::Test;
2 use base q{Test::Class};
3 use Test::More;
4 use Math::GSL::Matrix qw/:all/;
5 use Math::GSL qw/is_similar/;
6 use Data::Dumper;
7 use strict;
9 sub make_fixture : Test(setup) {
10 my $self = shift;
11 $self->{matrix} = gsl_matrix_alloc(5,5);
15 sub teardown : Test(teardown) {
18 sub GSL_MATRIX_ALLOC : Tests {
19 my $matrix = gsl_matrix_alloc(5,5);
20 isa_ok($matrix, 'Math::GSL::Matrix');
23 sub GSL_MATRIX_SET : Tests {
24 my $self = shift;
25 map { gsl_matrix_set($self->{matrix}, $_,$_, $_ ** 2) } (0..4);
26 isa_ok( $self->{matrix}, 'Math::GSL::Matrix' );
28 my @got = map { gsl_matrix_get($self->{matrix}, $_, $_) } (0..4);
30 map { ok(is_similar($got[$_], $_ ** 2)) } (0..4);
34 sub GSL_MATRIX_CALLOC : Tests {
35 my $matrix = gsl_matrix_calloc(5,5);
36 isa_ok($matrix, 'Math::GSL::Matrix');
38 my @got = map { gsl_matrix_get($matrix, $_, $_) } (0..4);
39 map { is($got[$_], 0) } (0..4);