Eliminate duplicate data row names in widgets autotests.

Change-Id: I82bab3cc39320014fac6732c7b60233b262cb30d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
Jason McDonald 2012-02-14 13:03:16 +10:00 committed by Qt by Nokia
parent 22e0060e59
commit 1acc490248
18 changed files with 150 additions and 147 deletions

View File

@ -240,6 +240,9 @@ void tst_QFileSystemModel::naturalCompare_data()
QTest::addColumn<int>("caseSensitive");
QTest::addColumn<int>("result");
QTest::addColumn<int>("swap");
#define ROWNAME(name) (qPrintable(QString("prefix=%1, postfix=%2, num=%3, i=%4, test=%5").arg(prefix).arg(postfix).arg(num).arg(i).arg(name)))
for (int j = 0; j < 4; ++j) { // <- set a prefix and a postfix string (not numbers)
QString prefix = (j == 0 || j == 1) ? "b" : "";
QString postfix = (j == 1 || j == 2) ? "y" : "";
@ -248,32 +251,33 @@ void tst_QFileSystemModel::naturalCompare_data()
QString num = QString("%1").arg(k);
QString nump = QString("%1").arg(k + 1);
for (int i = 10; i < 12; ++i) { // <- swap s1 and s2 and reverse the result
QTest::newRow("basic") << prefix + "0" + postfix << prefix + "0" + postfix << int(Qt::CaseInsensitive) << 0;
QTest::newRow(ROWNAME("basic")) << prefix + "0" + postfix << prefix + "0" + postfix << int(Qt::CaseInsensitive) << 0;
// s1 should always be less then s2
QTest::newRow("just text") << prefix + "fred" + postfix << prefix + "jane" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("just numbers") << prefix + num + postfix << prefix + "9" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("zero") << prefix + num + postfix << prefix + "0" + nump + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("space b") << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("space a") << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("tab b") << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("tab a") << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("10 vs 2") << prefix + num + postfix << prefix + "10" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("diff len") << prefix + num + postfix << prefix + nump + postfix + "x" << int(Qt::CaseInsensitive) << i;
QTest::newRow("01 before 1") << prefix + "0" + num + postfix << prefix + nump + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("mul nums 2nd") << prefix + "1-" + num + postfix << prefix + "1-" + nump + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("mul nums 2nd") << prefix + "10-" + num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("mul nums 2nd") << prefix + "10-0"+ num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("mul nums 2nd") << prefix + "10-" + num + postfix<< prefix + "10-010" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("mul nums big") << prefix + "10-" + num + postfix<< prefix + "20-0" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("mul nums big") << prefix + "2-" + num + postfix << prefix + "10-0" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("mul alphabet") << prefix + num + "-a" + postfix << prefix + num + "-c" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("mul alphabet2")<< prefix + num + "-a9" + postfix<< prefix + num + "-c0" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("mul nums w\\0")<< prefix + num + "-"+ num + postfix<< prefix + num+"-0"+nump + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow("num first") << prefix + num + postfix << prefix + "a" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("just text")) << prefix + "fred" + postfix << prefix + "jane" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("just numbers")) << prefix + num + postfix << prefix + "9" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("zero")) << prefix + num + postfix << prefix + "0" + nump + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("space b")) << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("space a")) << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("tab b")) << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("tab a")) << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("10 vs 2")) << prefix + num + postfix << prefix + "10" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("diff len")) << prefix + num + postfix << prefix + nump + postfix + "x" << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("01 before 1")) << prefix + "0" + num + postfix << prefix + nump + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("mul nums 2nd 1")) << prefix + "1-" + num + postfix << prefix + "1-" + nump + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("mul nums 2nd 2")) << prefix + "10-" + num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("mul nums 2nd 3")) << prefix + "10-0"+ num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("mul nums 2nd 4")) << prefix + "10-" + num + postfix<< prefix + "10-010" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("mul nums big 1")) << prefix + "10-" + num + postfix<< prefix + "20-0" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("mul nums big 2")) << prefix + "2-" + num + postfix << prefix + "10-0" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("mul alphabet 1")) << prefix + num + "-a" + postfix << prefix + num + "-c" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("mul alphabet 2")) << prefix + num + "-a9" + postfix<< prefix + num + "-c0" + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("mul nums w\\0")) << prefix + num + "-"+ num + postfix<< prefix + num+"-0"+nump + postfix << int(Qt::CaseInsensitive) << i;
QTest::newRow(ROWNAME("num first")) << prefix + num + postfix << prefix + "a" + postfix << int(Qt::CaseInsensitive) << i;
}
}
}
#undef ROWNAME
}
void tst_QFileSystemModel::naturalCompare()

