1 
2 
3 // Boost.Range ATL Extension
4 //
5 // Copyright Shunsuke Sogame 2005-2006.
6 // Distributed under the Boost Software License, Version 1.0.
7 // (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9 
10 
11 // #include <pstade/vodka/drink.hpp>
12 
13 #include <boost/test/test_tools.hpp>
14 #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
15 #define _ATL_NO_AUTOMATIC_NAMESPACE
16 
17 #define BOOST_LIB_NAME boost_test_exec_monitor
18 #include <boost/config/auto_link.hpp>
19 
20 #define BOOST_RANGE_DETAIL_MICROSOFT_TEST
21 #include <boost/range/atl.hpp> // can be placed first
22 
23 
24 #include <map>
25 #include <string>
26 #include <boost/concept_check.hpp>
27 #include <boost/mpl/if.hpp>
28 #include <boost/range/begin.hpp>
29 #include <boost/range/distance.hpp>
30 #include <boost/range/iterator_range.hpp>
31 #include <boost/static_assert.hpp>
32 #include <boost/type_traits/is_same.hpp>
33 
34 
35 #include <boost/foreach.hpp>
36 
37 
38 #include <atlbase.h> // for ATL3 CSimpleArray/CSimpleValArray
39 #if !(_ATL_VER < 0x0700)
40     #include <atlcoll.h>
41     #include <cstringt.h>
42     #include <atlsimpstr.h>
43     #include <atlstr.h>
44 #endif
45 
46 
47 namespace brdm = boost::range_detail_microsoft;
48 
49 
50 #if !(_ATL_VER < 0x0700)
51 
52 
53 template< class ArrayT, class SampleRange >
test_init_auto_ptr_array(ArrayT & arr,SampleRange & sample)54 bool test_init_auto_ptr_array(ArrayT& arr, SampleRange& sample)
55 {
56     typedef typename boost::range_iterator<SampleRange>::type iter_t;
57 
58     for (iter_t it = boost::begin(sample), last = boost::end(sample); it != last; ++it) {
59         arr.Add(*it); // moves ownership
60     }
61 
62     return boost::distance(arr) == boost::distance(sample);
63 }
64 
65 
66 template< class ListT, class SampleRange >
test_init_auto_ptr_list(ListT & lst,SampleRange & sample)67 bool test_init_auto_ptr_list(ListT& lst, SampleRange& sample)
68 {
69     typedef typename boost::range_iterator<SampleRange>::type iter_t;
70     typedef typename boost::range_value<SampleRange>::type val_t;
71 
72     for (iter_t it = boost::begin(sample), last = boost::end(sample); it != last; ++it) {
73         lst.AddTail(*it); // moves ownership
74     }
75 
76     return boost::distance(lst) == boost::distance(sample);
77 }
78 
79 
80 // Workaround:
81 // CRBTree provides no easy access function, but yes, it is the range!
82 //
83 template< class AtlMapT, class KeyT, class MappedT >
test_atl_map_has(AtlMapT & map,const KeyT & k,const MappedT m)84 bool test_atl_map_has(AtlMapT& map, const KeyT& k, const MappedT m)
85 {
86     typedef typename boost::range_iterator<AtlMapT>::type iter_t;
87 
88     for (iter_t it = boost::begin(map), last = boost::end(map); it != last; ++it) {
89         if (it->m_key == k && it->m_value == m)
90             return true;
91     }
92 
93     return false;
94 }
95 
96 
97 template< class AtlMapT, class MapT >
test_atl_map(AtlMapT & map,const MapT & sample)98 bool test_atl_map(AtlMapT& map, const MapT& sample)
99 {
100     typedef typename boost::range_iterator<AtlMapT>::type iter_t;
101     typedef typename boost::range_const_iterator<MapT>::type siter_t;
102 
103     bool result = true;
104 
105     result = result && (boost::distance(map) == boost::distance(sample));
106     if (!result)
107         return false;
108 
109     {
110         for (iter_t it = boost::begin(map), last = boost::end(map); it != last; ++it) {
111             result = result && brdm::test_find_key_and_mapped(sample, std::make_pair(it->m_key, it->m_value));
112         }
113     }
114 
115     {
116         for (siter_t it = boost::begin(sample), last = boost::end(sample); it != last; ++it) {
117             result = result && (test_atl_map_has)(map, it->first, it->second);
118         }
119     }
120 
121     return result;
122 }
123 
124 
125 template< class MapT, class SampleMap >
test_init_atl_multimap(MapT & map,const SampleMap & sample)126 bool test_init_atl_multimap(MapT& map, const SampleMap& sample)
127 {
128     typedef typename boost::range_const_iterator<SampleMap>::type iter_t;
129 
130     for (iter_t it = boost::const_begin(sample), last = boost::const_end(sample); it != last; ++it) {
131         map.Insert(it->first, it->second);
132     }
133 
134     return boost::distance(map) == boost::distance(sample);
135 }
136 
137 
138 // arrays
139 //
140 
141 template< class Range >
test_CAtlArray(const Range & sample)142 void test_CAtlArray(const Range& sample)
143 {
144     typedef typename boost::range_value<Range>::type val_t;
145 
146     typedef ATL::CAtlArray<val_t> rng_t;
147     BOOST_STATIC_ASSERT(( brdm::test_mutable_iter<rng_t, val_t *>::value ));
148     BOOST_STATIC_ASSERT(( brdm::test_const_iter  <rng_t, val_t const*>::value ));
149 
150     rng_t rng;
151     BOOST_CHECK( brdm::test_init_array(rng, sample) );
152     BOOST_CHECK( brdm::test_random_access(rng) );
153     BOOST_CHECK( brdm::test_emptiness(rng) );
154 }
155 
156 
157 template< class ValT, class Range >
test_CAutoPtrArray(Range & sample)158 void test_CAutoPtrArray(Range& sample)
159 {
160     typedef ValT val_t;
161 
162     typedef ATL::CAutoPtrArray<val_t> rng_t;
163     BOOST_STATIC_ASSERT(( brdm::test_mutable_iter<rng_t, boost::indirect_iterator< ATL::CAutoPtr<val_t> *> >::value ));
164     BOOST_STATIC_ASSERT(( brdm::test_const_iter  <rng_t, boost::indirect_iterator< ATL::CAutoPtr<val_t> const*> >::value ));
165 
166     rng_t rng;
167     BOOST_CHECK( ::test_init_auto_ptr_array(rng, sample) );
168     BOOST_CHECK( brdm::test_random_access(rng) );
169     BOOST_CHECK( brdm::test_emptiness(rng) );
170 }
171 
172 
173 template< class I, class Range >
test_CInterfaceArray(const Range & sample)174 void test_CInterfaceArray(const Range& sample)
175 {
176     typedef typename boost::range_value<Range>::type val_t;
177 
178     typedef ATL::CInterfaceArray<I> rng_t;
179     BOOST_STATIC_ASSERT(( brdm::test_mutable_iter<rng_t, ATL::CComQIPtr<I> * >::value ));
180     BOOST_STATIC_ASSERT(( brdm::test_const_iter  <rng_t, ATL::CComQIPtr<I> const* >::value ));
181 
182     rng_t rng;
183     BOOST_CHECK( brdm::test_init_array(rng, sample) );
184     BOOST_CHECK( brdm::test_random_access(rng) );
185     BOOST_CHECK( brdm::test_emptiness(rng) );
186 }
187 
188 
189 // lists
190 //
191 
192 template< class Range >
test_CAtlList(const Range & sample)193 void test_CAtlList(const Range& sample)
194 {
195     typedef typename boost::range_value<Range>::type val_t;
196 
197     typedef ATL::CAtlList<val_t> rng_t;
198     BOOST_STATIC_ASSERT(( brdm::test_mutable_iter< rng_t, brdm::list_iterator<rng_t,       val_t> >::value ));
199     BOOST_STATIC_ASSERT(( brdm::test_const_iter  < rng_t, brdm::list_iterator<rng_t const, val_t const> >::value ));
200 
201     rng_t rng;
202     BOOST_CHECK( brdm::test_init_list(rng, sample) );
203     BOOST_CHECK( brdm::test_bidirectional(rng) );
204     BOOST_CHECK( brdm::test_emptiness(rng) );
205 }
206 
207 
208 template< class ValT, class Range >
test_CAutoPtrList(Range & sample)209 void test_CAutoPtrList(Range& sample)
210 {
211     typedef ValT val_t;
212 
213     typedef ATL::CAutoPtrList<val_t> rng_t;
214     BOOST_STATIC_ASSERT(( brdm::test_mutable_iter< rng_t, boost::indirect_iterator< brdm::list_iterator<rng_t,       ATL::CAutoPtr<val_t> > > >::value ));
215     BOOST_STATIC_ASSERT(( brdm::test_const_iter  < rng_t, boost::indirect_iterator< brdm::list_iterator<rng_t const, ATL::CAutoPtr<val_t> const> > >::value ));
216 
217     rng_t rng;
218     BOOST_CHECK( ::test_init_auto_ptr_list(rng, sample) );
219     BOOST_CHECK( brdm::test_bidirectional(rng) );
220     BOOST_CHECK( brdm::test_emptiness(rng) );
221 }
222 
223 
224 template< class ValT, class Range >
test_CHeapPtrList(const Range & sample)225 void test_CHeapPtrList(const Range& sample)
226 {
227     typedef ValT val_t;
228 
229     typedef ATL::CHeapPtrList<val_t> rng_t;
230     BOOST_STATIC_ASSERT(( brdm::test_mutable_iter< rng_t, boost::indirect_iterator< brdm::list_iterator<rng_t,       ATL::CHeapPtr<val_t> > > >::value ));
231     BOOST_STATIC_ASSERT(( brdm::test_const_iter  < rng_t, boost::indirect_iterator< brdm::list_iterator<rng_t const, ATL::CHeapPtr<val_t> const> > >::value ));
232 
233     rng_t rng;
234     BOOST_CHECK( ::test_init_auto_ptr_list(rng, sample) );
235     BOOST_CHECK( brdm::test_bidirectional(rng) );
236     BOOST_CHECK( brdm::test_emptiness(rng) );
237 }
238 
239 
240 template< class I, class Range >
test_CInterfaceList(const Range & sample)241 void test_CInterfaceList(const Range& sample)
242 {
243     typedef typename boost::range_value<Range>::type val_t;
244 
245     typedef ATL::CInterfaceList<I> rng_t;
246     BOOST_STATIC_ASSERT(( brdm::test_mutable_iter< rng_t, brdm::list_iterator<rng_t,       ATL::CComQIPtr<I> > >::value ));
247     BOOST_STATIC_ASSERT(( brdm::test_const_iter  < rng_t, brdm::list_iterator<rng_t const, ATL::CComQIPtr<I> const> >::value ));
248 
249     rng_t rng;
250     BOOST_CHECK( brdm::test_init_list(rng, sample) );
251     BOOST_CHECK( brdm::test_bidirectional(rng) );
252     BOOST_CHECK( brdm::test_emptiness(rng) );
253 }
254 
255 
256 // strings
257 //
258 
259 template< class Range >
test_CSimpleStringT(const Range & sample)260 void test_CSimpleStringT(const Range& sample)
261 {
262     typedef typename boost::range_value<Range>::type val_t;
263 
264     typedef typename boost::mpl::if_< boost::is_same<val_t, char>,
265         ATL::CAtlStringA,
266         ATL::CAtlStringW
267     >::type derived_t;
268 
269     typedef ATL::CSimpleStringT<val_t> rng_t;
270     BOOST_STATIC_ASSERT(( brdm::test_mutable_iter<rng_t, typename rng_t::PXSTR>::value ));
271     BOOST_STATIC_ASSERT(( brdm::test_const_iter  <rng_t, typename rng_t::PCXSTR>::value ));
272 
273     derived_t drng;
274     rng_t& rng = drng;
275     BOOST_CHECK( brdm::test_init_string(rng, sample) );
276     BOOST_CHECK( brdm::test_random_access(rng) );
277     // BOOST_CHECK( brdm::test_emptiness(rng) ); no default constructible
278 }
279 
280 
281 template< int n, class Range >
test_CFixedStringT(const Range & sample)282 void test_CFixedStringT(const Range& sample)
283 {
284     typedef typename boost::range_value<Range>::type val_t;
285 
286     typedef typename boost::mpl::if_< boost::is_same<val_t, char>,
287         ATL::CAtlStringA,
288         ATL::CAtlStringW
289     >::type base_t;
290 
291     typedef ATL::CFixedStringT<base_t, n> rng_t;
292     BOOST_STATIC_ASSERT(( brdm::test_mutable_iter<rng_t, typename rng_t::PXSTR>::value ));
293     BOOST_STATIC_ASSERT(( brdm::test_const_iter  <rng_t, typename rng_t::PCXSTR>::value ));
294 
295     rng_t rng;
296     BOOST_CHECK( brdm::test_init_string(rng, sample) );
297     BOOST_CHECK( brdm::test_random_access(rng) );
298     BOOST_CHECK( brdm::test_emptiness(rng) );
299 }
300 
301 
302 template< class Range >
test_CStringT(const Range & sample)303 void test_CStringT(const Range& sample)
304 {
305     typedef typename boost::range_value<Range>::type val_t;
306 
307     typedef typename boost::mpl::if_< boost::is_same<val_t, char>,
308         ATL::CAtlStringA, // == CStringT<char, X>
309         ATL::CAtlStringW  // == CStringT<wchar_t, X>
310     >::type rng_t;
311 
312     BOOST_STATIC_ASSERT(( brdm::test_mutable_iter<rng_t, typename rng_t::PXSTR>::value ));
313     BOOST_STATIC_ASSERT(( brdm::test_const_iter  <rng_t, typename rng_t::PCXSTR>::value ));
314 
315     rng_t rng;
316     BOOST_CHECK( brdm::test_init_string(rng, sample) );
317     BOOST_CHECK( brdm::test_random_access(rng) );
318     BOOST_CHECK( brdm::test_emptiness(rng) );
319 }
320 
321 
322 template< class Range >
test_CStaticString(const Range & sample)323 void test_CStaticString(const Range& sample)
324 {
325 #if !defined(BOOST_RANGE_ATL_NO_TEST_UNDOCUMENTED_RANGE)
326     {
327         typedef ATL::CStaticString<char, 20> rng_t;
328         BOOST_STATIC_ASSERT(( brdm::test_mutable_iter<rng_t, char const *>::value ));
329         BOOST_STATIC_ASSERT(( brdm::test_const_iter  <rng_t, char const *>::value ));
330 
331         rng_t rng("hello static string");
332         BOOST_CHECK( *(boost::begin(rng)+4) == 'o' );
333         BOOST_CHECK( *(boost::end(rng)-3) == 'i' );
334     }
335 
336     {
337         typedef ATL::CStaticString<wchar_t, 40> rng_t;
338         BOOST_STATIC_ASSERT(( brdm::test_mutable_iter<rng_t, wchar_t const *>::value ));
339         BOOST_STATIC_ASSERT(( brdm::test_const_iter  <rng_t, wchar_t const *>::value ));
340 
341         rng_t rng(L"hello static string");
342         BOOST_CHECK( *(boost::begin(rng)+4) == L'o' );
343         BOOST_CHECK( *(boost::end(rng)-3) == L'i' );
344     }
345 #endif
346 
347     (void)sample; // unused
348 }
349 
350 
351 #endif // !(_ATL_VER < 0x0700)
352 
353 
354 template< class Range >
test_CComBSTR(const Range & sample)355 void test_CComBSTR(const Range& sample)
356 {
357     typedef ATL::CComBSTR rng_t;
358     BOOST_STATIC_ASSERT(( brdm::test_mutable_iter<rng_t, OLECHAR *>::value ));
359     BOOST_STATIC_ASSERT(( brdm::test_const_iter  <rng_t, OLECHAR const*>::value ));
360 
361     rng_t rng(OLESTR("hello CComBSTR range!"));
362     BOOST_CHECK( brdm::test_equals(rng, std::string("hello CComBSTR range!")) );
363     BOOST_CHECK( brdm::test_random_access(rng) );
364     BOOST_CHECK( brdm::test_emptiness(rng) );
365 
366     (void)sample; // unused
367 }
368 
369 
370 // simples
371 //
372 
373 template< class Range >
test_CSimpleArray(const Range & sample)374 void test_CSimpleArray(const Range& sample)
375 {
376     typedef typename boost::range_value<Range>::type val_t;
377 
378     typedef ATL::CSimpleArray<val_t> rng_t;
379     BOOST_STATIC_ASSERT(( brdm::test_mutable_iter<rng_t, val_t *>::value ));
380     BOOST_STATIC_ASSERT(( brdm::test_const_iter  <rng_t, val_t const*>::value ));
381 
382     rng_t rng;
383     BOOST_CHECK( brdm::test_init_array(rng, sample) );
384     BOOST_CHECK( brdm::test_random_access(rng) );
385     BOOST_CHECK( brdm::test_emptiness(rng) );
386 }
387 
388 
389 template< class Range >
test_CSimpleMap(const Range & sample)390 void test_CSimpleMap(const Range& sample)
391 {
392 #if !defined(BOOST_RANGE_ATL_NO_TEST_UNDOCUMENTED_RANGE)
393 
394     typedef ATL::CSimpleMap<int, double> rng_t;
395 
396     rng_t rng;
397     rng.Add(3, 3.0);
398     rng.Add(4, 2.0);
399 
400     BOOST_CHECK( boost::begin(rng)->get<0>() == 3.0 );
401     BOOST_CHECK( (boost::end(rng)-1)->get<1>() == 2.0 );
402 
403 #endif
404 
405     (void)sample; // unused
406 }
407 
408 
409 template< class Range >
test_CSimpleValArray(const Range & sample)410 void test_CSimpleValArray(const Range& sample)
411 {
412     typedef typename boost::range_value<Range>::type val_t;
413 
414     typedef ATL::CSimpleArray<val_t> rng_t;
415     BOOST_STATIC_ASSERT(( brdm::test_mutable_iter<rng_t, val_t *>::value ));
416     BOOST_STATIC_ASSERT(( brdm::test_const_iter  <rng_t, val_t const*>::value ));
417 
418     rng_t rng;
419     BOOST_CHECK( brdm::test_init_array(rng, sample) );
420     BOOST_CHECK( brdm::test_random_access(rng) );
421     BOOST_CHECK( brdm::test_emptiness(rng) );
422 }
423 
424 
425 // maps
426 //
427 
428 template< class MapT >
test_CAtlMap(const MapT & sample)429 void test_CAtlMap(const MapT& sample)
430 {
431     typedef typename MapT::key_type k_t;
432     typedef typename MapT::mapped_type m_t;
433 
434     typedef ATL::CAtlMap<k_t, m_t> rng_t;
435 
436     rng_t rng;
437     boost::function_requires< boost::ForwardRangeConcept<rng_t> >();
438     BOOST_CHECK( brdm::test_init_map(rng, sample) );
439     BOOST_CHECK( ::test_atl_map(rng, sample) );
440 }
441 
442 
443 template< class MapT >
test_CRBTree(const MapT & sample)444 void test_CRBTree(const MapT& sample)
445 {
446     typedef typename MapT::key_type k_t;
447     typedef typename MapT::mapped_type m_t;
448 
449     typedef ATL::CRBMap<k_t, m_t> derived_t;
450     typedef ATL::CRBTree<k_t, m_t> rng_t;
451 
452     derived_t drng;
453     rng_t& rng = drng;
454 
455     boost::function_requires< boost::BidirectionalRangeConcept<rng_t> >();
456     BOOST_CHECK( brdm::test_init_map(drng, sample) );
457     BOOST_CHECK( ::test_atl_map(rng, sample) );
458 }
459 
460 
461 template< class MapT >
test_CRBMap(const MapT & sample)462 void test_CRBMap(const MapT& sample)
463 {
464     typedef typename MapT::key_type k_t;
465     typedef typename MapT::mapped_type m_t;
466 
467     typedef ATL::CRBMap<k_t, m_t> rng_t;
468 
469     rng_t rng;
470     boost::function_requires< boost::BidirectionalRangeConcept<rng_t> >();
471     BOOST_CHECK( brdm::test_init_map(rng, sample) );
472     BOOST_CHECK( ::test_atl_map(rng, sample) );
473 }
474 
475 
476 template< class MapT >
test_CRBMultiMap(const MapT & sample)477 void test_CRBMultiMap(const MapT& sample)
478 {
479     typedef typename MapT::key_type k_t;
480     typedef typename MapT::mapped_type m_t;
481 
482     typedef ATL::CRBMultiMap<k_t, m_t> rng_t;
483 
484     rng_t rng;
485     boost::function_requires< boost::BidirectionalRangeConcept<rng_t> >();
486     BOOST_CHECK( ::test_init_atl_multimap(rng, sample) );
487     BOOST_CHECK( ::test_atl_map(rng, sample) );
488 }
489 
490 
491 // main test
492 //
493 
test_atl()494 void test_atl()
495 {
496 
497     // ordinary ranges
498     //
499     {
500         std::string sample("rebecca judy and mary whiteberry chat monchy");
501 #if !(_ATL_VER < 0x0700)
502         ::test_CAtlArray(sample);
503         ::test_CAtlList(sample);
504         ::test_CSimpleStringT(sample);
505         ::test_CFixedStringT<44>(sample);
506         ::test_CStringT(sample);
507         ::test_CStaticString(sample);
508 #endif
509         ::test_CComBSTR(sample);
510         ::test_CSimpleArray(sample);
511         ::test_CSimpleMap(sample);
512         ::test_CSimpleValArray(sample);
513     }
514 
515 
516     {
517         std::wstring sample(L"rebecca judy and mary whiteberry chat monchy");
518 #if !(_ATL_VER < 0x0700)
519         ::test_CAtlArray(sample);
520         ::test_CAtlList(sample);
521         ::test_CSimpleStringT(sample);
522         ::test_CFixedStringT<44>(sample);
523         ::test_CStringT(sample);
524         ::test_CStaticString(sample);
525 #endif
526         ::test_CComBSTR(sample);
527         ::test_CSimpleArray(sample);
528         ::test_CSimpleMap(sample);
529         ::test_CSimpleValArray(sample);
530     }
531 
532     // pointer ranges
533     //
534 #if !(_ATL_VER < 0x0700)
535     {
536         typedef ATL::CAutoPtr<int> ptr_t;
537         ptr_t
538             ptr0(new int(3)), ptr1(new int(4)), ptr2(new int(5)), ptr3(new int(4)),
539             ptr4(new int(1)), ptr5(new int(2)), ptr6(new int(4)), ptr7(new int(0));
540 
541         ptr_t ptrs[8] = {
542             ptr0, ptr1, ptr2, ptr3, ptr4, ptr5, ptr6, ptr7
543         };
544 
545         boost::iterator_range< ptr_t * > workaround(ptrs, ptrs+8);
546         ::test_CAutoPtrArray<int>(workaround);
547     }
548 
549     {
550         typedef ATL::CAutoPtr<int> ptr_t;
551         ptr_t
552             ptr0(new int(3)), ptr1(new int(4)), ptr2(new int(5)), ptr3(new int(4)),
553             ptr4(new int(1)), ptr5(new int(2)), ptr6(new int(4)), ptr7(new int(0));
554 
555         ptr_t ptrs[8] = {
556             ptr0, ptr1, ptr2, ptr3, ptr4, ptr5, ptr6, ptr7
557         };
558 
559         boost::iterator_range< ptr_t * > workaround(ptrs, ptrs+8);
560         ::test_CAutoPtrList<int>(workaround);
561     }
562 
563     {
564         typedef ATL::CHeapPtr<int> ptr_t;
565         ptr_t ptrs[5]; {
566             ptrs[0].AllocateBytes(sizeof(int));
567             ptrs[1].AllocateBytes(sizeof(int));
568             ptrs[2].AllocateBytes(sizeof(int));
569             ptrs[3].AllocateBytes(sizeof(int));
570             ptrs[4].AllocateBytes(sizeof(int));
571         }
572 
573         boost::iterator_range< ptr_t * > workaround(ptrs, ptrs+5);
574         ::test_CHeapPtrList<int>(workaround);
575     }
576 
577 
578     {
579         typedef ATL::CComQIPtr<IDispatch> ptr_t;
580         ptr_t ptrs[8];
581 
582         boost::iterator_range< ptr_t * > workaround(ptrs, ptrs+8);
583         ::test_CInterfaceArray<IDispatch>(workaround);
584         ::test_CInterfaceList<IDispatch>(workaround);
585     }
586 #endif
587 
588     // maps
589     //
590     {
591 #if !(_ATL_VER < 0x0700)
592         std::map<int, std::string> sample; {
593             sample[0] = "hello";
594             sample[1] = "range";
595             sample[2] = "atl";
596             sample[3] = "mfc";
597             sample[4] = "collections";
598         }
599 
600         ::test_CAtlMap(sample);
601         ::test_CRBTree(sample);
602         ::test_CRBMap(sample);
603         ::test_CRBMultiMap(sample);
604 #endif
605     }
606 
607 
608 } // test_atl
609 
610 
611 #include <boost/test/unit_test.hpp>
612 using boost::unit_test::test_suite;
613 
614 
615 test_suite *
init_unit_test_suite(int argc,char * argv[])616 init_unit_test_suite(int argc, char* argv[])
617 {
618     test_suite *test = BOOST_TEST_SUITE("ATL Range Test Suite");
619     test->add(BOOST_TEST_CASE(&test_atl));
620 
621     (void)argc, (void)argv; // unused
622     return test;
623 }
624