remove \r
[extl.git] / extl / utility / unit_test / address_of_test.h
blob371b3c6d9cccc6f0083519d131cf6f43053f223c
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: address_of_test.h
4 * Created: 08.04.01
5 * Updated: 08.05.05
7 * Brief: Unit-testing
9 * [<Home>]
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
12 #ifndef EXTL_UTILITY_ADDRESS_OF_TEST_H
13 #define EXTL_UTILITY_ADDRESS_OF_TEST_H
15 #ifndef EXTL_UTILITY_ADDRESS_OF_H
16 # error This file must be included of address_of.h
17 #endif
19 /* ///////////////////////////////////////////////////////////////////////
20 * ::extl::detail namespace
22 EXTL_TEST_BEGIN_NAMESPACE
24 /* ///////////////////////////////////////////////////////////////////////
25 * Unit-testing
27 struct address_of_test
29 struct s
31 s():a(10){}
32 int operator&(){return a;}
33 int a;
35 address_of_test()
37 s sa;
38 int aa = 5;
39 int array[10];
40 array[0] = 1;
41 EXTL_ASSERT(EXTL_ADDRESS_OF(sa)->a == 10);
42 EXTL_ASSERT(*EXTL_ADDRESS_OF(aa) == 5);
43 EXTL_ASSERT(*EXTL_ADDRESS_OF(array)[0] == 1);
48 address_of_test g_address_of_test;
49 /* ///////////////////////////////////////////////////////////////////////
50 * ::extl::detail namespace
52 EXTL_TEST_END_NAMESPACE
54 /* //////////////////////////////////////////////////////////////////// */
55 #endif /* EXTL_UTILITY_ADDRESS_OF_TEST_H */
56 /* //////////////////////////////////////////////////////////////////// */