View File

@ -454,7 +454,6 @@ void tst_QGraphicsGridLayout::addItem_data()
for (int b = -1; b < 2; ++b) {
for (int c = -1; c < 2; ++c) {
for (int d = -1; d < 2; ++d) {
for (int e = 0; e < 9; ++e) {
int row = a;
int column = b;
int rowSpan = c;
@ -462,7 +461,7 @@ void tst_QGraphicsGridLayout::addItem_data()
QString name = QString::fromAscii("(%1,%2,%3,%4").arg(a).arg(b).arg(c).arg(d);
Qt::Alignment alignment = Qt::AlignLeft;
QTest::newRow(name.toLatin1()) << row << column << rowSpan << columnSpan << alignment;
}}}}}
}}}}
}
// public void addItem(QGraphicsLayoutItem* item, int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment = 0)

View File

@ -2365,16 +2365,16 @@ void tst_QHeaderView::setupTestData(bool also_use_reset_model)
QTest::addColumn<bool>("reset_model");
if (also_use_reset_model) {
QTest::newRow("no_updates+normal") << false << false << true;
QTest::newRow("hasupdates+normal") << true << false << true;
QTest::newRow("no_updates+special") << false << true << true;
QTest::newRow("no_updates+special") << true << true << true;
QTest::newRow("no_updates+normal+reset") << false << false << true;
QTest::newRow("hasupdates+normal+reset") << true << false << true;
QTest::newRow("no_updates+special+reset") << false << true << true;
QTest::newRow("hasupdates+special+reset") << true << true << true;
}
QTest::newRow("no_updates+normal") << false << false << false;
QTest::newRow("hasupdates+normal") << true << false << false;
QTest::newRow("no_updates+special") << false << true << false;
QTest::newRow("no_updates+special") << true << true << false;
QTest::newRow("hasupdates+special") << true << true << false;
}
void tst_QHeaderView::additionalInit()

View File

@ -970,7 +970,7 @@ void tst_QListView::selection_data()
<< QRect(300, 10, 1, 1) // selection rectangle
<< IntList(); // expected items
QTest::newRow("select to the right, (on viewport)")
QTest::newRow("select to the right 2, (on viewport)")
<< 40 // itemCount
<< int(QListView::ListMode)
<< int(QListView::TopToBottom)

View File

@ -1204,7 +1204,7 @@ void tst_QTableView::moveCursorStrikesBack_data()
<< 0 << 5 << (IntList() << int(QtTestTableView::MoveNext))
<< 1 << 0;
QTest::newRow("Last column disabled. Task QTBUG-3878") << -1 << -1
QTest::newRow("Last column disabled 2. Task QTBUG-3878") << -1 << -1
<< IntList()
<< (IntList() << 6)
<< QRect()

View File

@ -1014,13 +1014,13 @@ void tst_QTreeWidgetItemIterator::minus_eq_data()
QTest::addColumn<int>("iteratorflags");
QTest::addColumn<QString>("expecteditem");
QTest::newRow("-=0") << 0 << 0 << (int)QTreeWidgetItemIterator::All << QString("top0");
QTest::newRow("-=1") << 2 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0,child0");
QTest::newRow("-=2") << 4 << 2 << (int)QTreeWidgetItemIterator::All << QString("top0,child1");
QTest::newRow("-=(-1)") << 0 << -1 << (int)QTreeWidgetItemIterator::All << QString("top0,child0");
QTest::newRow("-=(-2)") << 0 << -2 << (int)QTreeWidgetItemIterator::All << QString("top0,child1");
QTest::newRow("-=1)") << 18 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0,child16");
QTest::newRow("-=1)") << 1 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0");
QTest::newRow("0-=0") << 0 << 0 << (int)QTreeWidgetItemIterator::All << QString("top0");
QTest::newRow("2-=1") << 2 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0,child0");
QTest::newRow("4-=2") << 4 << 2 << (int)QTreeWidgetItemIterator::All << QString("top0,child1");
QTest::newRow("0-=(-1)") << 0 << -1 << (int)QTreeWidgetItemIterator::All << QString("top0,child0");
QTest::newRow("0-=(-2)") << 0 << -2 << (int)QTreeWidgetItemIterator::All << QString("top0,child1");
QTest::newRow("18-=1") << 18 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0,child16");
QTest::newRow("1-=1") << 1 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0");
}
void tst_QTreeWidgetItemIterator::minus_eq()

