Writings Photos Code Contact Resume
QTestLib tip

You are here

Submitted by msameer on Fri, 20/08/2010 - 1:52pm

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

Subscribe to /  digg  bookmark