diff --git a/test_mx_util.c b/test_mx_util.c index 387db1f6..9ecf5343 100644 --- a/test_mx_util.c +++ b/test_mx_util.c @@ -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(); @@ -597,5 +610,6 @@ int main(void) test_listsort(); test_mx_df(); test_mx_pipe_external(); + test_mx_call_external(); return 0; }