Commit | Line | Data |
3e61d65a |
1 | package XS::APItest; |
2 | |
3 | use 5.008; |
4 | use strict; |
5 | use warnings; |
6 | use Carp; |
7 | |
8 | use base qw/ DynaLoader Exporter /; |
9 | |
10 | # Items to export into callers namespace by default. Note: do not export |
11 | # names by default without a very good reason. Use EXPORT_OK instead. |
12 | # Do not simply export all your public functions/methods/constants. |
13 | |
14 | # Export everything since these functions are only used by a test script |
deec275f |
15 | our @EXPORT = qw( print_double print_int print_long |
9d911683 |
16 | print_float print_long_double have_long_double print_flush |
d4b90eee |
17 | mpushp mpushn mpushi mpushu |
18 | mxpushp mxpushn mxpushi mxpushu |
3e61d65a |
19 | ); |
20 | |
ff270add |
21 | our $VERSION = '0.04'; |
3e61d65a |
22 | |
23 | bootstrap XS::APItest $VERSION; |
24 | |
25 | 1; |
26 | __END__ |
27 | |
28 | =head1 NAME |
29 | |
30 | XS::APItest - Test the perl C API |
31 | |
32 | =head1 SYNOPSIS |
33 | |
34 | use XS::APItest; |
35 | print_double(4); |
36 | |
37 | =head1 ABSTRACT |
38 | |
39 | This module tests the perl C API. Currently tests that C<printf> |
40 | works correctly. |
41 | |
42 | =head1 DESCRIPTION |
43 | |
44 | This module can be used to check that the perl C API is behaving |
45 | correctly. This module provides test functions and an associated |
46 | test script that verifies the output. |
47 | |
48 | This module is not meant to be installed. |
49 | |
50 | =head2 EXPORT |
51 | |
52 | Exports all the test functions: |
53 | |
54 | =over 4 |
55 | |
56 | =item B<print_double> |
57 | |
58 | Test that a double-precision floating point number is formatted |
59 | correctly by C<printf>. |
60 | |
61 | print_double( $val ); |
62 | |
63 | Output is sent to STDOUT. |
64 | |
65 | =item B<print_long_double> |
66 | |
67 | Test that a C<long double> is formatted correctly by |
68 | C<printf>. Takes no arguments - the test value is hard-wired |
69 | into the function (as "7"). |
70 | |
71 | print_long_double(); |
72 | |
73 | Output is sent to STDOUT. |
74 | |
75 | =item B<have_long_double> |
76 | |
77 | Determine whether a C<long double> is supported by Perl. This should |
78 | be used to determine whether to test C<print_long_double>. |
79 | |
80 | print_long_double() if have_long_double; |
81 | |
82 | =item B<print_nv> |
83 | |
84 | Test that an C<NV> is formatted correctly by |
85 | C<printf>. |
86 | |
87 | print_nv( $val ); |
88 | |
89 | Output is sent to STDOUT. |
90 | |
91 | =item B<print_iv> |
92 | |
93 | Test that an C<IV> is formatted correctly by |
94 | C<printf>. |
95 | |
96 | print_iv( $val ); |
97 | |
98 | Output is sent to STDOUT. |
99 | |
100 | =item B<print_uv> |
101 | |
102 | Test that an C<UV> is formatted correctly by |
103 | C<printf>. |
104 | |
105 | print_uv( $val ); |
106 | |
107 | Output is sent to STDOUT. |
108 | |
109 | =item B<print_int> |
110 | |
111 | Test that an C<int> is formatted correctly by |
112 | C<printf>. |
113 | |
114 | print_int( $val ); |
115 | |
116 | Output is sent to STDOUT. |
117 | |
118 | =item B<print_long> |
119 | |
120 | Test that an C<long> is formatted correctly by |
121 | C<printf>. |
122 | |
123 | print_long( $val ); |
124 | |
125 | Output is sent to STDOUT. |
126 | |
127 | =item B<print_float> |
128 | |
129 | Test that a single-precision floating point number is formatted |
130 | correctly by C<printf>. |
131 | |
132 | print_float( $val ); |
133 | |
134 | Output is sent to STDOUT. |
135 | |
136 | =back |
137 | |
138 | =head1 SEE ALSO |
139 | |
140 | L<XS::Typemap>, L<perlapi>. |
141 | |
142 | =head1 AUTHORS |
143 | |
144 | Tim Jenness, E<lt>t.jenness@jach.hawaii.eduE<gt>, |
145 | Christian Soeller, E<lt>csoelle@mph.auckland.ac.nzE<gt>, |
146 | Hugo van der Sanden E<lt>hv@crypt.compulink.co.ukE<gt> |
147 | |
148 | =head1 COPYRIGHT AND LICENSE |
149 | |
150 | Copyright (C) 2002 Tim Jenness, Christian Soeller, Hugo van der Sanden. |
151 | All Rights Reserved. |
152 | |
153 | This library is free software; you can redistribute it and/or modify |
154 | it under the same terms as Perl itself. |
155 | |
156 | =cut |