diff options
author | hjk <hjk@theqtcompany.com> | 2016-03-15 10:42:30 +0100 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2016-03-21 10:23:32 +0000 |
commit | 7543588433f185e96c76858d157cce8117816276 (patch) | |
tree | afbb890ff58073bd22f68df1d15c2b90459c555a | |
parent | 44820dae1326476a6e1aa693421c61ae67bb13b0 (diff) | |
download | qt-creator-7543588433f185e96c76858d157cce8117816276.tar.gz |
Debugger: Make offset test compilable with Qt 5.7
We can't disable C++11 anymore, disable the boost test instead.
Change-Id: I68e39a348b35ce7c37abac633d3ea68526f0ff2d
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
-rw-r--r-- | tests/auto/debugger/offsets.pro | 2 | ||||
-rw-r--r-- | tests/auto/debugger/tst_offsets.cpp | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/tests/auto/debugger/offsets.pro b/tests/auto/debugger/offsets.pro index b021596f0e..f3eef5c31a 100644 --- a/tests/auto/debugger/offsets.pro +++ b/tests/auto/debugger/offsets.pro @@ -3,8 +3,6 @@ include(../qttest.pri) QT += core-private -CONFIG -= c++11 # Fails to build with boost (due to #define private public) - exists(/usr/include/boost/unordered/unordered_set.hpp) { DEFINES += HAS_BOOST } diff --git a/tests/auto/debugger/tst_offsets.cpp b/tests/auto/debugger/tst_offsets.cpp index 5542712f21..f07435bfc1 100644 --- a/tests/auto/debugger/tst_offsets.cpp +++ b/tests/auto/debugger/tst_offsets.cpp @@ -25,6 +25,11 @@ #include <QtTest> +#ifdef HAS_BOOST +#include <boost/version.hpp> +#include <boost/unordered/unordered_set.hpp> +#endif + // Don't do this at home. This is test code, not production. #define protected public #define private public @@ -34,11 +39,6 @@ #include <private/qfileinfo_p.h> #include <private/qobject_p.h> -#ifdef HAS_BOOST -#include <boost/version.hpp> -#include <boost/unordered/unordered_set.hpp> -#endif - class tst_offsets : public QObject { Q_OBJECT @@ -221,6 +221,8 @@ void tst_offsets::offsets_data() #ifdef HAS_BOOST #if BOOST_VERSION >= (1 * 100000 + 54 * 100) { +#if QT_VERSION < 0x50700 + // would require #define private public, but doesn't compile. boost::unordered::unordered_set<int> *p = 0; QTest::newRow("boost::unordered::unordered_set::size") @@ -229,6 +231,7 @@ void tst_offsets::offsets_data() << int((char *)&p->table_.bucket_count_ - (char *)p) << 4 << 8; QTest::newRow("boost::unordered::unordered_set::buckets_") << int((char *)&p->table_.buckets_ - (char *)p) << 20 << 40; +#endif } #endif #endif |