Removed prohibited atomic<void*>::fetch_xxx() tests
authorkhizmax <khizmax@gmail.com>
Mon, 24 Apr 2017 16:11:45 +0000 (19:11 +0300)
committerkhizmax <khizmax@gmail.com>
Mon, 24 Apr 2017 16:11:45 +0000 (19:11 +0300)
test/unit/misc/cxx11_atomic_class.cpp
test/unit/misc/cxx11_atomic_func.cpp

index a07401c957097223e44b29482824342ae66e8225..6912ae7f458af5e03097abba1bd450ac23851400 100644 (file)
@@ -452,18 +452,6 @@ namespace {
             EXPECT_EQ( reinterpret_cast<char *>(a.exchange( (void *) arr, order )), arr + 3 );
             EXPECT_EQ( reinterpret_cast<char *>(a.load( oLoad )), arr );
             EXPECT_EQ( *reinterpret_cast<char *>(a.load( oLoad )), 1 );
-
-            for ( char i = 1; i < aSize; ++i ) {
-                EXPECT_EQ( *reinterpret_cast<char *>(a.load( oLoad )), i );
-                a.fetch_add( 1, order );
-                EXPECT_EQ( *reinterpret_cast<char *>(a.load( oLoad )), i + 1 );
-            }
-
-            for ( char i = aSize; i > 1; --i ) {
-                EXPECT_EQ( *reinterpret_cast<char *>(a.load( oLoad )), i );
-                a.fetch_sub( 1, order );
-                EXPECT_EQ( *reinterpret_cast<char *>(a.load( oLoad )), i - 1 );
-            }
         }
 
         template <bool Volatile>
@@ -498,18 +486,6 @@ namespace {
             EXPECT_EQ( reinterpret_cast<char *>( a.load()), arr );
             EXPECT_EQ( *reinterpret_cast<char *>( a.load()), 1 );
 
-            for ( char i = 1; i < aSize; ++i ) {
-                EXPECT_EQ( *reinterpret_cast<char *>(a.load()), i );
-                a.fetch_add( 1 );
-                EXPECT_EQ( *reinterpret_cast<char *>(a.load()), i + 1 );
-            }
-
-            for ( char i = aSize; i > 1; --i ) {
-                EXPECT_EQ( *reinterpret_cast<char *>(a.load()), i );
-                a.fetch_sub( 1 );
-                EXPECT_EQ( *reinterpret_cast<char *>(a.load()), i - 1 );
-            }
-
             do_test_atomic_pointer_void_( a, arr, aSize, atomics::memory_order_relaxed );
             do_test_atomic_pointer_void_( a, arr, aSize, atomics::memory_order_acquire );
             do_test_atomic_pointer_void_( a, arr, aSize, atomics::memory_order_release );
@@ -788,8 +764,6 @@ namespace {
         test_atomic_integral_volatile<unsigned long long>();
     }
 
-#if !( CDS_COMPILER == CDS_COMPILER_CLANG && CDS_COMPILER_VERSION < 50000 )
-    //clang error with atomic<void*> fetch_add/fetch_sub
     TEST_F( cxx11_atomic_class, atomic_pointer_void )
     {
         do_test_atomic_pointer_void<false>();
@@ -799,7 +773,6 @@ namespace {
     {
         do_test_atomic_pointer_void<true>();
     }
-#endif
 
     TEST_F( cxx11_atomic_class, atomic_pointer_char )
     {
index f7c348b5b6853cbd2afaf258996946866e1ad977..17eac5c1d30f2032399b6f90abe1a1ad70c78fe7 100644 (file)
@@ -513,18 +513,6 @@ namespace misc {
             EXPECT_EQ( reinterpret_cast<char *>(atomics::atomic_exchange_explicit( &a, (void *) arr, order )), arr + 3 );
             EXPECT_EQ( reinterpret_cast<char *>(atomics::atomic_load_explicit( &a, oLoad )), arr );
             EXPECT_EQ( *reinterpret_cast<char *>(atomics::atomic_load_explicit( &a, oLoad )), 1 );
-
-            for ( char i = 1; i < aSize; ++i ) {
-                EXPECT_EQ( *reinterpret_cast<char *>(atomics::atomic_load_explicit( &a, oLoad )), i );
-                atomics::atomic_fetch_add_explicit( &a, 1, order );
-                EXPECT_EQ( *reinterpret_cast<char *>(atomics::atomic_load_explicit( &a, oLoad )), i + 1 );
-            }
-
-            for ( char i = aSize; i > 1; --i ) {
-                EXPECT_EQ( *reinterpret_cast<char *>(atomics::atomic_load_explicit( &a, oLoad )), i );
-                atomics::atomic_fetch_sub_explicit( &a, 1, order );
-                EXPECT_EQ( *reinterpret_cast<char *>(atomics::atomic_load_explicit( &a, oLoad )), i - 1 );
-            }
         }
 
         template <bool Volatile>
@@ -559,18 +547,6 @@ namespace misc {
             EXPECT_EQ( reinterpret_cast<char *>( atomics::atomic_load( &a )), arr );
             EXPECT_EQ( *reinterpret_cast<char *>(atomics::atomic_load( &a )), 1 );
 
-            for ( char i = 1; i < aSize; ++i ) {
-                EXPECT_EQ( *reinterpret_cast<char *>(atomics::atomic_load( &a )), i );
-                atomics::atomic_fetch_add( &a, 1 );
-                EXPECT_EQ( *reinterpret_cast<char *>(atomics::atomic_load( &a )), i + 1 );
-            }
-
-            for ( char i = aSize; i > 1; --i ) {
-                EXPECT_EQ( *reinterpret_cast<char *>(atomics::atomic_load( &a )), i );
-                atomics::atomic_fetch_sub( &a, 1 );
-                EXPECT_EQ( *reinterpret_cast<char *>(atomics::atomic_load( &a )), i - 1 );
-            }
-
             do_test_atomic_pointer_void_( a, arr, aSize, atomics::memory_order_relaxed );
             do_test_atomic_pointer_void_( a, arr, aSize, atomics::memory_order_acquire );
             do_test_atomic_pointer_void_( a, arr, aSize, atomics::memory_order_release );
@@ -706,8 +682,6 @@ namespace misc {
         test_atomic_integral_volatile<unsigned long long>();
     }
 
-#if !( CDS_COMPILER == CDS_COMPILER_CLANG && CDS_COMPILER_VERSION < 50000 )
-    //clang error with atomic<void*> fetch_add/fetch_sub
     TEST_F( cxx11_atomic_func, atomic_pointer_void )
     {
         do_test_atomic_pointer_void<false>();
@@ -716,7 +690,6 @@ namespace misc {
     {
         do_test_atomic_pointer_void<true>();
     }
-#endif
 
     TEST_F( cxx11_atomic_func, atomic_pointer_char )
     {