OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-\r
-#include "test_intrusive_treiber_stack.h"\r
-\r
-#include <cds/gc/dhp.h>\r
-#include <cds/intrusive/treiber_stack.h>\r
-\r
-namespace {\r
-\r
- namespace ci = cds::intrusive;\r
-\r
- class IntrusiveTreiberStack_DHP : public cds_gtest::IntrusiveTreiberStack\r
- {\r
- typedef cds_gtest::IntrusiveTreiberStack base_class;\r
- protected:\r
- typedef cds::gc::DHP gc_type;\r
-\r
- void SetUp()\r
- {\r
+
+#include "test_intrusive_treiber_stack.h"
+
+#include <cds/gc/dhp.h>
+#include <cds/intrusive/treiber_stack.h>
+
+namespace {
+
+ namespace ci = cds::intrusive;
+
+ class IntrusiveTreiberStack_DHP : public cds_test::IntrusiveTreiberStack
+ {
+ typedef cds_test::IntrusiveTreiberStack base_class;
+ protected:
+ typedef cds::gc::DHP gc_type;
+
+ void SetUp()
+ {
typedef cds::intrusive::TreiberStack< gc_type,
base_hook_item<gc_type>
, typename ci::treiber_stack::make_traits<
>
>::type
> stack_type;
-\r
- cds::gc::dhp::GarbageCollector::Construct( 16, stack_type::c_nHazardPtrCount );\r
- cds::threading::Manager::attachThread();\r
- }\r
-\r
- void TearDown()\r
- {\r
- cds::threading::Manager::detachThread();\r
- cds::gc::dhp::GarbageCollector::Destruct();\r
- }\r
-\r
- template <typename Stack>\r
- void test()\r
- {\r
- Stack stack;\r
- base_class::test( stack );\r
- }\r
-\r
- template <typename Stack>\r
- void test_dyn( size_t elimination_size )\r
- {\r
- Stack stack( elimination_size );\r
- base_class::test( stack );\r
- }\r
- };\r
-\r
+
+ cds::gc::dhp::GarbageCollector::Construct( 16, stack_type::c_nHazardPtrCount );
+ cds::threading::Manager::attachThread();
+ }
+
+ void TearDown()
+ {
+ cds::threading::Manager::detachThread();
+ cds::gc::dhp::GarbageCollector::Destruct();
+ }
+
+ template <typename Stack>
+ void test()
+ {
+ Stack stack;
+ base_class::test( stack );
+ }
+
+ template <typename Stack>
+ void test_dyn( size_t elimination_size )
+ {
+ Stack stack( elimination_size );
+ base_class::test( stack );
+ }
+ };
+
TEST_F( IntrusiveTreiberStack_DHP, base )
{
typedef cds::intrusive::TreiberStack< gc_type,
test<stack_type>();
}
-\r
+
TEST_F( IntrusiveTreiberStack_DHP, elimination_base )
{
typedef cds::intrusive::TreiberStack< gc_type,
test<stack_type>();
}
-\r
+
TEST_F( IntrusiveTreiberStack_DHP, elimination_base_dynamic )
{
typedef cds::intrusive::TreiberStack< gc_type,
test_dyn<stack_type>( 2 );
}
-\r
+
TEST_F( IntrusiveTreiberStack_DHP, elimination_base_disposer )
{
typedef cds::intrusive::TreiberStack< gc_type,
test<stack_type>();
}
-\r
+
TEST_F( IntrusiveTreiberStack_DHP, elimination_member )
{
typedef cds::intrusive::TreiberStack< gc_type,
test<stack_type>();
}
-\r
+
TEST_F( IntrusiveTreiberStack_DHP, elimination_member_dynamic )
{
typedef cds::intrusive::TreiberStack< gc_type,
test_dyn<stack_type>( 2 );
}
-\r
+
TEST_F( IntrusiveTreiberStack_DHP, elimination_member_disposer )
{
typedef cds::intrusive::TreiberStack< gc_type,
test_dyn<stack_type>( 2 );
}
-\r
-} // namespace\r
-\r
+
+} // namespace
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-\r
-#include "test_intrusive_treiber_stack.h"\r
-\r
-#include <cds/gc/hp.h>\r
-#include <cds/intrusive/treiber_stack.h>\r
-\r
-namespace {\r
-\r
- namespace ci = cds::intrusive;\r
- typedef cds::gc::HP gc_type;\r
-\r
- class IntrusiveTreiberStack_HP : public cds_gtest::IntrusiveTreiberStack\r
- {\r
- typedef cds_gtest::IntrusiveTreiberStack base_class;\r
-\r
- protected:\r
- void SetUp()\r
- {\r
- typedef cds::intrusive::TreiberStack< gc_type, base_hook_item<gc_type>> stack_type;\r
-\r
- cds::gc::hp::GarbageCollector::Construct( stack_type::c_nHazardPtrCount, 1, 16 );\r
- cds::threading::Manager::attachThread();\r
- }\r
-\r
- void TearDown() \r
- {\r
- cds::threading::Manager::detachThread();\r
- cds::gc::hp::GarbageCollector::Destruct( true );\r
- }\r
-\r
- template <typename Stack>\r
- void test()\r
- {\r
- Stack stack;\r
- base_class::test( stack );\r
- }\r
-\r
- template <typename Stack>\r
- void test_dyn( size_t elimination_size )\r
- {\r
- Stack stack( elimination_size );\r
- base_class::test( stack );\r
- }\r
- };\r
-\r
+
+#include "test_intrusive_treiber_stack.h"
+
+#include <cds/gc/hp.h>
+#include <cds/intrusive/treiber_stack.h>
+
+namespace {
+
+ namespace ci = cds::intrusive;
+ typedef cds::gc::HP gc_type;
+
+ class IntrusiveTreiberStack_HP : public cds_test::IntrusiveTreiberStack
+ {
+ typedef cds_test::IntrusiveTreiberStack base_class;
+
+ protected:
+ void SetUp()
+ {
+ typedef cds::intrusive::TreiberStack< gc_type, base_hook_item<gc_type>> stack_type;
+
+ cds::gc::hp::GarbageCollector::Construct( stack_type::c_nHazardPtrCount, 1, 16 );
+ cds::threading::Manager::attachThread();
+ }
+
+ void TearDown()
+ {
+ cds::threading::Manager::detachThread();
+ cds::gc::hp::GarbageCollector::Destruct( true );
+ }
+
+ template <typename Stack>
+ void test()
+ {
+ Stack stack;
+ base_class::test( stack );
+ }
+
+ template <typename Stack>
+ void test_dyn( size_t elimination_size )
+ {
+ Stack stack( elimination_size );
+ base_class::test( stack );
+ }
+ };
+
TEST_F( IntrusiveTreiberStack_HP, defaulted )
{
typedef cds::intrusive::TreiberStack< gc_type,
test<stack_type>();
}
-\r
+
TEST_F( IntrusiveTreiberStack_HP, elimination )
{
typedef cds::intrusive::TreiberStack< gc_type,
test<stack_type>();
}
-\r
+
TEST_F( IntrusiveTreiberStack_HP, elimination_base )
{
typedef cds::intrusive::TreiberStack< gc_type,
test<stack_type>();
}
-\r
+
TEST_F( IntrusiveTreiberStack_HP, elimination_base_dynamic )
{
typedef cds::intrusive::TreiberStack< gc_type,
test_dyn<stack_type>( 2 );
}
-\r
+
TEST_F( IntrusiveTreiberStack_HP, elimination_base_disposer )
{
typedef cds::intrusive::TreiberStack< gc_type,
test<stack_type>();
}
-\r
+
TEST_F( IntrusiveTreiberStack_HP, elimination_member )
{
typedef cds::intrusive::TreiberStack< gc_type,
test<stack_type>();
}
-\r
+
TEST_F( IntrusiveTreiberStack_HP, elimination_member_dynamic )
{
typedef cds::intrusive::TreiberStack< gc_type,
test_dyn<stack_type>( 2 );
}
-\r
+
TEST_F( IntrusiveTreiberStack_HP, elimination_member_disposer )
{
typedef cds::intrusive::TreiberStack< gc_type,
test_dyn<stack_type>( 2 );
}
-\r
-} // namespace\r
-\r
+
+} // namespace
+
#include <gtest/gtest.h>
#include <cds/intrusive/details/single_link_struct.h>
-namespace cds_gtest {
+namespace cds_test {
class IntrusiveTreiberStack : public ::testing::Test
{
}
};
-} // namespace cds_gtest
+} // namespace cds_test
#endif // CDSUNIT_STACK_INTRUSIVE_TREIBER_STACK_H
#include <gtest/gtest.h>
-namespace cds_gtest {
+namespace cds_test {
class TreiberStack : public ::testing::Test
{
Stack::gc::scan();
}
};
-} // namespace cds_gtest
+} // namespace cds_test
#endif // CDSUNIT_STACK_TREIBER_STACK_H
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-\r
-#include "test_treiber_stack.h"\r
-\r
-#include <cds/gc/dhp.h>\r
-#include <cds/container/treiber_stack.h>\r
-\r
-namespace {\r
-\r
- namespace cc = cds::container;\r
- typedef cds::gc::DHP gc_type;\r
-\r
- class TreiberStack_DHP : public cds_gtest::TreiberStack\r
- {\r
- typedef cds_gtest::TreiberStack base_class;\r
-\r
- protected:\r
- void SetUp()\r
- {\r
- typedef cc::TreiberStack< gc_type, int > stack_type;\r
-\r
- cds::gc::dhp::GarbageCollector::Construct( 16, stack_type::c_nHazardPtrCount );\r
- cds::threading::Manager::attachThread();\r
- }\r
-\r
- void TearDown() \r
- {\r
- cds::threading::Manager::detachThread();\r
- cds::gc::dhp::GarbageCollector::Destruct();\r
- }\r
-\r
- template <typename Stack>\r
- void test()\r
- {\r
- Stack stack;\r
- base_class::test( stack );\r
- }\r
-\r
- template <typename Stack>\r
- void test_dyn( size_t elimination_size )\r
- {\r
- Stack stack( elimination_size );\r
- base_class::test( stack );\r
- }\r
- };\r
-\r
+
+#include "test_treiber_stack.h"
+
+#include <cds/gc/dhp.h>
+#include <cds/container/treiber_stack.h>
+
+namespace {
+
+ namespace cc = cds::container;
+ typedef cds::gc::DHP gc_type;
+
+ class TreiberStack_DHP : public cds_test::TreiberStack
+ {
+ typedef cds_test::TreiberStack base_class;
+
+ protected:
+ void SetUp()
+ {
+ typedef cc::TreiberStack< gc_type, int > stack_type;
+
+ cds::gc::dhp::GarbageCollector::Construct( 16, stack_type::c_nHazardPtrCount );
+ cds::threading::Manager::attachThread();
+ }
+
+ void TearDown()
+ {
+ cds::threading::Manager::detachThread();
+ cds::gc::dhp::GarbageCollector::Destruct();
+ }
+
+ template <typename Stack>
+ void test()
+ {
+ Stack stack;
+ base_class::test( stack );
+ }
+
+ template <typename Stack>
+ void test_dyn( size_t elimination_size )
+ {
+ Stack stack( elimination_size );
+ base_class::test( stack );
+ }
+ };
+
TEST_F( TreiberStack_DHP, defaulted )
{
typedef cc::TreiberStack< gc_type, int > stack_type;
test<stack_type>();
}
-\r
+
TEST_F( TreiberStack_DHP, backoff )
{
typedef cc::TreiberStack< gc_type, int
test<stack_type>();
}
-\r
+
TEST_F( TreiberStack_DHP, alloc )
{
// allocator must be rebinded for real value type
test<stack_type>();
}
-\r
+
TEST_F( TreiberStack_DHP, elimination )
{
typedef cc::TreiberStack< gc_type, int
test<stack_type>();
}
-\r
+
TEST_F( TreiberStack_DHP, elimination_backoff )
{
struct traits : public cc::treiber_stack::traits
test<stack_type>();
}
-\r
+
TEST_F( TreiberStack_DHP, elimination_dynamic )
{
typedef cc::TreiberStack< gc_type, int
test_dyn<stack_type>( 4 );
}
-\r
+
TEST_F( TreiberStack_DHP, elimination_stat )
{
typedef cc::TreiberStack< gc_type, int
test<stack_type>();
}
-\r
+
TEST_F( TreiberStack_DHP, elimination_dynamic_backoff )
{
struct traits : public cc::treiber_stack::traits
test_dyn<stack_type>( 2 );
}
-\r
-} // namespace\r
+
+} // namespace
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-\r
-#include "test_treiber_stack.h"\r
-\r
-#include <cds/gc/hp.h>\r
-#include <cds/container/treiber_stack.h>\r
-\r
-namespace {\r
-\r
- namespace cc = cds::container;\r
- typedef cds::gc::HP gc_type;\r
-\r
- class TreiberStack_HP : public cds_gtest::TreiberStack\r
- {\r
- typedef cds_gtest::TreiberStack base_class;\r
-\r
- protected:\r
- void SetUp()\r
- {\r
- typedef cc::TreiberStack< gc_type, int > stack_type;\r
-\r
- cds::gc::hp::GarbageCollector::Construct( stack_type::c_nHazardPtrCount, 1, 16 );\r
- cds::threading::Manager::attachThread();\r
- }\r
-\r
- void TearDown() \r
- {\r
- cds::threading::Manager::detachThread();\r
- cds::gc::hp::GarbageCollector::Destruct( true );\r
- }\r
-\r
- template <typename Stack>\r
- void test()\r
- {\r
- Stack stack;\r
- base_class::test( stack );\r
- }\r
-\r
- template <typename Stack>\r
- void test_dyn( size_t elimination_size )\r
- {\r
- Stack stack( elimination_size );\r
- base_class::test( stack );\r
- }\r
- };\r
-\r
+
+#include "test_treiber_stack.h"
+
+#include <cds/gc/hp.h>
+#include <cds/container/treiber_stack.h>
+
+namespace {
+
+ namespace cc = cds::container;
+ typedef cds::gc::HP gc_type;
+
+ class TreiberStack_HP : public cds_test::TreiberStack
+ {
+ typedef cds_test::TreiberStack base_class;
+
+ protected:
+ void SetUp()
+ {
+ typedef cc::TreiberStack< gc_type, int > stack_type;
+
+ cds::gc::hp::GarbageCollector::Construct( stack_type::c_nHazardPtrCount, 1, 16 );
+ cds::threading::Manager::attachThread();
+ }
+
+ void TearDown()
+ {
+ cds::threading::Manager::detachThread();
+ cds::gc::hp::GarbageCollector::Destruct( true );
+ }
+
+ template <typename Stack>
+ void test()
+ {
+ Stack stack;
+ base_class::test( stack );
+ }
+
+ template <typename Stack>
+ void test_dyn( size_t elimination_size )
+ {
+ Stack stack( elimination_size );
+ base_class::test( stack );
+ }
+ };
+
TEST_F( TreiberStack_HP, defaulted )
{
typedef cc::TreiberStack< gc_type, int > stack_type;
test<stack_type>();
}
-\r
+
TEST_F( TreiberStack_HP, backoff )
{
typedef cc::TreiberStack< gc_type, int
test<stack_type>();
}
-\r
+
TEST_F( TreiberStack_HP, alloc )
{
// allocator must be rebinded for real value type
test<stack_type>();
}
-\r
+
TEST_F( TreiberStack_HP, elimination )
{
typedef cc::TreiberStack< gc_type, int
test<stack_type>();
}
-\r
+
TEST_F( TreiberStack_HP, elimination_backoff )
{
struct traits : public cc::treiber_stack::traits
test<stack_type>();
}
-\r
+
TEST_F( TreiberStack_HP, elimination_dynamic )
{
typedef cc::TreiberStack< gc_type, int
test_dyn<stack_type>( 4 );
}
-\r
+
TEST_F( TreiberStack_HP, elimination_stat )
{
typedef cc::TreiberStack< gc_type, int
test<stack_type>();
}
-\r
+
TEST_F( TreiberStack_HP, elimination_dynamic_backoff )
{
struct traits : public cc::treiber_stack::traits
test_dyn<stack_type>( 2 );
}
-\r
-} // namespace\r
+
+} // namespace