[v3 patch] enable commented out tests
Jonathan Wakely
jwakely.gcc@gmail.com
Wed Oct 30 22:05:00 GMT 2013
GCC allows arithmetic on void pointers so std::atomic<void*> does too,
but the VERIFY checks in this test were commented out, probably
because they failed due to using sizeof(void*) when they should have
used sizeof(void), which is 1.
2013-10-30 Jonathan Wakely <jwakely.gcc@gmail.com>
* testsuite/29_atomics/atomic/operators/pointer_partial_void.cc: Fix
and enable VERIFY tests.
Tested x86_64-linux, committed to trunk.
-------------- next part --------------
commit 0224e88cccd5a4d4bf1f972a292bfc9e58d57382
Author: Jonathan Wakely <jwakely.gcc@gmail.com>
Date: Wed Oct 30 17:57:50 2013 +0000
* testsuite/29_atomics/atomic/operators/pointer_partial_void.cc: Fix
and enable VERIFY tests.
diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/operators/pointer_partial_void.cc b/libstdc++-v3/testsuite/29_atomics/atomic/operators/pointer_partial_void.cc
index fa936a1..3a4377f 100644
--- a/libstdc++-v3/testsuite/29_atomics/atomic/operators/pointer_partial_void.cc
+++ b/libstdc++-v3/testsuite/29_atomics/atomic/operators/pointer_partial_void.cc
@@ -42,28 +42,28 @@ int main(void)
a++;
void* vp3(a);
dist = reinterpret_cast<char*>(vp2) - reinterpret_cast<char*>(vp3);
- // VERIFY ( std::abs(dist) == sizeof(void*));
+ VERIFY ( std::abs(dist) == 1 );
// operator--
void* vp4(a);
a--;
void* vp5(a);
dist = reinterpret_cast<char*>(vp4) - reinterpret_cast<char*>(vp5);
- // VERIFY ( std::abs(dist) == sizeof(void*));
+ VERIFY ( std::abs(dist) == 1 );
// operator+=
void* vp6(a);
a+=n;
void* vp7(a);
dist = reinterpret_cast<char*>(vp6) - reinterpret_cast<char*>(vp7);
- // VERIFY ( std::abs(dist) == sizeof(void*) * n);
+ VERIFY ( std::abs(dist) == n );
// operator-=
void* vp8(a);
a-=n;
void* vp9(a);
dist = reinterpret_cast<char*>(vp8) - reinterpret_cast<char*>(vp9);
- //VERIFY ( std::abs(dist) == sizeof(void*) * n);
+ VERIFY ( std::abs(dist) == n );
return 0;
}
More information about the Libstdc++
mailing list