remove \r
[extl.git] / extl / memory / unit_test / basic_pool_allocator_test.h
blob49194be98bf1411c2dab9747c85d9ce6cbfe88bb
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: basic_pool_allocator_test.h
4 * Created: 08.04.28
5 * Updated: 08.04.28
7 * Brief: basic_pool_allocator class unit testing
9 * [<Home>]
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
13 #ifndef EXTL_MEMORY_BASIC_POOL_ALLOCATOR_TEST_H
14 #define EXTL_MEMORY_BASIC_POOL_ALLOCATOR_TEST_H
16 #ifndef EXTL_MEMORY_BASIC_POOL_ALLOCATOR_H
17 # error This file must be included of basic_pool_allocator.h
18 #endif
20 /* ///////////////////////////////////////////////////////////////////////
21 * ::unit_test namespace
23 EXTL_TEST_BEGIN_NAMESPACE
25 /* ///////////////////////////////////////////////////////////////////////
26 * Unit-testing
28 struct basic_pool_allocator_test
30 basic_pool_allocator_test()
32 #ifdef EXTL_TEMPLATE_CLASS_DEFAULT_ARGUMENT_SUPPORT
33 typedef basic_pool_allocator<int> allocator_type;
34 #else
35 typedef basic_pool_allocator< int
36 , synch_traits_selector::synch_traits_type
37 , default_basic_pool_allocator_tag
38 > allocator_type;
39 #endif
40 allocator_type allocator;
42 int *p = allocator.allocate(1);
43 EXTL_ASSERT(p != NULL);
45 *p = 10;
46 EXTL_ASSERT(*p == 10);
50 basic_pool_allocator_test g_basic_pool_allocator_test;
51 /* ///////////////////////////////////////////////////////////////////////
52 * ::unit_test namespace
54 EXTL_TEST_END_NAMESPACE
56 /* //////////////////////////////////////////////////////////////////// */
57 #endif /* EXTL_MEMORY_BASIC_POOL_ALLOCATOR_TEST_H */
58 /* //////////////////////////////////////////////////////////////////// */