View File

@ -380,16 +380,16 @@ void tst_QApplication::setFont_data()
++cnt;
}
QTest::newRow("nonexistingfont") << "nosuchfont_probably_quiteunlikely"
QTest::newRow("nonexistingfont after") << "nosuchfont_probably_quiteunlikely"
<< 0 << false;
QTest::newRow("nonexistingfont") << "nosuchfont_probably_quiteunlikely"
QTest::newRow("nonexistingfont before") << "nosuchfont_probably_quiteunlikely"
<< 0 << true;
QTest::newRow("largescaleable") << "smoothtimes" << 100 << false;
QTest::newRow("largescaleable") << "smoothtimes" << 100 << true;
QTest::newRow("largescaleable after") << "smoothtimes" << 100 << false;
QTest::newRow("largescaleable before") << "smoothtimes" << 100 << true;
QTest::newRow("largeunscaleale") << "helvetica" << 100 << false;
QTest::newRow("largeunscaleale") << "helvetica" << 100 << true;
QTest::newRow("largeunscaleale after") << "helvetica" << 100 << false;
QTest::newRow("largeunscaleale before") << "helvetica" << 100 << true;
}
void tst_QApplication::setFont()

View File

@ -797,6 +797,16 @@ void tst_QGridLayout::minMaxSize_data()
<< SizeInfo(QPoint(10, 10), QSize( 90, 90), QSize(100,100))
<< SizeInfo(QPoint(10 + 100 + 1, 10), QSize( 90, 90))
);
QTest::newRow("2x1 grid, extend to minimumSize, motif") << QString::fromAscii("motif") << 2 << 1
<< int(QSizePolicy::Preferred) << QSize() << (SizeInfoList()
<< SizeInfo(QPoint(11, 11), QSize( 90, 90), QSize(100,100))
<< SizeInfo(QPoint(11 + 100 + 6, 11), QSize( 90, 90))
);
QTest::newRow("2x1 grid, extend to minimumSize, windows") << QString::fromAscii("windows") << 2 << 1
<< int(QSizePolicy::Preferred) << QSize() << (SizeInfoList()
<< SizeInfo(QPoint(11, 11), QSize( 90, 90), QSize(100,100))
<< SizeInfo(QPoint(11 + 100 + 6, 11), QSize( 90, 90))
);
QTest::newRow("1x2 grid, extend to minimumSize") << QString() << 1 << 2
<< int(QSizePolicy::Preferred) << QSize() << (SizeInfoList()
<< SizeInfo(QPoint(10, 10), QSize( 90, 90), QSize(100,100))
@ -818,17 +828,6 @@ void tst_QGridLayout::minMaxSize_data()
<< SizeInfo(QPoint(10, 10 + 100 + 1), QSize(100,100), QSize(), QSize(), 100*100)
<< SizeInfo(QPoint(10, 10 + 100 + 1 + 50 + 1), QSize(100,100), QSize(), QSize(100, 100))
);
QTest::newRow("2x1 grid, extend to minimumSize") << QString::fromAscii("motif") << 2 << 1
<< int(QSizePolicy::Preferred) << QSize() << (SizeInfoList()
<< SizeInfo(QPoint(11, 11), QSize( 90, 90), QSize(100,100))
<< SizeInfo(QPoint(11 + 100 + 6, 11), QSize( 90, 90))
);
QTest::newRow("2x1 grid, extend to minimumSize") << QString::fromAscii("windows") << 2 << 1
<< int(QSizePolicy::Preferred) << QSize() << (SizeInfoList()
<< SizeInfo(QPoint(11, 11), QSize( 90, 90), QSize(100,100))
<< SizeInfo(QPoint(11 + 100 + 6, 11), QSize( 90, 90))
);
}
void tst_QGridLayout::minMaxSize()

