Better_Software_Header_MobileBetter_Software_Header_Web

Find what you need - explore our website and developer resources

KDAB contributions to Qt 5.9

Commit percentages to Qt in the last 16 weeks, grouped by employer


void MyTest::testMakeDouble_data() {
    QTest::addColumn<int>("input");
    QTest::addColumn<int>("output");

    QTest::newRow("data01") << 2 << 4;
    QTest::newRow("data02") << 3 << 6;
    QTest::newRow("data03") << 4 << 8;
    // ...
}

// generates 100 data rows; each one has a unique name
int j = 42;
for (int i = 0; i < 100; ++i) {
    QTest::newRow(qPrintable(QStringLiteral("data-%1-%2").arg(i).arg(j)))
       << i << j;
}

int j = 42;
for (int i = 0; i < 100; ++i) {
    QTest::addRow("data-%d-%d", i, j) << i << j;
}

// build the matcher only once, save the results
static const auto matcher = qMakeStaticByteArrayMatcher("substring");

// use it multiple times
QByteArray ba = ...;
const int index = matcher.indexIn(ba);

About KDAB


GiuseppeD'Angelo

Giuseppe D’Angelo

Senior Software Engineer

Learn Modern C++

Learn more