Skip to content

Commit

Permalink
[libnozzle] clean up code in set_up test
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Dec 18, 2018
1 parent 4cb5a2e commit 0394c99
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions libnozzle/tests/api_nozzle_set_up.c
Expand Up @@ -39,8 +39,7 @@ static int test(void)

printf("Put the interface up\n");

err = nozzle_set_up(nozzle);
if (err < 0) {
if (nozzle_set_up(nozzle) < 0) {
printf("Unable to set interface up\n");
err = -1;
goto out_clean;
Expand Down Expand Up @@ -69,15 +68,13 @@ static int test(void)
printf("Test ERROR conditions\n");

printf("Try to UP the same interface twice\n");
err = nozzle_set_up(nozzle);
if (err < 0) {
printf("Interface was already UP, spurious error received from nozzle_set_up");
if (nozzle_set_up(nozzle) < 0) {
printf("Interface was already UP, spurious error received from nozzle_set_up\n");
err = -1;
goto out_clean;
}

printf("Pass NULL to nozzle set_up\n");
err = 0;
errno = 0;
if ((nozzle_set_up(NULL) >= 0) || (errno != EINVAL)) {
printf("Something is wrong in nozzle_set_up sanity checks\n");
Expand Down

0 comments on commit 0394c99

Please sign in to comment.