1 /* ///////////////////////////////////////////////////////////////////////
2 * File: basic_pool_allocator_test.h
7 * Brief: basic_pool_allocator class unit testing
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
20 /* ///////////////////////////////////////////////////////////////////////
21 * ::unit_test namespace
23 EXTL_TEST_BEGIN_NAMESPACE
25 /* ///////////////////////////////////////////////////////////////////////
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
;
35 typedef basic_pool_allocator
< int
36 , synch_traits_selector::synch_traits_type
37 , default_basic_pool_allocator_tag
40 allocator_type allocator
;
42 int *p
= allocator
.allocate(1);
43 EXTL_ASSERT(p
!= NULL
);
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 /* //////////////////////////////////////////////////////////////////// */