QTestLib tip

Body

If you are doing a data driven test using QTestLib, make sure the column names you define in the data function matches the variable name you pass to QFETCH()

void Test::foo_data() {
  QTest::addColumn<QString>("foo");
}
void Test::foo() {
  QFETCH(QString, foo);
}

I previously thought the order is enough but I lately spent a day and a half trying to understand why QTestLib refuses to fetch my variables.

Add new comment

The content of this field is kept private and will not be shown publicly.