Expand quad_form unit test to cover matrix case.