Commit 75435884 authored by hjk's avatar hjk
Browse files

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: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 44820dae
......@@ -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
}
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment