]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/classic/test/scoped_lock_tests.cpp
1 /*=============================================================================
2 Copyright (C) 2003 Martin Wille
3 http://spirit.sourceforge.net/
5 Use, modification and distribution is subject to the Boost Software
6 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
8 =============================================================================*/
10 // Nota bene: the actual locking is _not_ tested here!
13 #include <boost/config.hpp>
17 std::cout
<< "/////////////////////////////////////////////////////////\n";
19 std::cout
<< " scoped_lock test\n";
21 std::cout
<< "/////////////////////////////////////////////////////////\n";
25 #if defined(DONT_HAVE_BOOST) || !defined(BOOST_HAS_THREADS) || defined(BOOST_DISABLE_THREADS)
26 // if boost libraries are not available we have to skip the tests
31 std::cout
<< "Test skipped (Boost libraries not available)\n";
36 #include <boost/thread/mutex.hpp>
37 #include <boost/spirit/include/classic_core.hpp>
38 #include <boost/spirit/include/classic_scoped_lock.hpp>
39 #include <boost/core/lightweight_test.hpp>
46 using BOOST_SPIRIT_CLASSIC_NS::rule
;
47 using BOOST_SPIRIT_CLASSIC_NS::scoped_lock_d
;
48 using BOOST_SPIRIT_CLASSIC_NS::parse_info
;
49 using BOOST_SPIRIT_CLASSIC_NS::parse
;
53 rule
<> r
= scoped_lock_d(m
)['x'];
54 parse_info
<> pi
= parse("x", r
);
58 return boost::report_errors();
61 #endif // defined(DONT_HAVE_BOOST)