Permalink
Browse files

Re-enables NTuple tests, which fail by returning a non-zero Wstat

Test Summary Report
-------------------
t/NTuple.t       (Wstat: 10 Tests: 8 Failed: 0)
  Non-zero wait status: 10
  Files=52, Tests=3626, 10 wallclock secs ( 0.91 usr  0.28 sys + 11.49
  cusr  1.73 csys = 14.41 CPU)
  Result: FAIL
  • Loading branch information...
1 parent 0d31838 commit 19ceffe3869857fdd6f4f68041ce2b6c42d20626 @leto committed May 8, 2009
Showing with 65 additions and 2 deletions.
  1. +0 −2 t/NTuple.disabled
  2. +65 −0 t/NTuple.t
View
2 t/NTuple.disabled
@@ -1,2 +0,0 @@
-use Math::GSL::NTuple::Test;
-Test::Class->runtests;
View
65 t/NTuple.t
@@ -0,0 +1,65 @@
+package Math::GSL::NTuple::Test;
+use base q{Test::Class};
+use Test::More;
+use Test::Exception;
+use Math::GSL::NTuple qw/:all/;
+use Math::GSL::Const qw/:all/;
+use Math::GSL::Errno qw/:all/;
+use Math::GSL qw/:all/;
+use Math::GSL::Test qw/:all/;
+use Data::Dumper;
+use strict;
+
+BEGIN{ gsl_set_error_handler_off(); }
+
+END { warn "This is the end" }
+
+sub make_fixture : Test(setup) {
+ my $self = shift;
+ my $size = int rand(100);
+ $self->{size} = $size;
+ my $stuff = [1..$size];
+
+ $self->{ntuple} = gsl_ntuple_create('ntuple', $stuff ,$size);
+ gsl_ntuple_write($self->{ntuple});
+ gsl_ntuple_close($self->{ntuple});
+}
+
+sub teardown : Test(teardown) {
+ unlink 'ntuple' if -f 'ntuple';
+ unlink 'ntuple2' if -f 'ntuple2';
+}
+
+sub GSL_NTUPLE_CREATE : Tests {
+ my $self = shift;
+ isa_ok ($self->{ntuple}, 'Math::GSL::NTuple::gsl_ntuple');
+ ok( -e 'ntuple', 'ntuple file created');
+}
+
+sub GSL_NTUPLE_OPEN_CLOSE : Tests {
+ my $self = shift;
+ my $stuff = [];
+ my $ntuple = gsl_ntuple_open('ntuple',$stuff, $self->{size} );
+ isa_ok($ntuple,'Math::GSL::NTuple');
+ ok_status(gsl_ntuple_close($ntuple));
+}
+
+sub GSL_NTUPLE_WRITE: Tests {
+ my $self = shift;
+ my $data = [1..100];
+ my $base = gsl_ntuple_create('ntuple', $data, 100);
+ ok_status(gsl_ntuple_write($base));
+ ok_status(gsl_ntuple_close($base));
+}
+
+sub GSL_NTUPLE_READ: Tests {
+ my $self = shift;
+ my $data = [1..100];
+ my $ntuple = gsl_ntuple_open('ntuple', $data, 100 );
+ # why does this return an EOF?
+ # perhaps gsl_ntuple_write is not doing it's job, so the file is empty...
+ ok_status(gsl_ntuple_read($ntuple),$GSL_EOF);
+ ok_status(gsl_ntuple_close($ntuple));
+}
+1;
+Test::Class->runtests;

0 comments on commit 19ceffe

Please sign in to comment.