}
}
+#ifdef Q_CC_GNU
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wformat-security"
+#endif
+
void tst_QString::isNull()
{
QString a;
QVERIFY(!a.isNull());
}
+#ifdef Q_CC_GNU
+# pragma GCC diagnostic pop
+#endif
+
void tst_QString::isEmpty()
{
QString a;
if (n == 0)
break;
qDebug() << "Read" << str;
- if ("exit" == str)
+ if (!qstrcmp(str, "exit"))
qApp->quit();
if (socket->write(str, 100) < 0) {
int main()
{
- char *argv[] = {"appName", "slotName"};
+ char *argv[] = { const_cast<char *>("appName"), const_cast<char *>("slotName") };
int argc = 2;
tst_TestA testA;
QCOMPARE(str1, "foo");
QCOMPARE(str1, str1);
- char *str2 = "foo";
+ char *str2 = const_cast<char *>("foo");
QCOMPARE("foo", str2);
QCOMPARE(str2, "foo");
QCOMPARE(str2, str2);
QCOMPARE(ba.constData(), "bar");
QCOMPARE(ba.constData(), "foo");
- char *bar = "bar";
- char *foo = "foo";
+ char *bar = const_cast<char *>("bar");
+ char *foo = const_cast<char *>("foo");
QEXPECT_FAIL("", "Next test should fail", Continue);
QCOMPARE(ba.data(), bar);
bool TestCompiler::errorOut()
{
- qDebug(qPrintable(testOutput_.join("\n")));
+ qDebug("%s", qPrintable(testOutput_.join(QStringLiteral("\n"))));
return false;
}
void tst_QGraphicsLayoutItem::setMinimumSize_data()
{
QTest::addColumn<QSizeF>("size");
- QTest::addColumn<QSizeF>("outputSize");
- QTest::newRow("-1") << QSizeF(-1, -1) << QSizeF(0, 0);
- QTest::newRow("0") << QSizeF(0, 0) << QSizeF(0, 0);
- QTest::newRow("10") << QSizeF(10, 10) << QSizeF(10, 10);
+ QTest::newRow("-1") << QSizeF(-1, -1);
+ QTest::newRow("0") << QSizeF(0, 0);
+ QTest::newRow("10") << QSizeF(10, 10);
}
// void setMinimumSize(QSizeF const& size) public
void tst_QGraphicsLayoutItem::setMinimumSize()
{
QFETCH(QSizeF, size);
- QFETCH(QSizeF, outputSize);
SubQGraphicsLayoutItem layoutItem;
QSizeF oldSize = layoutItem.minimumSize();
openedEditor = new QWidget(parent);
return openedEditor;
}
- void destroyEditor(QWidget *editor, const QModelIndex &index) const
+ void destroyEditor(QWidget *editor, const QModelIndex &) const
{
calledVirtualDtor = true;
- // QAbstractItemDelegate::destroyEditor(editor,index);
editor->deleteLater();
}
public:
ServerAndClient(QEventLoop &ev) : success(false)
, eventLoop(ev)
- , isBody(false)
, bodyBytesRead(0)
, bodyLength(-1)
+ , isBody(false)
{
setObjectName("serverAndClient");
tcpServer = new QTcpServer(this);