Remove dependency on QPlatformSupport in fontdatabase test
If you include a static library in the test, all symbols will be duplicated, and this can cause nasty crashes because global static data is also duplicated. This happened on Linux because of a global static cache in the font engine where the two instances of it would get out of sync, and we would reference invalid data. To test QPlatformSupport features, a QPlatformSupport test which does not load any platform plugin (or uses its own platform plugin which does not load QPlatformSupport) is needed. For now, I will just revert adding the test, since it is broken and was added as part of supporting Windows CE: f2fabf77f9bc18448aed0e99a6d7d1d6c5c9c736. Change-Id: I6c002d1e0880ee8e031a68eee80e781fe0c62af4 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This commit is contained in:
parent
23051ff7ec
commit
83c9d22d44
@ -4,7 +4,7 @@ TARGET = tst_qfontdatabase
|
|||||||
SOURCES += tst_qfontdatabase.cpp
|
SOURCES += tst_qfontdatabase.cpp
|
||||||
DEFINES += SRCDIR=\\\"$$PWD\\\"
|
DEFINES += SRCDIR=\\\"$$PWD\\\"
|
||||||
QT += testlib
|
QT += testlib
|
||||||
!mac: QT += core-private gui-private platformsupport-private
|
!mac: QT += core-private gui-private
|
||||||
|
|
||||||
wince* {
|
wince* {
|
||||||
additionalFiles.files = FreeMono.ttf
|
additionalFiles.files = FreeMono.ttf
|
||||||
|
@ -44,9 +44,6 @@
|
|||||||
#include <qfontdatabase.h>
|
#include <qfontdatabase.h>
|
||||||
#include <qfontinfo.h>
|
#include <qfontinfo.h>
|
||||||
#include <qfontmetrics.h>
|
#include <qfontmetrics.h>
|
||||||
#ifndef Q_OS_MAC
|
|
||||||
#include <QtPlatformSupport/private/qbasicfontdatabase_p.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class tst_QFontDatabase : public QObject
|
class tst_QFontDatabase : public QObject
|
||||||
{
|
{
|
||||||
@ -76,10 +73,6 @@ private slots:
|
|||||||
|
|
||||||
void addAppFont_data();
|
void addAppFont_data();
|
||||||
void addAppFont();
|
void addAppFont();
|
||||||
|
|
||||||
#ifndef Q_OS_MAC
|
|
||||||
void fontName();
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
tst_QFontDatabase::tst_QFontDatabase()
|
tst_QFontDatabase::tst_QFontDatabase()
|
||||||
@ -275,13 +268,5 @@ void tst_QFontDatabase::addAppFont()
|
|||||||
QCOMPARE(db.families(), oldFamilies);
|
QCOMPARE(db.families(), oldFamilies);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef Q_OS_MAC
|
|
||||||
void tst_QFontDatabase::fontName()
|
|
||||||
{
|
|
||||||
QString fontName = QBasicFontDatabase::fontNameFromTTFile(QStringLiteral("FreeMono.ttf"));
|
|
||||||
QCOMPARE(fontName, QStringLiteral("FreeMono"));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QTEST_MAIN(tst_QFontDatabase)
|
QTEST_MAIN(tst_QFontDatabase)
|
||||||
#include "tst_qfontdatabase.moc"
|
#include "tst_qfontdatabase.moc"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user