common code across QP tests