Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/function/doc/tests.xml @ 13

Last change on this file since 13 was 12, checked in by landauf, 18 years ago

added boost

File size: 7.5 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
3  "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
4<testsuite id="function.testsuite" last-revision="$Date: 2004/01/25 00:38:26 $">
5  <run-test filename="function_test.cpp" name="lib_function_test">
6    <purpose><para>Test the capabilities of the <classname>boost::function</classname> class template.</para></purpose>
7    <if-fails><para>The <classname>boost::function</classname> class template may not be usable on your compiler. However, the library may still be usable via the <classname>boost::functionN</classname> class templates.</para></if-fails>
8  </run-test>
9
10  <run-test filename="function_n_test.cpp">
11    <purpose><para>Test the capabilities of the <classname>boost::functionN</classname> class templates.</para></purpose>
12  </run-test>
13
14  <run-test filename="allocator_test.cpp">
15    <purpose><para>Test the use of custom allocators.</para></purpose>
16    <if-fails><para>Allocators are ignored by the implementation.</para></if-fails>
17  </run-test>
18
19  <run-test filename="stateless_test.cpp">
20    <purpose><para>Test the optimization of stateless function objects in the Boost.Function library.</para></purpose>
21    <if-fails><para>The exception-safety and performance guarantees given for stateless function objects may not be met by the implementation.</para></if-fails>
22  </run-test>
23
24  <run-test filename="lambda_test.cpp">
25    <purpose><para>Test the interaction between Boost.Function and Boost.Lambda.</para></purpose>
26    <if-fails><para>Either Boost.Lambda does not work on the platform, or Boost.Function cannot safely be applied without the use of <functionname>boost::unlambda</functionname>.</para></if-fails>
27  </run-test>
28
29  <run-test filename="contains_test.cpp">
30    <purpose><para>Test the operation of the
31    <code><methodname>target</methodname></code> member function and the
32    equality operators.</para></purpose>
33  </run-test>
34
35  <compile-fail-test filename="function_test_fail1.cpp">
36    <purpose><para>Test the (incorrect!) use of comparisons between Boost.Function function objects.</para></purpose>
37    <if-fails><para>Intuitive (but incorrect!) code may compile and will give meaningless results.</para></if-fails>
38  </compile-fail-test>
39
40  <compile-fail-test filename="function_test_fail2.cpp">
41    <purpose><para>Test the use of an incompatible function object with Boost.Function</para></purpose>
42    <if-fails><para>Incorrect code may compile (with potentially unexpected results).</para></if-fails>
43  </compile-fail-test>
44
45  <compile-test filename="function_30.cpp">
46    <purpose><para>Test the generation of a Boost.Function function object adaptor accepting 30 arguments.</para></purpose>
47    <if-fails><para>The Boost.Function library may work for function object adaptors of up to 10 parameters, but will be unable to generate adaptors for an arbitrary number of parameters. Failure often indicates an error in the compiler's preprocessor.</para></if-fails>
48  </compile-test> 
49
50  <run-test filename="function_arith_cxx98.cpp">
51    <source>
52    <![CDATA[
53#include <boost/function.hpp>
54#include <iostream>
55]]>
56
57<snippet name="function.tutorial.mul_ints"/>
58<snippet name="function.tutorial.int_div"/>
59
60int main()
61{
62    <snippet name="function.tutorial.arith.cxx98"/>
63    <snippet name="function.tutorial.use_int_div"/>
64    <snippet name="function.tutorial.call_int_div"/>
65    <snippet name="function.tutorial.check_empty"/>
66    <snippet name="function.tutorial.clear"/>
67    <snippet name="function.tutorial.use_mul_ints"/>
68 
69    return 0;
70}
71</source>
72    <purpose><para>Test the first tutorial example.</para></purpose>
73  </run-test>
74
75  <run-test filename="function_arith_portable.cpp">
76    <source>
77    <![CDATA[
78#include <boost/function.hpp>
79#include <iostream>
80]]>
81<snippet name="function.tutorial.mul_ints"/>
82<snippet name="function.tutorial.int_div"/>
83int main()
84{
85    <snippet name="function.tutorial.arith.portable"/>
86    <snippet name="function.tutorial.use_int_div"/>
87    <snippet name="function.tutorial.call_int_div"/>
88    <snippet name="function.tutorial.check_empty"/>
89    <snippet name="function.tutorial.clear"/>
90    <snippet name="function.tutorial.use_mul_ints"/>
91
92    return 0;
93}
94</source>
95    <purpose><para>Test the first tutorial example.</para></purpose>
96  </run-test>
97
98  <run-test filename="sum_avg_cxx98.cpp">
99    <source>
100    <![CDATA[
101#include <boost/function.hpp>
102#include <iostream>
103]]>
104<snippet name="function.tutorial.sum_avg"/>
105int main()
106{
107    <snippet name="function.tutorial.sum_avg_decl.cxx98"/>
108    <snippet name="function.tutorial.use_sum_avg"/>
109
110    return 0;
111}
112</source>
113    <purpose><para>Test the second tutorial example.</para></purpose>
114  </run-test>
115
116  <run-test filename="sum_avg_portable.cpp">
117    <source>
118    <![CDATA[
119#include <boost/function.hpp>
120#include <iostream>
121]]>
122<snippet name="function.tutorial.sum_avg"/>
123int main()
124{
125    <snippet name="function.tutorial.sum_avg_decl.portable"/>
126    <snippet name="function.tutorial.use_sum_avg"/>
127
128    return 0;
129}
130</source>
131    <purpose><para>Test the second tutorial example.</para></purpose>
132  </run-test>
133
134  <run-test filename="mem_fun_cxx98.cpp">
135    <source>
136    <![CDATA[
137#include <boost/function.hpp>
138#include <iostream>
139#include <functional>
140]]>
141<snippet name="function.tutorial.X"/>
142int X::foo(int x) { return -x; }
143
144int main()
145{
146    <snippet name="function.tutorial.mem_fun.cxx98"/>
147
148    return 0;
149}
150</source>   
151    <purpose><para>Test member function example from tutorial.</para></purpose>
152  </run-test>
153
154  <run-test filename="mem_fun_portable.cpp">
155    <source>
156    <![CDATA[
157#include <boost/function.hpp>
158#include <iostream>
159#include <functional>
160]]>
161<snippet name="function.tutorial.X"/>
162int X::foo(int x) { return -x; }
163
164int main()
165{
166    <snippet name="function.tutorial.mem_fun.portable"/>
167
168    return 0;
169}
170</source>   
171    <purpose><para>Test member function example from tutorial.</para></purpose>
172  </run-test>
173
174  <run-test filename="std_bind_cxx98.cpp">
175    <source>
176    <![CDATA[
177#include <boost/function.hpp>
178#include <iostream>
179#include <functional>
180]]>
181<snippet name="function.tutorial.X"/>
182int X::foo(int x) { return -x; }
183
184int main()
185{
186    <snippet name="function.tutorial.std_bind.cxx98"/>
187
188    return 0;
189}
190</source>
191    <purpose><para>Test standard binders example from tutorial.</para></purpose>
192  </run-test>
193
194  <run-test filename="std_bind_portable.cpp">
195    <source>
196    <![CDATA[
197#include <boost/function.hpp>
198#include <iostream>
199#include <functional>
200]]>
201<snippet name="function.tutorial.X"/>
202int X::foo(int x) { return -x; }
203
204int main()
205{
206    <snippet name="function.tutorial.std_bind.portable"/>
207
208    return 0;
209}
210</source>
211    <purpose><para>Test standard binders example from tutorial.</para></purpose>
212  </run-test>
213
214  <run-test filename="function_ref_cxx98.cpp">
215    <source>
216<![CDATA[
217#include <boost/function.hpp>
218#include <iostream>
219]]>
220
221struct stateful_type { int operator()(int) const { return 0; } };
222
223int main()
224{
225  <snippet name="function.tutorial.ref.cxx98"/>
226
227    return 0;
228}
229</source>
230    <purpose><para>Test <functionname>boost::ref</functionname> example from tutorial.</para></purpose>
231  </run-test>
232
233  <run-test filename="function_ref_portable.cpp">
234    <source>
235<![CDATA[
236#include <boost/function.hpp>
237#include <iostream>
238]]>
239
240struct stateful_type { int operator()(int) const { return 0; } };
241
242int main()
243{
244  <snippet name="function.tutorial.ref.portable"/>
245
246    return 0;
247}
248</source>
249    <purpose><para>Test <functionname>boost::ref</functionname> example from tutorial.</para></purpose>
250  </run-test>
251</testsuite>
Note: See TracBrowser for help on using the repository browser.