getgroups: Avoid invoking test with wrong parameters.