Skip to content

Commit

Permalink
test_mx_util: Add test for mx_call_external
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed May 5, 2022
1 parent 0713866 commit bd856d7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test_mx_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,19 @@ static void test_mx_pipe_external(void) {
}
}

static void test_mx_call_external(void) {
int sts;
errno = 999;

sts = mx_call_external("/usr/bin/true", NULL);
assert(sts == 0);
assert(errno == 999);

sts = mx_call_external("/usr/bin/false", NULL);
assert(sts == -1);
assert(errno == EPROTO);
}

int main(void)
{
test_mx_strskipwhitespaces();
Expand All @@ -597,5 +610,6 @@ int main(void)
test_listsort();
test_mx_df();
test_mx_pipe_external();
test_mx_call_external();
return 0;
}

0 comments on commit bd856d7

Please sign in to comment.