|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65389 - in sandbox/lockable_traits/libs/sync: . test
From: vicente.botet_at_[hidden]
Date: 2010-09-11 19:04:36
Author: viboes
Date: 2010-09-11 19:04:34 EDT (Sat, 11 Sep 2010)
New Revision: 65389
URL: http://svn.boost.org/trac/boost/changeset/65389
Log:
Added first version
Added:
sandbox/lockable_traits/libs/sync/
- copied from r65331, /sandbox/lockable_traits/libs/lockable/
sandbox/lockable_traits/libs/sync/test/Jamfile.v2 (contents, props changed)
sandbox/lockable_traits/libs/sync/test/lockable_concepts_test.cpp (contents, props changed)
sandbox/lockable_traits/libs/sync/test/lockable_traits_test.cpp (contents, props changed)
Added: sandbox/lockable_traits/libs/sync/test/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/lockable_traits/libs/sync/test/Jamfile.v2 2010-09-11 19:04:34 EDT (Sat, 11 Sep 2010)
@@ -0,0 +1,48 @@
+# Boost Sync Library test Jamfile
+
+# Copyright Beman Dawes 2003, 2006, 2008
+
+# Distributed under the Boost Software License, Version 1.0.
+# See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt
+
+# See library home page at http://www.boost.org/libs/chrono
+
+# uncomment one if the above lines if you build outside the Boost release
+#local BOOST_ROOT = /boost_1_41_0 ;
+#local BOOST_ROOT = c:/cygwin/boost_1_41_0 ;
+
+if ! $(BOOST_ROOT)
+{
+ BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
+}
+
+project
+ : requirements
+ <os>LINUX:<threading>multi
+
+ # uncomment the line above if you build outside the Boost release
+ #<include>$(BOOST_ROOT)
+ # uncomment the line above if you build outside the Boost release
+ #<include>../../..
+
+ <toolset>msvc:<asynch-exceptions>on
+ <define>BOOST_ENABLE_WARNINGS
+ <warnings>all
+ <toolset>gcc:<cxxflags>-Wextra
+ <toolset>gcc:<cxxflags>-Wno-long-long
+ <toolset>gcc-mingw-4.5.0:<cxxflags>-Wno-missing-field-initializers
+ <toolset>gcc-mingw-4.5.0:<cxxflags>-fdiagnostics-show-option
+ <toolset>msvc:<cxxflags>/wd4127
+ ;
+
+
+
+
+test-suite "lockable_traits" :
+ [ compile lockable_traits_test.cpp ]
+ ;
+
+test-suite "lockable_concepts" :
+ [ compile lockable_concepts_test.cpp ]
+ ;
+
Added: sandbox/lockable_traits/libs/sync/test/lockable_concepts_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/lockable_traits/libs/sync/test/lockable_concepts_test.cpp 2010-09-11 19:04:34 EDT (Sat, 11 Sep 2010)
@@ -0,0 +1,109 @@
+/* Copyright 2008-2009 Vicente J. Botet Escriba
+ * Distributed under the Boost Software License, Version 1.0.
+ * (See accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * See http://www.boost.org/libs/luid for library home page.
+ */
+
+#include <boost/sync/lockable_traits.hpp>
+#include <boost/sync/lockable_concepts.hpp>
+//~ #include <boost/sync/lockable_adapter.hpp>
+//~ #include <boost/sync/poly/lock_adapter.hpp>
+
+#if 0
+#include <boost/sync/null_mutex.hpp>
+#include <boost/sync/null_condition.hpp>
+
+#include <boost/sync/thread/mutex.hpp>
+#include <boost/sync/thread/recursive_mutex.hpp>
+#include <boost/sync/thread/shared_mutex.hpp>
+
+#include <boost/sync/process/mutex.hpp>
+#include <boost/sync/process/recursive_mutex.hpp>
+#include <boost/sync/process/upgradable_mutex.hpp>
+#include <boost/sync/process/named_mutex.hpp>
+#include <boost/sync/process/named_recursive_mutex.hpp>
+#include <boost/sync/process/named_upgradable_mutex.hpp>
+#else
+#include <boost/sync/null/null_mutex.hpp>
+#include <boost/sync/null/null_condition.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/recursive_mutex.hpp>
+#include <boost/thread/shared_mutex.hpp>
+#include <boost/interprocess/sync/interprocess_mutex.hpp>
+#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
+#include <boost/interprocess/sync/interprocess_upgradable_mutex.hpp>
+#include <boost/interprocess/sync/named_mutex.hpp>
+#include <boost/interprocess/sync/named_recursive_mutex.hpp>
+#include <boost/interprocess/sync/named_upgradable_mutex.hpp>
+#endif
+#include <boost/type_traits/is_same.hpp>
+#include <boost/static_assert.hpp>
+
+#define BOOST_TEST_MODULE sync_lockable_concepts_test
+
+using namespace boost;
+using namespace boost::sync;
+using namespace boost::interprocess;
+
+BOOST_CONCEPT_ASSERT((BasicLockableConcept<sync::null_mutex>));
+BOOST_CONCEPT_ASSERT((TryLockableConcept<sync::null_mutex>));
+BOOST_CONCEPT_ASSERT((TimedLockableConcept<sync::null_mutex>));
+BOOST_CONCEPT_ASSERT((ShareLockableConcept<sync::null_mutex>));
+BOOST_CONCEPT_ASSERT((UpgradeLockableConcept<sync::null_mutex>));
+
+//~ BOOST_CONCEPT_ASSERT((TryLockableConcept<exclusive_lockable_adapter<null_mutex> >));
+//~ BOOST_CONCEPT_ASSERT((TimedLockableConcept<timed_lockable_adapter<null_mutex> >));
+//~ BOOST_CONCEPT_ASSERT((ShareLockableConcept<shared_lockable_adapter<null_mutex> >));
+//~ BOOST_CONCEPT_ASSERT((UpgradeLockableConcept<upgrade_lockable_adapter<null_mutex> >));
+
+//~ BOOST_CONCEPT_ASSERT((TryLockableConcept<poly::exclusive_lock_adapter<null_mutex> >));
+//~ BOOST_CONCEPT_ASSERT((TimedLockableConcept<poly::timed_lock_adapter<null_mutex> >));
+//~ BOOST_CONCEPT_ASSERT((ShareLockableConcept<poly::sharable_lock_adapter<null_mutex> >));
+//~ BOOST_CONCEPT_ASSERT((UpgradeLockableConcept<poly::upgradable_lock_adapter<null_mutex> >));
+
+BOOST_CONCEPT_ASSERT((BasicLockableConcept<boost::mutex>));
+BOOST_CONCEPT_ASSERT((TryLockableConcept<boost::mutex>));
+
+BOOST_CONCEPT_ASSERT((BasicLockableConcept<boost::timed_mutex>));
+BOOST_CONCEPT_ASSERT((TryLockableConcept<boost::timed_mutex>));
+BOOST_CONCEPT_ASSERT((TimedLockableConcept<boost::timed_mutex>));
+
+BOOST_CONCEPT_ASSERT((BasicLockableConcept<boost::recursive_mutex>));
+BOOST_CONCEPT_ASSERT((TryLockableConcept<boost::recursive_mutex>));
+
+BOOST_CONCEPT_ASSERT((BasicLockableConcept<boost::recursive_timed_mutex>));
+BOOST_CONCEPT_ASSERT((TryLockableConcept<boost::recursive_timed_mutex>));
+BOOST_CONCEPT_ASSERT((TimedLockableConcept<boost::recursive_timed_mutex>));
+
+BOOST_CONCEPT_ASSERT((BasicLockableConcept<boost::shared_mutex>));
+BOOST_CONCEPT_ASSERT((TryLockableConcept<boost::shared_mutex>));
+BOOST_CONCEPT_ASSERT((TimedLockableConcept<boost::shared_mutex>));
+BOOST_CONCEPT_ASSERT((ShareLockableConcept<boost::shared_mutex>));
+BOOST_CONCEPT_ASSERT((UpgradeLockableConcept<boost::shared_mutex>));
+
+BOOST_CONCEPT_ASSERT((BasicLockableConcept<interprocess_mutex>));
+BOOST_CONCEPT_ASSERT((TryLockableConcept<interprocess_mutex>));
+BOOST_CONCEPT_ASSERT((TimedLockableConcept<interprocess_mutex>));
+
+BOOST_CONCEPT_ASSERT((BasicLockableConcept<interprocess_recursive_mutex>));
+BOOST_CONCEPT_ASSERT((TryLockableConcept<interprocess_recursive_mutex>));
+BOOST_CONCEPT_ASSERT((TimedLockableConcept<interprocess_recursive_mutex>));
+
+BOOST_CONCEPT_ASSERT((BasicLockableConcept<named_mutex>));
+BOOST_CONCEPT_ASSERT((TryLockableConcept<named_mutex>));
+BOOST_CONCEPT_ASSERT((TimedLockableConcept<named_mutex>));
+
+#if 0
+BOOST_CONCEPT_ASSERT((TryLockableConcept<interprocess_upgradable_mutex>));
+BOOST_CONCEPT_ASSERT((TimedLockableConcept<interprocess_upgradable_mutex>));
+BOOST_CONCEPT_ASSERT((ShareLockableConcept<interprocess_upgradable_mutex>));
+BOOST_CONCEPT_ASSERT((UpgradeLockableConcept<interprocess_upgradable_mutex>));
+
+BOOST_CONCEPT_ASSERT((TryLockableConcept<interprocess_named_upgradable_mutex>));
+BOOST_CONCEPT_ASSERT((TimedLockableConcept<interprocess_named_upgradable_mutex>));
+BOOST_CONCEPT_ASSERT((ShareLockableConcept<interprocess_named_upgradable_mutex>));
+BOOST_CONCEPT_ASSERT((UpgradeLockableConcept<boost::interprocess_named_upgradable_mutex>));
+
+#endif
Added: sandbox/lockable_traits/libs/sync/test/lockable_traits_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/lockable_traits/libs/sync/test/lockable_traits_test.cpp 2010-09-11 19:04:34 EDT (Sat, 11 Sep 2010)
@@ -0,0 +1,153 @@
+/* Copyright 2008-2009 Vicente J. Botet Escriba
+ * Distributed under the Boost Software License, Version 1.0.
+ * (See accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * See http://www.boost.org/libs/luid for library home page.
+ */
+
+
+
+
+#include <boost/sync/lockable_traits.hpp>
+#if 0
+#include <boost/sync/null_mutex.hpp>
+#include <boost/sync/null_condition.hpp>
+
+#include <boost/sync/thread/mutex.hpp>
+#include <boost/sync/thread/recursive_mutex.hpp>
+#include <boost/sync/thread/shared_mutex.hpp>
+
+#include <boost/sync/process/mutex.hpp>
+#include <boost/sync/process/recursive_mutex.hpp>
+#include <boost/sync/process/upgradable_mutex.hpp>
+#include <boost/sync/process/named_mutex.hpp>
+#include <boost/sync/process/named_recursive_mutex.hpp>
+#include <boost/sync/process/named_upgradable_mutex.hpp>
+#else
+#include <boost/sync/null/null_mutex.hpp>
+#include <boost/sync/null/null_condition.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/recursive_mutex.hpp>
+#include <boost/thread/shared_mutex.hpp>
+#include <boost/interprocess/sync/interprocess_mutex.hpp>
+#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
+#include <boost/interprocess/sync/interprocess_upgradable_mutex.hpp>
+#include <boost/interprocess/sync/named_mutex.hpp>
+#include <boost/interprocess/sync/named_recursive_mutex.hpp>
+#include <boost/interprocess/sync/named_upgradable_mutex.hpp>
+#endif
+#include <boost/type_traits/is_same.hpp>
+#include <boost/static_assert.hpp>
+
+#define BOOST_TEST_MODULE sync_lock_traits_test
+
+using namespace boost;
+using namespace boost::sync;
+using namespace boost::interprocess;
+
+
+BOOST_STATIC_ASSERT((is_same<best_condition<sync::null_mutex>::type, null_condition>::value));
+BOOST_STATIC_ASSERT((is_same<scope<sync::null_mutex>::type, mono_threaded_tag>::value));
+BOOST_STATIC_ASSERT((is_same<category<sync::null_mutex>::type, upgradable_lock_tag>::value));
+BOOST_STATIC_ASSERT((is_same<reentrancy<sync::null_mutex>::type, recursive_tag>::value));
+BOOST_STATIC_ASSERT((is_same<kind<sync::null_mutex>::type, timed_lockable_tag>::value));
+BOOST_STATIC_ASSERT((is_exclusive_lock<sync::null_mutex>::value));
+BOOST_STATIC_ASSERT((is_sharable_lock<sync::null_mutex>::value));
+BOOST_STATIC_ASSERT((is_upgradable_lock<sync::null_mutex>::value));
+BOOST_STATIC_ASSERT((is_mono_threaded<sync::null_mutex>::value));
+BOOST_STATIC_ASSERT((!is_multi_threaded<sync::null_mutex>::value));
+BOOST_STATIC_ASSERT((!is_multi_process<sync::null_mutex>::value));
+BOOST_STATIC_ASSERT((is_recursive_lock<sync::null_mutex>::value));
+BOOST_STATIC_ASSERT((is_timed_lockable<sync::null_mutex>::value));
+
+//~ BOOST_STATIC_ASSERT((is_same<best_condition<mutex>::type, boost::condition_variable>::value));
+BOOST_STATIC_ASSERT((is_same<scope<mutex>::type, multi_threaded_tag>::value));
+BOOST_STATIC_ASSERT((is_same<category<mutex>::type, exclusive_lock_tag>::value));
+BOOST_STATIC_ASSERT((!is_recursive_lock<mutex>::value));
+BOOST_STATIC_ASSERT((is_same<kind<mutex>::type, try_lockable_tag>::value));
+BOOST_STATIC_ASSERT((is_exclusive_lock<mutex>::value));
+BOOST_STATIC_ASSERT((!is_sharable_lock<mutex>::value));
+BOOST_STATIC_ASSERT((!is_upgradable_lock<mutex>::value));
+BOOST_STATIC_ASSERT((is_mono_threaded<mutex>::value));
+BOOST_STATIC_ASSERT((is_multi_threaded<mutex>::value));
+BOOST_STATIC_ASSERT((!is_multi_process<mutex>::value));
+BOOST_STATIC_ASSERT((!is_recursive_lock<mutex>::value));
+BOOST_STATIC_ASSERT((!is_timed_lockable<mutex>::value));
+
+
+BOOST_STATIC_ASSERT((is_same<scope<timed_mutex>::type, multi_threaded_tag>::value));
+BOOST_STATIC_ASSERT((is_same<category<timed_mutex>::type, exclusive_lock_tag>::value));
+BOOST_STATIC_ASSERT((is_same<reentrancy<timed_mutex>::type, non_recursive_tag>::value));
+BOOST_STATIC_ASSERT((is_same<kind<timed_mutex>::type, timed_lockable_tag>::value));
+BOOST_STATIC_ASSERT((is_exclusive_lock<timed_mutex>::value));
+BOOST_STATIC_ASSERT((!is_sharable_lock<timed_mutex>::value));
+BOOST_STATIC_ASSERT((!is_upgradable_lock<timed_mutex>::value));
+BOOST_STATIC_ASSERT((is_mono_threaded<timed_mutex>::value));
+BOOST_STATIC_ASSERT((is_multi_threaded<timed_mutex>::value));
+BOOST_STATIC_ASSERT((!is_multi_process<timed_mutex>::value));
+BOOST_STATIC_ASSERT((!is_recursive_lock<timed_mutex>::value));
+BOOST_STATIC_ASSERT((is_timed_lockable<timed_mutex>::value));
+
+BOOST_STATIC_ASSERT((is_same<scope<recursive_mutex>::type, multi_threaded_tag>::value));
+BOOST_STATIC_ASSERT((is_same<category<recursive_mutex>::type, exclusive_lock_tag>::value));
+BOOST_STATIC_ASSERT((is_same<reentrancy<recursive_mutex>::type, recursive_tag>::value));
+BOOST_STATIC_ASSERT((is_same<kind<recursive_mutex>::type, try_lockable_tag>::value));
+BOOST_STATIC_ASSERT((is_exclusive_lock<recursive_mutex>::value));
+BOOST_STATIC_ASSERT((!is_sharable_lock<recursive_mutex>::value));
+BOOST_STATIC_ASSERT((!is_upgradable_lock<recursive_mutex>::value));
+BOOST_STATIC_ASSERT((is_mono_threaded<recursive_mutex>::value));
+BOOST_STATIC_ASSERT((is_multi_threaded<recursive_mutex>::value));
+BOOST_STATIC_ASSERT((!is_multi_process<recursive_mutex>::value));
+BOOST_STATIC_ASSERT((is_recursive_lock<recursive_mutex>::value));
+BOOST_STATIC_ASSERT((!is_timed_lockable<recursive_mutex>::value));
+
+BOOST_STATIC_ASSERT((is_same<scope<recursive_timed_mutex>::type, multi_threaded_tag>::value));
+BOOST_STATIC_ASSERT((is_same<category<recursive_timed_mutex>::type, exclusive_lock_tag>::value));
+
+BOOST_STATIC_ASSERT((is_same<scope<shared_mutex>::type, multi_threaded_tag>::value));
+BOOST_STATIC_ASSERT((is_same<category<shared_mutex>::type, upgradable_lock_tag>::value));
+BOOST_STATIC_ASSERT((is_exclusive_lock<shared_mutex>::value));
+BOOST_STATIC_ASSERT((is_sharable_lock<shared_mutex>::value));
+BOOST_STATIC_ASSERT((is_upgradable_lock<shared_mutex>::value));
+BOOST_STATIC_ASSERT((is_mono_threaded<shared_mutex>::value));
+BOOST_STATIC_ASSERT((is_multi_threaded<shared_mutex>::value));
+BOOST_STATIC_ASSERT((!is_multi_process<shared_mutex>::value));
+
+BOOST_STATIC_ASSERT((is_same<scope<interprocess_mutex>::type, multi_process_tag>::value));
+BOOST_STATIC_ASSERT((is_same<category<interprocess_mutex>::type, exclusive_lock_tag>::value));
+BOOST_STATIC_ASSERT((is_exclusive_lock<interprocess_mutex>::value));
+BOOST_STATIC_ASSERT((!is_sharable_lock<interprocess_mutex>::value));
+BOOST_STATIC_ASSERT((!is_upgradable_lock<interprocess_mutex>::value));
+BOOST_STATIC_ASSERT((is_mono_threaded<interprocess_mutex>::value));
+BOOST_STATIC_ASSERT((is_multi_threaded<interprocess_mutex>::value));
+BOOST_STATIC_ASSERT((is_multi_process<interprocess_mutex>::value));
+
+BOOST_STATIC_ASSERT((is_same<scope<interprocess_recursive_mutex>::type, multi_process_tag>::value));
+BOOST_STATIC_ASSERT((is_same<category<interprocess_recursive_mutex>::type, exclusive_lock_tag>::value));
+
+BOOST_STATIC_ASSERT((is_same<scope<named_mutex>::type, multi_process_tag>::value));
+BOOST_STATIC_ASSERT((is_same<category<named_mutex>::type, exclusive_lock_tag>::value));
+
+
+BOOST_STATIC_ASSERT((is_same<scope<interprocess_upgradable_mutex>::type, multi_process_tag>::value));
+BOOST_STATIC_ASSERT((is_same<category<interprocess_upgradable_mutex>::type, upgradable_lock_tag>::value));
+
+BOOST_STATIC_ASSERT((is_same<scope<named_upgradable_mutex>::type, multi_process_tag>::value));
+BOOST_STATIC_ASSERT((is_same<category<named_upgradable_mutex>::type, upgradable_lock_tag>::value));
+
+
+#if 0
+BOOST_STATIC_ASSERT((is_same<scope<named_upgradable_mutex>::type, multi_process_tag>::value));
+BOOST_STATIC_ASSERT((is_same<category<named_upgradable_mutex>::type, upgradable_lock_tag>::value));
+BOOST_STATIC_ASSERT((is_same<scope<interprocess_upgradable_mutex>::type, multi_process_tag>::value));
+BOOST_STATIC_ASSERT((is_same<category<interprocess_upgradable_mutex>::type, upgradable_lock_tag>::value));
+#endif
+
+
+//____________________________________________________________________________//
+
+
+//____________________________________________________________________________//
+
+// EOF
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk