1
pp_addpm({At=>Top},<<'EOPM');
5
PDL::Tests - tests for some PP features
15
This module provides some PP defined test functions that are
16
supposed to test some features/bugs of PDL::PP.
18
Strictly speaking this module shouldn't be installed with a
19
'make install' but I haven't yet worked out how to do it.
26
my ($name,%hash) = @_;
27
## $hash{Doc} = "=for ref\n\ninternal\n\nonly for internal testing purposes\n";
29
$name = "test_$name"; # prepend test_ to name
34
/* to test the $P vaffining */
35
void ppcp(PDL_Byte *dst, PDL_Byte *src, int len)
44
# test the $P vaffine behaviour
45
# when 'phys' flag is in.
47
Pars => 'byte [phys]a1(n); byte [o,phys]b(n)',
49
Code => 'ppcp($P(b),$P(a1),$SIZE(n));',
57
# Pars => 'a1(n); double [o]b();',
58
# Code => 'PDL_Double tmp = 0;
59
# loop(n) %{ tmp += $a1(); %}
64
# and also test if numerals in variable name work
67
Pars => 'a1(n); float [o]b();',
68
Code => 'PDL_Float tmp = 0;
69
loop(n) %{ tmp += $a1(); %}
73
# test GENERIC with type+ qualifier
76
Pars => 'a(n); int+ [o]b();',
77
Code => '$GENERIC(b) tmp = 0;
78
loop(n) %{ tmp += $a(); %}
82
# test to set named dim with 'OtherPar'
85
OtherPars => 'int ns => n',
86
Code => 'loop(n) %{ $a() = n; %}',
89
# according to Karl this segvs with certain pdls
92
Pars => 'a(n); [o]b(n);',
94
loop(n) %{ $b() = $a(); %}