When using QTest::addColumn
and QFETCH
for a type isn't built into Qt, you have to add this line:
Q_DECLARE_METATYPE(MyType);
It goes above the start of your test class. For example:
Q_DECLARE_METATYPE(MyType);
class MyTest : public QObject
{
Q_OBJECT
private slots:
void testSomething_data()
{
QTest::addColumn< MyType >("expectedValue");
...
}
void testSomething()
{
QFETCH(MyType, expectedValue);
...
}
};