remove \r
[extl.git] / extl / synch / test / null_lock_test.h
blob1e110df4db7ce6a95460ee480cc8f2aa3a2ef1ab
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: null_lock_test.h
4 * Created: 08.03.20
5 * Updated: 09.01.12
7 * Brief: Unit testing
9 * [<Home>]
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
13 #ifndef EXTL_SYNCH_NULL_LOCK_TEST_H
14 #define EXTL_SYNCH_NULL_LOCK_TEST_H
16 /* ///////////////////////////////////////////////////////////////////////
17 * unit_test namespace
19 EXTL_BEGIN_NAMESPACE
20 EXTL_TEST_NAME_BEGIN_NAMESPACE(null_lock_test)
22 /* ///////////////////////////////////////////////////////////////////////
23 * Unit-testing
25 static int null_lock_test()
27 EXTL_TEST_TRACE(_T("/* //////////////////////////////////////////////////////////////////// */"));
28 EXTL_TEST_TRACE(_T("null_lock Test:\n"));
31 null_lock lock_test;
33 lock_test.lock();
34 EXTL_ASSERT(lock_test.is_locked());
35 lock_test.unlock();
38 EXTL_TRY
39 lock_test.lock();
40 lock_test.lock();
41 EXTL_CATCH (lock_error &e)
42 EXTL_TEST_TRACEA("Error Reason:%s",e.what());
43 EXTL_CATCH_END
45 return 0;
47 int null_lock_test_ret = null_lock_test();
49 /* ///////////////////////////////////////////////////////////////////////
50 * ::unit_test namespace
52 EXTL_TEST_NAME_END_NAMESPACE(null_lock_test)
53 EXTL_END_NAMESPACE
54 /* //////////////////////////////////////////////////////////////////// */
55 #endif /* EXTL_SYNCH_NULL_LOCK_TEST_H */
56 /* //////////////////////////////////////////////////////////////////// */