test: drop redundant check

libvirt.c guarantees that nparams is non-zero for scheduler parameters.

* src/test/test_driver.c (testDomainGetSchedulerParamsFlags): Drop
redundant check.  Avoid strcpy.
This commit is contained in:
Eric Blake 2011-11-02 11:53:33 -06:00
parent f4e584decf
commit 6d897fc671
1 changed files with 4 additions and 3 deletions

View File

@ -2709,11 +2709,12 @@ testDomainGetSchedulerParamsFlags(virDomainPtr domain,
goto cleanup;
}
if (*nparams < 1) {
testError(VIR_ERR_INVALID_ARG, "%s", _("Invalid parameter count"));
if (virStrcpyStatic(params[0].field,
VIR_DOMAIN_SCHEDULER_WEIGHT) == NULL) {
testError(VIR_ERR_INTERNAL_ERROR, _("Field name '%s' too long"),
VIR_DOMAIN_SCHEDULER_WEIGHT);
goto cleanup;
}
strcpy(params[0].field, VIR_DOMAIN_SCHEDULER_WEIGHT);
params[0].type = VIR_TYPED_PARAM_UINT;
/* XXX */
/*params[0].value.ui = privdom->weight;*/