remove \r
[extl.git] / extl / smartptr / unit_test / scoped_array_test.h
blobeecb25c558dad989a44f5a12535deddae0fae4c8
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: scoped_array_test.h
4 * Created: 08.02.25
5 * Updated: 08.05.05
7 * Brief: Unit-testing
9 * [<Home>]
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
12 #ifndef EXTL_SMART_PTR_SCOPED_ARRAY_TEST_H
13 #define EXTL_SMART_PTR_SCOPED_ARRAY_TEST_H
15 #ifndef EXTL_SMART_PTR_SCOPED_ARRAY_H
16 # error This file must be included of scoped_array.h
17 #endif
19 /* ///////////////////////////////////////////////////////////////////////
20 * ::unit_test namespace
22 EXTL_TEST_BEGIN_NAMESPACE
23 /* ///////////////////////////////////////////////////////////////////////
24 * Unit-testing
26 struct scoped_array_test
28 struct int_array_deleter
30 void operator()(int *p)
32 /*EXTL_ASSERT(0);*/
33 delete[] p;
37 #ifdef EXTL_TEMPLATE_CLASS_DEFAULT_ARGUMENT_SUPPORT
38 typedef scoped_array<int> scoped_int_array;
39 #else
40 typedef scoped_array<int, new_allocator<int>::array_deleter_type > scoped_int_array;
41 #endif
42 typedef scoped_array<int, int_array_deleter> scoped_arrayArray;
44 scoped_array_test()
46 scoped_int_array p1(new int[10]);
47 p1[0] = 10;
49 EXTL_ASSERT(p1);
50 EXTL_ASSERT(p1 != NULL);
51 EXTL_ASSERT(p1[0] == 10);
54 scoped_arrayArray p_array(new int[10]);
58 scoped_array_test g_scoped_array_test;
59 /* ///////////////////////////////////////////////////////////////////////
60 * ::unit_test namespace
62 EXTL_TEST_END_NAMESPACE
64 /* //////////////////////////////////////////////////////////////////// */
65 #endif /* EXTL_SMART_PTR_SCOPED_ARRAY_TEST_H */
66 /* //////////////////////////////////////////////////////////////////// */