diff --git a/t/01-pptest.t b/t/01-pptest.t index 9d49311bf..a1c708766 100644 --- a/t/01-pptest.t +++ b/t/01-pptest.t @@ -81,13 +81,6 @@ pp_def( $b() = tmp;' ); -# test to set named dim with 'OtherPar' -pp_def('setdim', - Pars => '[o] a(n)', - OtherPars => 'int ns => n', - Code => 'loop(n) %{ $a() = n; %}', -); - pp_def("gelsd", Pars => '[io,phys]A(m,n); [io,phys]B(p,q); [phys]rcond(); [o,phys]s(r); int [o,phys]rank();int [o,phys]info()', RedoDimsCode => '$SIZE(r) = PDLMIN($SIZE(m),$SIZE(n));', @@ -95,20 +88,6 @@ pp_def("gelsd", Code => '$CROAK("croaking");' ); -pp_def('fooseg', - Pars => 'a(n); [o]b(n);', - Code => ' - loop(n) %{ $b() = $a(); %} -'); - -# adapted from PDL::NDBin: if in=null and b is a scalar, was SEGV-ing -pp_def( '_flatten_into', - Pars => "in(m); indx b(m); [o] idx(m)", - Code => ' - loop(m) %{ $idx() = $in(); %} - ', -); - pp_def( 'broadcastloop_continue', Pars => 'in(); [o] out()', Code => q[ @@ -156,12 +135,6 @@ pp_add_boot pp_line_numbers(__LINE__, q{ /* nothing happening here */ }); -# test fixed value for named dim, wrong Code for simplicity -pp_def('Cpow', - Pars => 'a(m=2); b(m=2); [o]c(m=2)', - Code => '$c(m => 0) = $a(m => 0) + $b(m => 0);', -); - # test XS args with OtherPars pp_def('gl_arrows', Pars => 'coords(tri=3,n); int indsa(); int indsb();', @@ -445,10 +418,6 @@ for (byte,short,ushort,long,float,double) { is( $y->at, 3000 ); } -setdim(($x=null),10); -is( join(',',$x->dims), "10" ); -ok( tapprox($x,sequence(10)) ); - { my @msg; local $SIG{__WARN__} = sub { push @msg, @_ }; @@ -457,19 +426,6 @@ like $@, qr/croaking/, 'right error message'; is_deeply \@msg, [], 'no warnings' or diag explain \@msg; } -# this used to segv under solaris according to Karl -{ - my $ny=7; - $x = double xvals zeroes (20,$ny); - fooseg $x, $y=null; - ok( 1 ); # if we get here at all that is alright - ok( tapprox($x,$y) ) - or diag($x, "\n", $y); -} - -eval { _flatten_into(null, 2) }; -ok 1; #was also segfaulting - # test that continues in a broadcastloop work { my $in = sequence(10); @@ -484,8 +440,6 @@ ok 1; #was also segfaulting or do { diag "got : $got"; diag "expected: $exp" }; } -Cpow(sequence(2), 1); - polyfill_pp(zeroes(5,5), ones(2,3), 1); eval { polyfill_pp(ones(2,3), 1) }; like $@, qr/Usage/; diff --git a/t/core.t b/t/core.t index 999acf2a2..931b984c1 100644 --- a/t/core.t +++ b/t/core.t @@ -135,6 +135,15 @@ is $@, '', 'can "squeeze" an empty'; eval {empty->copy->make_physical}; is $@, '', 'can physicalise the copy of an empty'; +# capture ancient pptest.t test for Solaris segfault +ok all(tapprox(norm(pdl 3,4), pdl(0.6,0.8))), 'vector quasi-copy works'; +# pptest for null input +eval {(my $tmp=null) .= null}; like $@, qr/input.*null/; +# pptest for OtherPars=>named dim +ok all(tapprox((5*sequence(5))->maximum_n_ind(3), pdl(4,3,2))), 'named dim'; +# pptest for dim with fixed value +ok all(tapprox(crossp([1..3],[4..6]), pdl(-3,6,-3))), 'named dim=3'; + # test topdl { package # hide from PAUSE