Wrapped gtest/gtest.h into cds_test/ext_gtest.h to suppress GCC 7 warning
authorkhizmax <libcds.dev@gmail.com>
Fri, 12 May 2017 20:46:39 +0000 (23:46 +0300)
committerkhizmax <libcds.dev@gmail.com>
Fri, 12 May 2017 20:46:39 +0000 (23:46 +0300)
21 files changed:
projects/Win/vc141/cds.sln
test/include/cds_test/check_size.h
test/include/cds_test/ext_gtest.h [new file with mode: 0644]
test/include/cds_test/fixture.h
test/include/cds_test/thread.h
test/unit/deque/fcdeque.cpp
test/unit/main.cpp
test/unit/misc/asan_errors.cpp
test/unit/misc/bit_reversal.cpp
test/unit/misc/bitop.cpp
test/unit/misc/cxx11_atomic_class.cpp
test/unit/misc/cxx11_atomic_func.cpp
test/unit/misc/hash_tuple.cpp
test/unit/misc/permutation_generator.cpp
test/unit/misc/split_bitstring.cpp
test/unit/queue/fcqueue.cpp
test/unit/queue/intrusive_fcqueue.cpp
test/unit/stack/fcstack.cpp
test/unit/stack/intrusive_fcstack.cpp
test/unit/stack/test_intrusive_treiber_stack.h
test/unit/stack/test_treiber_stack.h

index b96c94847e8374b5a26cc89ff845c4199d8ff8cf..081f2fdb7db0c188afdc89fffc52e371285e580c 100644 (file)
@@ -1,6 +1,6 @@
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 15
-VisualStudioVersion = 15.0.26228.9
+VisualStudioVersion = 15.0.26430.4
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cds", "cds.vcxproj", "{408FE9BC-44F0-4E6A-89FA-D6F952584239}"
 EndProject
