31
|
1 |
//
|
|
2 |
// lw_mutex_test.cpp
|
|
3 |
//
|
|
4 |
// Copyright 2005 Peter Dimov
|
|
5 |
//
|
|
6 |
// Distributed under the Boost Software License, Version 1.0. (See
|
|
7 |
// accompanying file LICENSE_1_0.txt or copy at
|
|
8 |
// http://www.boost.org/LICENSE_1_0.txt)
|
|
9 |
//
|
|
10 |
/*
|
|
11 |
* © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
|
|
12 |
*/
|
|
13 |
|
|
14 |
#include <boost/detail/lightweight_mutex.hpp>
|
|
15 |
|
|
16 |
#ifdef __SYMBIAN32__
|
|
17 |
#include "std_log_result.h"
|
|
18 |
#define LOG_FILENAME_LINE __FILE__, __LINE__
|
|
19 |
#endif
|
|
20 |
|
|
21 |
// Sanity check only
|
|
22 |
|
|
23 |
boost::detail::lightweight_mutex m1;
|
|
24 |
|
|
25 |
int main()
|
|
26 |
{
|
|
27 |
std_log(LOG_FILENAME_LINE,"[Test Case for lw_mutex_test]");
|
|
28 |
|
|
29 |
#ifdef __ARMCC__
|
|
30 |
#pragma diag_suppress 177
|
|
31 |
#endif
|
|
32 |
boost::detail::lightweight_mutex::scoped_lock lock1( m1 );
|
|
33 |
|
|
34 |
boost::detail::lightweight_mutex m2;
|
|
35 |
boost::detail::lightweight_mutex m3;
|
|
36 |
|
|
37 |
boost::detail::lightweight_mutex::scoped_lock lock2( m2 );
|
|
38 |
boost::detail::lightweight_mutex::scoped_lock lock3( m3 );
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
#ifdef __SYMBIAN32__
|
|
43 |
std_log(LOG_FILENAME_LINE,"Result : Passed");
|
|
44 |
|
|
45 |
std_log(LOG_FILENAME_LINE,"[End Test Case ]");
|
|
46 |
#endif
|
|
47 |
testResultXml("lw_mutex_test");
|
|
48 |
close_log_file();
|
|
49 |
return 0;
|
|
50 |
}
|