xref: /minix3/external/bsd/atf/dist/tools/auto_array_test.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc //
2*0a6a1f1dSLionel Sambuc // Automated Testing Framework (atf)
3*0a6a1f1dSLionel Sambuc //
4*0a6a1f1dSLionel Sambuc // Copyright (c) 2007 The NetBSD Foundation, Inc.
5*0a6a1f1dSLionel Sambuc // All rights reserved.
6*0a6a1f1dSLionel Sambuc //
7*0a6a1f1dSLionel Sambuc // Redistribution and use in source and binary forms, with or without
8*0a6a1f1dSLionel Sambuc // modification, are permitted provided that the following conditions
9*0a6a1f1dSLionel Sambuc // are met:
10*0a6a1f1dSLionel Sambuc // 1. Redistributions of source code must retain the above copyright
11*0a6a1f1dSLionel Sambuc //    notice, this list of conditions and the following disclaimer.
12*0a6a1f1dSLionel Sambuc // 2. Redistributions in binary form must reproduce the above copyright
13*0a6a1f1dSLionel Sambuc //    notice, this list of conditions and the following disclaimer in the
14*0a6a1f1dSLionel Sambuc //    documentation and/or other materials provided with the distribution.
15*0a6a1f1dSLionel Sambuc //
16*0a6a1f1dSLionel Sambuc // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
17*0a6a1f1dSLionel Sambuc // CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18*0a6a1f1dSLionel Sambuc // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19*0a6a1f1dSLionel Sambuc // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20*0a6a1f1dSLionel Sambuc // IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21*0a6a1f1dSLionel Sambuc // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*0a6a1f1dSLionel Sambuc // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23*0a6a1f1dSLionel Sambuc // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24*0a6a1f1dSLionel Sambuc // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25*0a6a1f1dSLionel Sambuc // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26*0a6a1f1dSLionel Sambuc // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27*0a6a1f1dSLionel Sambuc // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*0a6a1f1dSLionel Sambuc //
29*0a6a1f1dSLionel Sambuc 
30*0a6a1f1dSLionel Sambuc extern "C" {
31*0a6a1f1dSLionel Sambuc #include <sys/types.h>
32*0a6a1f1dSLionel Sambuc }
33*0a6a1f1dSLionel Sambuc 
34*0a6a1f1dSLionel Sambuc #include <iostream>
35*0a6a1f1dSLionel Sambuc 
36*0a6a1f1dSLionel Sambuc #include <atf-c++.hpp>
37*0a6a1f1dSLionel Sambuc 
38*0a6a1f1dSLionel Sambuc #include "auto_array.hpp"
39*0a6a1f1dSLionel Sambuc 
40*0a6a1f1dSLionel Sambuc // ------------------------------------------------------------------------
41*0a6a1f1dSLionel Sambuc // Tests for the "auto_array" class.
42*0a6a1f1dSLionel Sambuc // ------------------------------------------------------------------------
43*0a6a1f1dSLionel Sambuc 
44*0a6a1f1dSLionel Sambuc class test_array {
45*0a6a1f1dSLionel Sambuc public:
46*0a6a1f1dSLionel Sambuc     int m_value;
47*0a6a1f1dSLionel Sambuc 
48*0a6a1f1dSLionel Sambuc     static ssize_t m_nblocks;
49*0a6a1f1dSLionel Sambuc 
50*0a6a1f1dSLionel Sambuc     static
51*0a6a1f1dSLionel Sambuc     tools::auto_array< test_array >
do_copy(tools::auto_array<test_array> & ta)52*0a6a1f1dSLionel Sambuc     do_copy(tools::auto_array< test_array >& ta)
53*0a6a1f1dSLionel Sambuc     {
54*0a6a1f1dSLionel Sambuc         return tools::auto_array< test_array >(ta);
55*0a6a1f1dSLionel Sambuc     }
56*0a6a1f1dSLionel Sambuc 
operator new(size_t size)57*0a6a1f1dSLionel Sambuc     void* operator new(size_t size __attribute__((__unused__)))
58*0a6a1f1dSLionel Sambuc     {
59*0a6a1f1dSLionel Sambuc         ATF_FAIL("New called but should have been new[]");
60*0a6a1f1dSLionel Sambuc         return new int(5);
61*0a6a1f1dSLionel Sambuc     }
62*0a6a1f1dSLionel Sambuc 
operator new[](size_t size)63*0a6a1f1dSLionel Sambuc     void* operator new[](size_t size)
64*0a6a1f1dSLionel Sambuc     {
65*0a6a1f1dSLionel Sambuc         m_nblocks++;
66*0a6a1f1dSLionel Sambuc         void* mem = ::operator new(size);
67*0a6a1f1dSLionel Sambuc         std::cout << "Allocated 'test_array' object " << mem << "\n";
68*0a6a1f1dSLionel Sambuc         return mem;
69*0a6a1f1dSLionel Sambuc     }
70*0a6a1f1dSLionel Sambuc 
operator delete(void * mem)71*0a6a1f1dSLionel Sambuc     void operator delete(void* mem __attribute__((__unused__)))
72*0a6a1f1dSLionel Sambuc     {
73*0a6a1f1dSLionel Sambuc         ATF_FAIL("Delete called but should have been delete[]");
74*0a6a1f1dSLionel Sambuc     }
75*0a6a1f1dSLionel Sambuc 
operator delete[](void * mem)76*0a6a1f1dSLionel Sambuc     void operator delete[](void* mem)
77*0a6a1f1dSLionel Sambuc     {
78*0a6a1f1dSLionel Sambuc         std::cout << "Releasing 'test_array' object " << mem << "\n";
79*0a6a1f1dSLionel Sambuc         if (m_nblocks == 0)
80*0a6a1f1dSLionel Sambuc             ATF_FAIL("Unbalanced delete[]");
81*0a6a1f1dSLionel Sambuc         m_nblocks--;
82*0a6a1f1dSLionel Sambuc         ::operator delete(mem);
83*0a6a1f1dSLionel Sambuc     }
84*0a6a1f1dSLionel Sambuc };
85*0a6a1f1dSLionel Sambuc 
86*0a6a1f1dSLionel Sambuc ssize_t test_array::m_nblocks = 0;
87*0a6a1f1dSLionel Sambuc 
88*0a6a1f1dSLionel Sambuc ATF_TEST_CASE(auto_array_scope);
ATF_TEST_CASE_HEAD(auto_array_scope)89*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_HEAD(auto_array_scope)
90*0a6a1f1dSLionel Sambuc {
91*0a6a1f1dSLionel Sambuc     set_md_var("descr", "Tests the automatic scope handling in the "
92*0a6a1f1dSLionel Sambuc                "auto_array smart pointer class");
93*0a6a1f1dSLionel Sambuc }
ATF_TEST_CASE_BODY(auto_array_scope)94*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(auto_array_scope)
95*0a6a1f1dSLionel Sambuc {
96*0a6a1f1dSLionel Sambuc     using tools::auto_array;
97*0a6a1f1dSLionel Sambuc 
98*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
99*0a6a1f1dSLionel Sambuc     {
100*0a6a1f1dSLionel Sambuc         auto_array< test_array > t(new test_array[10]);
101*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 1);
102*0a6a1f1dSLionel Sambuc     }
103*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
104*0a6a1f1dSLionel Sambuc }
105*0a6a1f1dSLionel Sambuc 
106*0a6a1f1dSLionel Sambuc ATF_TEST_CASE(auto_array_copy);
ATF_TEST_CASE_HEAD(auto_array_copy)107*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_HEAD(auto_array_copy)
108*0a6a1f1dSLionel Sambuc {
109*0a6a1f1dSLionel Sambuc     set_md_var("descr", "Tests the auto_array smart pointer class' copy "
110*0a6a1f1dSLionel Sambuc                "constructor");
111*0a6a1f1dSLionel Sambuc }
ATF_TEST_CASE_BODY(auto_array_copy)112*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(auto_array_copy)
113*0a6a1f1dSLionel Sambuc {
114*0a6a1f1dSLionel Sambuc     using tools::auto_array;
115*0a6a1f1dSLionel Sambuc 
116*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
117*0a6a1f1dSLionel Sambuc     {
118*0a6a1f1dSLionel Sambuc         auto_array< test_array > t1(new test_array[10]);
119*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 1);
120*0a6a1f1dSLionel Sambuc 
121*0a6a1f1dSLionel Sambuc         {
122*0a6a1f1dSLionel Sambuc             auto_array< test_array > t2(t1);
123*0a6a1f1dSLionel Sambuc             ATF_REQUIRE_EQ(test_array::m_nblocks, 1);
124*0a6a1f1dSLionel Sambuc         }
125*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
126*0a6a1f1dSLionel Sambuc     }
127*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
128*0a6a1f1dSLionel Sambuc }
129*0a6a1f1dSLionel Sambuc 
130*0a6a1f1dSLionel Sambuc ATF_TEST_CASE(auto_array_copy_ref);
ATF_TEST_CASE_HEAD(auto_array_copy_ref)131*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_HEAD(auto_array_copy_ref)
132*0a6a1f1dSLionel Sambuc {
133*0a6a1f1dSLionel Sambuc     set_md_var("descr", "Tests the auto_array smart pointer class' copy "
134*0a6a1f1dSLionel Sambuc                "constructor through the auxiliary auto_array_ref object");
135*0a6a1f1dSLionel Sambuc }
ATF_TEST_CASE_BODY(auto_array_copy_ref)136*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(auto_array_copy_ref)
137*0a6a1f1dSLionel Sambuc {
138*0a6a1f1dSLionel Sambuc     using tools::auto_array;
139*0a6a1f1dSLionel Sambuc 
140*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
141*0a6a1f1dSLionel Sambuc     {
142*0a6a1f1dSLionel Sambuc         auto_array< test_array > t1(new test_array[10]);
143*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 1);
144*0a6a1f1dSLionel Sambuc 
145*0a6a1f1dSLionel Sambuc         {
146*0a6a1f1dSLionel Sambuc             auto_array< test_array > t2 = test_array::do_copy(t1);
147*0a6a1f1dSLionel Sambuc             ATF_REQUIRE_EQ(test_array::m_nblocks, 1);
148*0a6a1f1dSLionel Sambuc         }
149*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
150*0a6a1f1dSLionel Sambuc     }
151*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
152*0a6a1f1dSLionel Sambuc }
153*0a6a1f1dSLionel Sambuc 
154*0a6a1f1dSLionel Sambuc ATF_TEST_CASE(auto_array_get);
ATF_TEST_CASE_HEAD(auto_array_get)155*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_HEAD(auto_array_get)
156*0a6a1f1dSLionel Sambuc {
157*0a6a1f1dSLionel Sambuc     set_md_var("descr", "Tests the auto_array smart pointer class' get "
158*0a6a1f1dSLionel Sambuc                "method");
159*0a6a1f1dSLionel Sambuc }
ATF_TEST_CASE_BODY(auto_array_get)160*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(auto_array_get)
161*0a6a1f1dSLionel Sambuc {
162*0a6a1f1dSLionel Sambuc     using tools::auto_array;
163*0a6a1f1dSLionel Sambuc 
164*0a6a1f1dSLionel Sambuc     test_array* ta = new test_array[10];
165*0a6a1f1dSLionel Sambuc     auto_array< test_array > t(ta);
166*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(t.get(), ta);
167*0a6a1f1dSLionel Sambuc }
168*0a6a1f1dSLionel Sambuc 
169*0a6a1f1dSLionel Sambuc ATF_TEST_CASE(auto_array_release);
ATF_TEST_CASE_HEAD(auto_array_release)170*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_HEAD(auto_array_release)
171*0a6a1f1dSLionel Sambuc {
172*0a6a1f1dSLionel Sambuc     set_md_var("descr", "Tests the auto_array smart pointer class' release "
173*0a6a1f1dSLionel Sambuc                "method");
174*0a6a1f1dSLionel Sambuc }
ATF_TEST_CASE_BODY(auto_array_release)175*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(auto_array_release)
176*0a6a1f1dSLionel Sambuc {
177*0a6a1f1dSLionel Sambuc     using tools::auto_array;
178*0a6a1f1dSLionel Sambuc 
179*0a6a1f1dSLionel Sambuc     test_array* ta1 = new test_array[10];
180*0a6a1f1dSLionel Sambuc     {
181*0a6a1f1dSLionel Sambuc         auto_array< test_array > t(ta1);
182*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 1);
183*0a6a1f1dSLionel Sambuc         test_array* ta2 = t.release();
184*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(ta2, ta1);
185*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 1);
186*0a6a1f1dSLionel Sambuc     }
187*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(test_array::m_nblocks, 1);
188*0a6a1f1dSLionel Sambuc     delete [] ta1;
189*0a6a1f1dSLionel Sambuc }
190*0a6a1f1dSLionel Sambuc 
191*0a6a1f1dSLionel Sambuc ATF_TEST_CASE(auto_array_reset);
ATF_TEST_CASE_HEAD(auto_array_reset)192*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_HEAD(auto_array_reset)
193*0a6a1f1dSLionel Sambuc {
194*0a6a1f1dSLionel Sambuc     set_md_var("descr", "Tests the auto_array smart pointer class' reset "
195*0a6a1f1dSLionel Sambuc                "method");
196*0a6a1f1dSLionel Sambuc }
ATF_TEST_CASE_BODY(auto_array_reset)197*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(auto_array_reset)
198*0a6a1f1dSLionel Sambuc {
199*0a6a1f1dSLionel Sambuc     using tools::auto_array;
200*0a6a1f1dSLionel Sambuc 
201*0a6a1f1dSLionel Sambuc     test_array* ta1 = new test_array[10];
202*0a6a1f1dSLionel Sambuc     test_array* ta2 = new test_array[10];
203*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(test_array::m_nblocks, 2);
204*0a6a1f1dSLionel Sambuc 
205*0a6a1f1dSLionel Sambuc     {
206*0a6a1f1dSLionel Sambuc         auto_array< test_array > t(ta1);
207*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 2);
208*0a6a1f1dSLionel Sambuc         t.reset(ta2);
209*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 1);
210*0a6a1f1dSLionel Sambuc         t.reset();
211*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
212*0a6a1f1dSLionel Sambuc     }
213*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
214*0a6a1f1dSLionel Sambuc }
215*0a6a1f1dSLionel Sambuc 
216*0a6a1f1dSLionel Sambuc ATF_TEST_CASE(auto_array_assign);
ATF_TEST_CASE_HEAD(auto_array_assign)217*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_HEAD(auto_array_assign)
218*0a6a1f1dSLionel Sambuc {
219*0a6a1f1dSLionel Sambuc     set_md_var("descr", "Tests the auto_array smart pointer class' "
220*0a6a1f1dSLionel Sambuc                "assignment operator");
221*0a6a1f1dSLionel Sambuc }
ATF_TEST_CASE_BODY(auto_array_assign)222*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(auto_array_assign)
223*0a6a1f1dSLionel Sambuc {
224*0a6a1f1dSLionel Sambuc     using tools::auto_array;
225*0a6a1f1dSLionel Sambuc 
226*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
227*0a6a1f1dSLionel Sambuc     {
228*0a6a1f1dSLionel Sambuc         auto_array< test_array > t1(new test_array[10]);
229*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 1);
230*0a6a1f1dSLionel Sambuc 
231*0a6a1f1dSLionel Sambuc         {
232*0a6a1f1dSLionel Sambuc             auto_array< test_array > t2;
233*0a6a1f1dSLionel Sambuc             t2 = t1;
234*0a6a1f1dSLionel Sambuc             ATF_REQUIRE_EQ(test_array::m_nblocks, 1);
235*0a6a1f1dSLionel Sambuc         }
236*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
237*0a6a1f1dSLionel Sambuc     }
238*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
239*0a6a1f1dSLionel Sambuc }
240*0a6a1f1dSLionel Sambuc 
241*0a6a1f1dSLionel Sambuc ATF_TEST_CASE(auto_array_assign_ref);
ATF_TEST_CASE_HEAD(auto_array_assign_ref)242*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_HEAD(auto_array_assign_ref)
243*0a6a1f1dSLionel Sambuc {
244*0a6a1f1dSLionel Sambuc     set_md_var("descr", "Tests the auto_array smart pointer class' "
245*0a6a1f1dSLionel Sambuc                "assignment operator through the auxiliary auto_array_ref "
246*0a6a1f1dSLionel Sambuc                "object");
247*0a6a1f1dSLionel Sambuc }
ATF_TEST_CASE_BODY(auto_array_assign_ref)248*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(auto_array_assign_ref)
249*0a6a1f1dSLionel Sambuc {
250*0a6a1f1dSLionel Sambuc     using tools::auto_array;
251*0a6a1f1dSLionel Sambuc 
252*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
253*0a6a1f1dSLionel Sambuc     {
254*0a6a1f1dSLionel Sambuc         auto_array< test_array > t1(new test_array[10]);
255*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 1);
256*0a6a1f1dSLionel Sambuc 
257*0a6a1f1dSLionel Sambuc         {
258*0a6a1f1dSLionel Sambuc             auto_array< test_array > t2;
259*0a6a1f1dSLionel Sambuc             t2 = test_array::do_copy(t1);
260*0a6a1f1dSLionel Sambuc             ATF_REQUIRE_EQ(test_array::m_nblocks, 1);
261*0a6a1f1dSLionel Sambuc         }
262*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
263*0a6a1f1dSLionel Sambuc     }
264*0a6a1f1dSLionel Sambuc     ATF_REQUIRE_EQ(test_array::m_nblocks, 0);
265*0a6a1f1dSLionel Sambuc }
266*0a6a1f1dSLionel Sambuc 
267*0a6a1f1dSLionel Sambuc ATF_TEST_CASE(auto_array_access);
ATF_TEST_CASE_HEAD(auto_array_access)268*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_HEAD(auto_array_access)
269*0a6a1f1dSLionel Sambuc {
270*0a6a1f1dSLionel Sambuc     set_md_var("descr", "Tests the auto_array smart pointer class' access "
271*0a6a1f1dSLionel Sambuc                "operator");
272*0a6a1f1dSLionel Sambuc }
ATF_TEST_CASE_BODY(auto_array_access)273*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(auto_array_access)
274*0a6a1f1dSLionel Sambuc {
275*0a6a1f1dSLionel Sambuc     using tools::auto_array;
276*0a6a1f1dSLionel Sambuc 
277*0a6a1f1dSLionel Sambuc     auto_array< test_array > t(new test_array[10]);
278*0a6a1f1dSLionel Sambuc 
279*0a6a1f1dSLionel Sambuc     for (int i = 0; i < 10; i++)
280*0a6a1f1dSLionel Sambuc         t[i].m_value = i * 2;
281*0a6a1f1dSLionel Sambuc 
282*0a6a1f1dSLionel Sambuc     for (int i = 0; i < 10; i++)
283*0a6a1f1dSLionel Sambuc         ATF_REQUIRE_EQ(t[i].m_value, i * 2);
284*0a6a1f1dSLionel Sambuc }
285*0a6a1f1dSLionel Sambuc 
286*0a6a1f1dSLionel Sambuc // ------------------------------------------------------------------------
287*0a6a1f1dSLionel Sambuc // Main.
288*0a6a1f1dSLionel Sambuc // ------------------------------------------------------------------------
289*0a6a1f1dSLionel Sambuc 
ATF_INIT_TEST_CASES(tcs)290*0a6a1f1dSLionel Sambuc ATF_INIT_TEST_CASES(tcs)
291*0a6a1f1dSLionel Sambuc {
292*0a6a1f1dSLionel Sambuc     // Add the test for the "auto_array" class.
293*0a6a1f1dSLionel Sambuc     ATF_ADD_TEST_CASE(tcs, auto_array_scope);
294*0a6a1f1dSLionel Sambuc     ATF_ADD_TEST_CASE(tcs, auto_array_copy);
295*0a6a1f1dSLionel Sambuc     ATF_ADD_TEST_CASE(tcs, auto_array_copy_ref);
296*0a6a1f1dSLionel Sambuc     ATF_ADD_TEST_CASE(tcs, auto_array_get);
297*0a6a1f1dSLionel Sambuc     ATF_ADD_TEST_CASE(tcs, auto_array_release);
298*0a6a1f1dSLionel Sambuc     ATF_ADD_TEST_CASE(tcs, auto_array_reset);
299*0a6a1f1dSLionel Sambuc     ATF_ADD_TEST_CASE(tcs, auto_array_assign);
300*0a6a1f1dSLionel Sambuc     ATF_ADD_TEST_CASE(tcs, auto_array_assign_ref);
301*0a6a1f1dSLionel Sambuc     ATF_ADD_TEST_CASE(tcs, auto_array_access);
302*0a6a1f1dSLionel Sambuc }
303