View File

@ -367,40 +367,42 @@ void tst_QCompleter::csMatchingOnCsSortedModel_data()
QTest::addColumn<QString>("completion");
QTest::addColumn<QString>("completionText");
#define ROWNAME(name) (qPrintable(QString("%1 %2").arg(name).arg(i)))
for (int i = 0; i < 2; i++) {
if (i == 1)
QTest::newRow("FILTERING_OFF") << "FILTERING_OFF" << "" << "" << "";
// Plain text filter
QTest::newRow("()") << "" << "" << "P0" << "P0";
QTest::newRow("()F") << "" << "F" << "P0" << "P0";
QTest::newRow("()L") << "" << "L" << "p4" << "p4";
QTest::newRow("()L") << "" << "L" << "p4" << "p4";
QTest::newRow("()N") << "" << "N" << "P1" << "P1";
QTest::newRow("(P)") << "P" << "" << "P0" << "P0";
QTest::newRow("(P)F") << "P" << "" << "P0" << "P0";
QTest::newRow("(P)L") << "P" << "L" << "P4" << "P4";
QTest::newRow("(p)") << "p" << "" << "p0" << "p0";
QTest::newRow("(p)N") << "p" << "N" << "p1" << "p1";
QTest::newRow("(p)NN") << "p" << "NN" << "p2" << "p2";
QTest::newRow("(p)NNN") << "p" << "NNN" << "p3" << "p3";
QTest::newRow("(p)NNNN") << "p" << "NNNN" << "p4" << "p4";
QTest::newRow("(p1)") << "p1" << "" << "p1" << "p1";
QTest::newRow("(p11)") << "p11" << "" << "" << "";
QTest::newRow(ROWNAME("()")) << "" << "" << "P0" << "P0";
QTest::newRow(ROWNAME("()F")) << "" << "F" << "P0" << "P0";
QTest::newRow(ROWNAME("()L")) << "" << "L" << "p4" << "p4";
QTest::newRow(ROWNAME("()N")) << "" << "N" << "P1" << "P1";
QTest::newRow(ROWNAME("(P)")) << "P" << "" << "P0" << "P0";
QTest::newRow(ROWNAME("(P)F")) << "P" << "" << "P0" << "P0";
QTest::newRow(ROWNAME("(P)L")) << "P" << "L" << "P4" << "P4";
QTest::newRow(ROWNAME("(p)")) << "p" << "" << "p0" << "p0";
QTest::newRow(ROWNAME("(p)N")) << "p" << "N" << "p1" << "p1";
QTest::newRow(ROWNAME("(p)NN")) << "p" << "NN" << "p2" << "p2";
QTest::newRow(ROWNAME("(p)NNN")) << "p" << "NNN" << "p3" << "p3";
QTest::newRow(ROWNAME("(p)NNNN")) << "p" << "NNNN" << "p4" << "p4";
QTest::newRow(ROWNAME("(p1)")) << "p1" << "" << "p1" << "p1";
QTest::newRow(ROWNAME("(p11)")) << "p11" << "" << "" << "";
// Tree filter
QTest::newRow("(P0,)") << "P0," << "" << "c0P0" << "P0,c0P0";
QTest::newRow("(P0,c)") << "P0,c" << "" << "c0P0" << "P0,c0P0";
QTest::newRow("(P0,c1)") << "P0,c1" << "" << "c1P0" << "P0,c1P0";
QTest::newRow("(P0,c3P0)") << "P0,c3P0" << "" << "c3P0" << "P0,c3P0";
QTest::newRow("(P3,c)F") << "P3,c" << "F" << "c0P3" << "P3,c0P3";
QTest::newRow("(P3,c)L") << "P3,c" << "L" << "c4P3" << "P3,c4P3";
QTest::newRow("(P3,c)N") << "P3,c" << "N" << "c1P3" << "P3,c1P3";
QTest::newRow("(P3,c)NN") << "P3,c" << "NN" << "c2P3" << "P3,c2P3";
QTest::newRow("(P3,,c)") << "P3,,c" << "" << "" << "";
QTest::newRow("(P3,c0P3,)") << "P3,c0P3," << "" << "" << "";
QTest::newRow("(P,)") << "P," << "" << "" << "";
QTest::newRow(ROWNAME("(P0,)")) << "P0," << "" << "c0P0" << "P0,c0P0";
QTest::newRow(ROWNAME("(P0,c)")) << "P0,c" << "" << "c0P0" << "P0,c0P0";
QTest::newRow(ROWNAME("(P0,c1)")) << "P0,c1" << "" << "c1P0" << "P0,c1P0";
QTest::newRow(ROWNAME("(P0,c3P0)")) << "P0,c3P0" << "" << "c3P0" << "P0,c3P0";
QTest::newRow(ROWNAME("(P3,c)F")) << "P3,c" << "F" << "c0P3" << "P3,c0P3";
QTest::newRow(ROWNAME("(P3,c)L")) << "P3,c" << "L" << "c4P3" << "P3,c4P3";
QTest::newRow(ROWNAME("(P3,c)N")) << "P3,c" << "N" << "c1P3" << "P3,c1P3";
QTest::newRow(ROWNAME("(P3,c)NN")) << "P3,c" << "NN" << "c2P3" << "P3,c2P3";
QTest::newRow(ROWNAME("(P3,,c)")) << "P3,,c" << "" << "" << "";
QTest::newRow(ROWNAME("(P3,c0P3,)")) << "P3,c0P3," << "" << "" << "";
QTest::newRow(ROWNAME("(P,)")) << "P," << "" << "" << "";
}
#undef ROWNAME
}
void tst_QCompleter::csMatchingOnCsSortedModel()

