Skip to content

Commit

Permalink
Spline tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Aug 6, 2008
1 parent 7acd3a2 commit 4fb5cc2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
6 changes: 5 additions & 1 deletion MANIFEST
Expand Up @@ -33,7 +33,7 @@ examples/sf/bessel
examples/sf/bessel.png
examples/sf/plot_bessel.gnuplot
examples/sf/README
examples/tkgraphdataset
examples/tkplotdataset
FFT.i
FFT_wrap.c
Fit.i
Expand Down Expand Up @@ -105,6 +105,7 @@ lib/Math/GSL/Multifit/Test.pm
lib/Math/GSL/Multimin.pm
lib/Math/GSL/Multiroots.pm
lib/Math/GSL/NTuple.pm
lib/Math/GSL/NTuple/Test.pm
lib/Math/GSL/ODEIV.pm
lib/Math/GSL/ODEIV/Test.pm
lib/Math/GSL/Permutation.pm
Expand All @@ -126,6 +127,7 @@ lib/Math/GSL/Siman.pm
lib/Math/GSL/Sort.pm
lib/Math/GSL/Sort/Test.pm
lib/Math/GSL/Spline.pm
lib/Math/GSL/Spline/Test.pm
lib/Math/GSL/Statistics.pm
lib/Math/GSL/Sum.pm
lib/Math/GSL/Sum/Test.pm
Expand Down Expand Up @@ -218,6 +220,7 @@ t/Machine.t
t/Matrix.t
t/Min.t
t/Multifit.t
t/NTuple.t
t/ODEIV.t
t/Permutation.t
t/Poly.t
Expand All @@ -228,6 +231,7 @@ t/RNG.t
t/Roots.t
t/SF.t
t/Sort.t
t/Spline.t
t/Sum.t
t/Sys.t
t/Vector.t
Expand Down
38 changes: 38 additions & 0 deletions lib/Math/GSL/Spline/Test.pm
@@ -0,0 +1,38 @@
package Math::GSL::Spline::Test;
use base 'Test::Class';
use Test::More 'no_plan';
use Math::GSL qw/:all/;
use Math::GSL::Spline qw/:all/;
use Math::GSL::Errno qw/:all/;
use Math::GSL::Interp qw/:all/;
use Test::Exception;
use Data::Dumper;
use strict;
use warnings;

BEGIN{ gsl_set_error_handler_off() };

sub make_fixture : Test(setup) {
my $self = shift;
$self->{spline} = gsl_spline_alloc($gsl_interp_linear,100);
}

sub teardown : Test(teardown) {
}
sub TEST_FREE : Test {
my $self = shift;
gsl_spline_free($self->{spline});
ok(!$@ && !$! && !$?,'gsl_spline_free');
}
sub TEST_ALLOC : Tests {
isa_ok(gsl_spline_alloc($_,100), 'Math::GSL::Spline') for (
$gsl_interp_linear,
$gsl_interp_polynomial,
$gsl_interp_cspline,
$gsl_interp_cspline_periodic,
$gsl_interp_akima,
$gsl_interp_akima_periodic);
}


1;
3 changes: 3 additions & 0 deletions t/Spline.t
@@ -0,0 +1,3 @@
use Math::GSL::Spline::Test;
Test::Class->runtests;

0 comments on commit 4fb5cc2

Please sign in to comment.