matrix unittest