View File

@ -229,13 +229,13 @@ void tst_QAbstractButton::onReleased()
void tst_QAbstractButton::setAutoRepeat_data()
{
QTest::addColumn<int>("mode");
QTest::newRow( "" ) << 0;
QTest::newRow( "" ) << 1;
QTest::newRow( "" ) << 2;
QTest::newRow( "" ) << 3;
QTest::newRow( "" ) << 4;
QTest::newRow( "" ) << 5;
QTest::newRow( "" ) << 6;
QTest::newRow("mode 0") << 0;
QTest::newRow("mode 1") << 1;
QTest::newRow("mode 2") << 2;
QTest::newRow("mode 3") << 3;
QTest::newRow("mode 4") << 4;
QTest::newRow("mode 5") << 5;
QTest::newRow("mode 6") << 6;
}
#define REPEAT_DELAY 1000

View File

@ -482,7 +482,7 @@ void tst_QAbstractSlider::keyPressed_data()
QList<Qt::Key> list;
list << Qt::Key_Down;
QTest::newRow("Step down once") << 10 // initial position
QTest::newRow("Step down once 1") << 10 // initial position
<< 0 // minimum
<< 100 // maximum
<< 3 // single step size
@ -495,7 +495,7 @@ void tst_QAbstractSlider::keyPressed_data()
list = QList<Qt::Key>();
list << Qt::Key_Up;
QTest::newRow("Step down once") << 10 // initial position
QTest::newRow("Step down once 2") << 10 // initial position
<< 0 // minimum
<< 100 // maximum
<< 3 // single step size

View File

@ -360,11 +360,11 @@ void tst_QDoubleValidator::validateIntEquiv_data()
QTest::newRow("4.6") << 0.0 << 10.0 << QString(".1") << INV;
QTest::newRow("4.7") << 0.0 << 10.0 << QString("-1.0") << INV;
QTest::newRow("5.1") << 6.0 << 8.0 << QString("5") << ITM;
QTest::newRow("5.1") << 6.0 << 8.0 << QString("56") << INV;
QTest::newRow("5.1a") << 6.0 << 8.0 << QString("5") << ITM;
QTest::newRow("5.1b") << 6.0 << 8.0 << QString("56") << INV;
QTest::newRow("5.2") << 6.0 << 8.0 << QString("7") << ACC;
QTest::newRow("5.3") << 6.0 << 8.0 << QString("9") << ITM;
QTest::newRow("5.3") << 6.0 << 8.0 << QString("-") << INV;
QTest::newRow("5.3a") << 6.0 << 8.0 << QString("9") << ITM;
QTest::newRow("5.3b") << 6.0 << 8.0 << QString("-") << INV;
QTest::newRow("5.4a") << -8.0 << -6.0 << QString("+") << INV;
QTest::newRow("5.4b") << -8.0 << -6.0 << QString("+5") << INV;
QTest::newRow("5.4c") << -8.0 << -6.0 << QString("-5") << ITM;

