Writings Photos Code Contact Resume Me
QTestLib tip
Submitted by msameer on Fri, 20/08/2010 - 3: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.

Syndicate content  digg  bookmark

Post new comment
(If you're a human, don't change the following field)
Your first name.
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <b> <dd> <dl> <dt> <i> <s> <li> <ol> <u> <ul> <br> <br /> <blockquote>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.
  • You may write mixed Arabic and English freely, line direction will be computed automaticaly

More information about formatting options