Reduce usage of Q_ASSERT in autotests.