View File

@ -256,7 +256,7 @@ void tst_QFontComboBox::writingSystem_data()
QTest::newRow("Runic") << QFontDatabase::Runic;
for (int i = 0; i < 31; ++i)
QTest::newRow("enum") << (QFontDatabase::WritingSystem)i;
QTest::newRow(qPrintable(QString("enum %1").arg(i))) << (QFontDatabase::WritingSystem)i;
}
// public QFontDatabase::WritingSystem writingSystem() const

View File

@ -70,8 +70,8 @@ void tst_QIntValidator::validate_data()
QTest::newRow("data1") << 0 << 100 << QString("500") << INV;
QTest::newRow("data1a") << 0 << 100 << QString("5000") << INV;
QTest::newRow("data1b") << -100 << 0 << QString("50") << INT;
QTest::newRow("data1b") << -100 << 0 << QString("500") << INV;
QTest::newRow("data1c") << -100 << 0 << QString("5000") << INV;
QTest::newRow("data1c") << -100 << 0 << QString("500") << INV;
QTest::newRow("data1d") << -100 << 0 << QString("5000") << INV;
QTest::newRow("data2") << 0 << 100 << QString("-35") << INV;
QTest::newRow("data3") << 0 << 100 << QString("a") << INV;
QTest::newRow("data4") << 0 << 100 << QString("-") << INV;

View File

@ -312,7 +312,7 @@ void tst_QLabel::eventPropagation_data()
QTest::newRow("rich text2") << QString("<b>rich text</b>") << (int)Qt::TextSelectableByKeyboard << (int)Qt::ClickFocus << true;
QTest::newRow("rich text3") << QString("<b>rich text</b>") << (int)Qt::TextSelectableByMouse << (int)Qt::ClickFocus << false;
QTest::newRow("rich text4") << QString("<b>rich text</b>") << (int)Qt::NoTextInteraction << (int)Qt::NoFocus << true;
QTest::newRow("rich text4") << QString("<b>rich text</b>") << (int)Qt::LinksAccessibleByKeyboard << (int)Qt::StrongFocus << true;
QTest::newRow("rich text5") << QString("<b>rich text</b>") << (int)Qt::LinksAccessibleByKeyboard << (int)Qt::StrongFocus << true;
if (!test_box)
test_box = new Widget;

View File