@@ -18,6 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cds_test", "cds_test", "{3A
        ProjectSection(SolutionItems) = preProject
                ..\..\..\test\include\cds_test\check_size.h = ..\..\..\test\include\cds_test\check_size.h
                ..\..\..\test\include\cds_test\city.h = ..\..\..\test\include\cds_test\city.h
+               ..\..\..\test\include\cds_test\ext_gtest.h = ..\..\..\test\include\cds_test\ext_gtest.h
                ..\..\..\test\include\cds_test\fc_hevy_value.h = ..\..\..\test\include\cds_test\fc_hevy_value.h
                ..\..\..\test\include\cds_test\fixture.h = ..\..\..\test\include\cds_test\fixture.h
                ..\..\..\test\include\cds_test\hash_func.h = ..\..\..\test\include\cds_test\hash_func.h
index 326ef9860fab3b2ba1505edf358d405463c173c1..234b0e002c065cbc5473045db7e952ba13d25b14 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef CDSTEST_CHECK_SIZE_H
 #define CDSTEST_CHECK_SIZE_H
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 #include <cds/algo/atomic.h>
 
 namespace cds_test {
diff --git a/test/include/cds_test/ext_gtest.h b/test/include/cds_test/ext_gtest.h
new file mode 100644 (file)
index 0000000..0d52501
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    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.
+*/
+
+#ifndef CDSTEST_EXT_GTEST_H
+#define CDSTEST_EXT_GTEST_H
+
+#if defined( __GCC__ ) && !defined(__clang__) && __GNUC__ >= 7
+#   pragma GCC diagnostic push
+#   pragma GCC diagnostic ignored "-Wduplicated-branches"
+#endif
+
+#include <gtest/gtest.h>
+
+#if defined( __GCC__ ) && !defined(__clang__) && __GNUC__ >= 7
+#   pragma GCC diagnostic pop
+#endif
+
+#endif // #ifndef CDSTEST_EXT_GTEST_H
index 6705770e5e4ca7039bee24d9f07cedf4cac5d2be..e09d429b77164f47c65e671b698cf16460473a7f 100644 (file)
 #ifndef CDSTEST_FIXTURE_H
 #define CDSTEST_FIXTURE_H
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 #include <algorithm>
 #include <random>
 
-// earlier version of gtest do not support 4th parameter in INSTANTIATE_TEST_CASE_P macro
-//TODO: how to known gtest version?..
-//#define CDSTEST_GTEST_INSTANTIATE_TEST_CASE_P_HAS_4TH_ARG
-
 namespace cds_test {
 
     class fixture : public ::testing::Test
index fe9e925e3bdb39b6569640894435769497b4c092..44baffdb6a96a6d17f0178bc287ea7d6c662d484 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef CDSTEST_THREAD_H
 #define CDSTEST_THREAD_H
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 #include <vector>
 #include <thread>
 #include <condition_variable>
index 0b8fe0693d061546421356a64fdc0c7692627025..c4d18f2d0139917e80d4acd38cacf7797f8a5cae 100644 (file)
@@ -28,7 +28,7 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 #include <cds/container/fcdeque.h>
 #include <boost/container/deque.hpp>
 
index 6e9fb809fcb6e4f6cb41327fc9f06ab197904f97..24f9cc59973c89b2ec35d128c6d339f597e8092f 100644 (file)
@@ -28,7 +28,7 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 */\r
 \r
-#include <gtest/gtest.h>\r
+#include <cds_test/ext_gtest.h>\r
 #include <cds/init.h>\r
 \r
 int main( int argc, char **argv )\r
index 17ebaa87e30b224dc1c285ef17639e0ede043af6..3bea56675a9d96e3bdc26a1a7bb493a092119d08 100644 (file)
@@ -30,7 +30,7 @@
 
 #ifdef CDS_ADDRESS_SANITIZER_ENABLED
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 
 namespace {
 
index d583cd54b7b138f21baf55343f7a877511ad5f7b..2c1eb109ecfb359f640fce24cc599ef65144777a 100644 (file)
@@ -28,7 +28,7 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 #include <cds/algo/bit_reversal.h>
 
 namespace {
index 34b7fed1f828b09f49933dcd084a3a0202e12ff9..faca10d1dee53a30f6baafb319d49d74ceb27c6b 100644 (file)
@@ -28,7 +28,7 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 
 #include <cds/algo/int_algo.h>
 //#include <cds/details/bit_reverse_counter.h>
index d413176ca781142d1736d92ee575bc35b22339d6..1f99d513314a19b1d055f40c1cdf42734b3fba9c 100644 (file)
@@ -28,7 +28,7 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 #include <cds/algo/atomic.h>
 #include "cxx11_convert_memory_order.h"
 
index 13413d77df7d813f709af2d51ed51deda34a7ca1..432ed4e546d625807c3cffe45852485408acb34e 100644 (file)
@@ -28,7 +28,7 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 #include <cds/algo/atomic.h>
 
 #ifndef CDS_USE_BOOST_ATOMIC
index aba62d6d88dd1b7e2b2f7d6f9ba505c002f0bd31..99160bec0a13ec3006743148045a5a558f785b2e 100644 (file)
@@ -28,7 +28,7 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 #include <cds/opt/hash.h>
 
 namespace {
index 68a164ed3f0201f2e6876f3002adf71f38f02513..355f26899db01641558b91240d7dbb24eff19e7a 100644 (file)
@@ -29,7 +29,7 @@
 */
 
 #include <cds/opt/permutation.h>
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 
 namespace {
 
index 738a6f4949239d285b83c1c186a0ed5a37432886..873b1c520f7162cfa50295998a0938a4a3872138 100644 (file)
@@ -29,7 +29,7 @@
 */
 
 #include <cds/algo/split_bitstring.h>
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 
 namespace {
     bool is_big_endian()
index 1d55ab81913d8ab64f11e8381d35fcee3edb733a..1a05b6837fcd862a2849d966fc267897e52aa13d 100644 (file)
@@ -28,7 +28,7 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 #include <cds/container/fcqueue.h>
 #include <test/include/cds_test/fc_hevy_value.h>
 
index fbd74871bcc9562ab65cb38304eeac407c8a1fc8..f306f7e92d4d34a404bfde34bcdcdd42e4ef214d 100644 (file)
@@ -28,7 +28,7 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 #include <cds/intrusive/fcqueue.h>
 
 #include <vector>
index c80f8a77e6e044f8aa26a872d0e990a6a24014fd..48d939bfd5ac5f364ceaa59201ec9d2e9f9ad796 100644 (file)
@@ -28,7 +28,7 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 #include <cds/container/fcstack.h>
 
 #include <vector>
index b6f272c3ef8cb2a0c2fe63c388c1497fe6cb2f75..901f216b738ef752e13af09fd49db08fcdc3d643 100644 (file)
@@ -28,7 +28,7 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 #include <cds/intrusive/fcstack.h>
 
 #include <boost/intrusive/list.hpp>
index 6721c934fbf3b0c6eb3440fbfc8784b7196f38b3..84565d5e346aa4b76c5637a558aa92cabe5309c4 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef CDSUNIT_STACK_INTRUSIVE_TREIBER_STACK_H
 #define CDSUNIT_STACK_INTRUSIVE_TREIBER_STACK_H
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 #include <cds/intrusive/details/single_link_struct.h>
 
 namespace cds_test {
index e3bf3ff5c1a2a1752980ba0c78310086ed159d7a..d4dc07069d9e6e7cb9229d3d75c64d72afa4b279 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef CDSUNIT_STACK_TREIBER_STACK_H
 #define CDSUNIT_STACK_TREIBER_STACK_H
 
-#include <gtest/gtest.h>
+#include <cds_test/ext_gtest.h>
 
 namespace cds_test {