diff options
Diffstat (limited to 'tests/xspawn.c')
-rw-r--r-- | tests/xspawn.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/xspawn.c b/tests/xspawn.c index 5f80e76..c1bac36 100644 --- a/tests/xspawn.c +++ b/tests/xspawn.c @@ -170,6 +170,27 @@ out: return ret; } +static bool check_resolve(void) { + bool ret = true; + char *exe; + + exe = bfs_spawn_resolve("sh"); + ret &= bfs_pcheck(exe, "bfs_spawn_resolve('sh')"); + free(exe); + + exe = bfs_spawn_resolve("/bin/sh"); + ret &= bfs_pcheck(exe && strcmp(exe, "/bin/sh") == 0); + free(exe); + + exe = bfs_spawn_resolve("bin/tests/xspawnee"); + ret &= bfs_pcheck(exe && strcmp(exe, "bin/tests/xspawnee") == 0); + free(exe); + + ret &= bfs_pcheck(!bfs_spawn_resolve("eW6f5RM9Qi") && errno == ENOENT); + + return ret; +} + bool check_xspawn(void) { bool ret = true; @@ -179,5 +200,7 @@ bool check_xspawn(void) { ret &= check_enoent(true); ret &= check_enoent(false); + ret &= check_resolve(); + return ret; } |