@ -647,22 +647,21 @@ void tst_QLineEdit::inputMask_data()
QTest::addColumn<QString>("expectedMask");
// if no mask is set a nul string should be returned
QTest::newRow("") << QString("") << QString();
QTest::newRow("") << QString() << QString();
QTest::newRow("nul 1") << QString("") << QString();
QTest::newRow("nul 2") << QString() << QString();
// try different masks
QTest::newRow("") << QString("000.000.000.000") << QString("000.000.000.000; ");
QTest::newRow("") << QString("000.000.000.000;#") << QString("000.000.000.000;#");
QTest::newRow("") << QString("AAA.aa.999.###;") << QString("AAA.aa.999.###; ");
QTest::newRow("") << QString(">abcdef<GHIJK") << QString(">abcdef<GHIJK; ");
// QTest::newRow("") << QString() << QString();
QTest::newRow("mask 1") << QString("000.000.000.000") << QString("000.000.000.000; ");
QTest::newRow("mask 2") << QString("000.000.000.000;#") << QString("000.000.000.000;#");
QTest::newRow("mask 3") << QString("AAA.aa.999.###;") << QString("AAA.aa.999.###; ");
QTest::newRow("mask 4") << QString(">abcdef<GHIJK") << QString(">abcdef<GHIJK; ");
// set an invalid input mask...
// the current behaviour is that this exact (faulty) string is returned.
QTest::newRow("") << QString("ABCDEFGHIKLMNOP;") << QString("ABCDEFGHIKLMNOP; ");
QTest::newRow("invalid") << QString("ABCDEFGHIKLMNOP;") << QString("ABCDEFGHIKLMNOP; ");
// verify that we can unset the mask again
QTest::newRow("") << QString("") << QString();
QTest::newRow("unset") << QString("") << QString();
}
void tst_QLineEdit::inputMask()
@ -3441,32 +3440,32 @@ void tst_QLineEdit::task233101_cursorPosAfterInputMethod_data()
QTest::addColumn<int>("replacementLength");
QTest::addColumn<QString>("commitString");
QTest::newRow("") << 4 << 4 << 0 << 0 << QString("");
QTest::newRow("") << 4 << 4 << 0 << 0 << QString("x");
QTest::newRow("") << 4 << 4 << 0 << 0 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("") << 4 << 3 << 0 << 0 << QString("");
QTest::newRow("") << 4 << 3 << 0 << 0 << QString("x");
QTest::newRow("") << 4 << 3 << 0 << 0 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("") << 4 << 0 << 0 << 0 << QString("");
QTest::newRow("") << 4 << 0 << 0 << 0 << QString("x");
QTest::newRow("") << 4 << 0 << 0 << 0 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("data1") << 4 << 4 << 0 << 0 << QString("");
QTest::newRow("data2") << 4 << 4 << 0 << 0 << QString("x");
QTest::newRow("data3") << 4 << 4 << 0 << 0 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("data4") << 4 << 3 << 0 << 0 << QString("");
QTest::newRow("data5") << 4 << 3 << 0 << 0 << QString("x");
QTest::newRow("data6") << 4 << 3 << 0 << 0 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("data7") << 4 << 0 << 0 << 0 << QString("");
QTest::newRow("data8") << 4 << 0 << 0 << 0 << QString("x");
QTest::newRow("data9") << 4 << 0 << 0 << 0 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("") << 4 << 4 << -4 << 4 << QString("");
QTest::newRow("") << 4 << 4 << -4 << 4 << QString("x");
QTest::newRow("") << 4 << 4 << -4 << 4 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("") << 4 << 3 << -3 << 4 << QString("");
QTest::newRow("") << 4 << 3 << -3 << 4 << QString("x");
QTest::newRow("") << 4 << 3 << -3 << 4 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("") << 4 << 0 << 0 << 4 << QString("");
QTest::newRow("") << 4 << 0 << 0 << 4 << QString("x");
QTest::newRow("") << 4 << 0 << 0 << 4 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("data10") << 4 << 4 << -4 << 4 << QString("");
QTest::newRow("data11") << 4 << 4 << -4 << 4 << QString("x");
QTest::newRow("data12") << 4 << 4 << -4 << 4 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("data13") << 4 << 3 << -3 << 4 << QString("");
QTest::newRow("data14") << 4 << 3 << -3 << 4 << QString("x");
QTest::newRow("data15") << 4 << 3 << -3 << 4 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("data16") << 4 << 0 << 0 << 4 << QString("");
QTest::newRow("data17") << 4 << 0 << 0 << 4 << QString("x");
QTest::newRow("data18") << 4 << 0 << 0 << 4 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("") << 4 << 4 << -4 << 0 << QString("");
QTest::newRow("") << 4 << 4 << -4 << 0 << QString("x");
QTest::newRow("") << 4 << 4 << -4 << 0 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("") << 4 << 3 << -3 << 0 << QString("");
QTest::newRow("") << 4 << 3 << -3 << 0 << QString("x");
QTest::newRow("") << 4 << 3 << -3 << 0 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("data19") << 4 << 4 << -4 << 0 << QString("");
QTest::newRow("data20") << 4 << 4 << -4 << 0 << QString("x");
QTest::newRow("data21") << 4 << 4 << -4 << 0 << QString("xxxxxxxxxxxxxxxx");
QTest::newRow("data22") << 4 << 3 << -3 << 0 << QString("");
QTest::newRow("data23") << 4 << 3 << -3 << 0 << QString("x");
QTest::newRow("data24") << 4 << 3 << -3 << 0 << QString("xxxxxxxxxxxxxxxx");
}
void tst_QLineEdit::task233101_cursorPosAfterInputMethod()

