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>
This commit is contained in:
hjk
2016-03-15 10:42:30 +01:00
parent 44820dae13
commit 7543588433
2 changed files with 8 additions and 7 deletions
-2
View File
@@ -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
}
+8 -5
View File
@@ -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