View File

@ -657,22 +657,22 @@ void tst_QSpinBox::valueFromTextAndValidate_data()
QTest::newRow("data3") << QString("2") << Acceptable << 0 << 100 << QString();
QTest::newRow("data4") << QString() << Intermediate << 0 << 1 << QString();
QTest::newRow("data5") << QString() << Invalid << 0 << 0 << QString();
QTest::newRow("data5") << QString("5") << Intermediate << 2004 << 2005 << QString();
QTest::newRow("data6") << QString("50") << Intermediate << 2004 << 2005 << QString();
QTest::newRow("data7") << QString("205") << Intermediate << 2004 << 2005 << QString();
QTest::newRow("data8") << QString("2005") << Acceptable << 2004 << 2005 << QString();
QTest::newRow("data9") << QString("3") << Intermediate << 2004 << 2005 << QString();
QTest::newRow("data10") << QString("-") << Intermediate << -20 << -10 << QString();
QTest::newRow("data11") << QString("-1") << Intermediate << -20 << -10 << QString();
QTest::newRow("data12") << QString("-5") << Intermediate << -20 << -10 << QString();
QTest::newRow("data13") << QString("-5") << Intermediate << -20 << -16 << QString();
QTest::newRow("data14") << QString("-2") << Intermediate << -20 << -16 << QString();
QTest::newRow("data15") << QString("2") << Invalid << -20 << -16 << QString();
QTest::newRow("data16") << QString() << Intermediate << -20 << -16 << QString();
QTest::newRow("data17") << QString(" 22") << Acceptable << 0 << 1000 << QString("22");
QTest::newRow("data18") << QString("22 ") << Acceptable << 0 << 1000 << QString("22");
QTest::newRow("data19") << QString(" 22 ") << Acceptable << 0 << 1000 << QString("22");
QTest::newRow("data20") << QString("2 2") << Invalid << 0 << 1000 << QString();
QTest::newRow("data6") << QString("5") << Intermediate << 2004 << 2005 << QString();
QTest::newRow("data7") << QString("50") << Intermediate << 2004 << 2005 << QString();
QTest::newRow("data8") << QString("205") << Intermediate << 2004 << 2005 << QString();
QTest::newRow("data9") << QString("2005") << Acceptable << 2004 << 2005 << QString();
QTest::newRow("data10") << QString("3") << Intermediate << 2004 << 2005 << QString();
QTest::newRow("data11") << QString("-") << Intermediate << -20 << -10 << QString();
QTest::newRow("data12") << QString("-1") << Intermediate << -20 << -10 << QString();
QTest::newRow("data13") << QString("-5") << Intermediate << -20 << -10 << QString();
QTest::newRow("data14") << QString("-5") << Intermediate << -20 << -16 << QString();
QTest::newRow("data15") << QString("-2") << Intermediate << -20 << -16 << QString();
QTest::newRow("data16") << QString("2") << Invalid << -20 << -16 << QString();
QTest::newRow("data17") << QString() << Intermediate << -20 << -16 << QString();
QTest::newRow("data18") << QString(" 22") << Acceptable << 0 << 1000 << QString("22");
QTest::newRow("data19") << QString("22 ") << Acceptable << 0 << 1000 << QString("22");
QTest::newRow("data20") << QString(" 22 ") << Acceptable << 0 << 1000 << QString("22");
QTest::newRow("data21") << QString("2 2") << Invalid << 0 << 1000 << QString();
}
static QString stateName(int state)

View File

@ -507,7 +507,7 @@ void tst_QSplitter::setStretchFactor_data()
QTest::newRow("ok06") << int(Qt::Vertical) << 1 << 1 << 1 << 1;
QTest::newRow("ok07") << int(Qt::Vertical) << 2 << 2 << 2 << 2;
QTest::newRow("ok08") << int(Qt::Vertical) << 3 << 5 << 5 << 5;
QTest::newRow("ok08") << int(Qt::Vertical) << -1 << 5 << 0 << 0;
QTest::newRow("ok09") << int(Qt::Vertical) << -1 << 5 << 0 << 0;
}
void tst_QSplitter::setStretchFactor()