]> git.saurik.com Git - apple/libc.git/blame - tests/ctermid.c
Libc-1439.40.11.tar.gz
[apple/libc.git] / tests / ctermid.c
CommitLineData
a9aaacca
A
1#include <stdio.h>
2
3#include <darwintest.h>
4
5T_DECL(ctermid, "ctermid")
6{
7 char term[L_ctermid] = { '\0' };
8 char *ptr = ctermid(term);
9 T_EXPECT_EQ((void*)term, (void*)ptr, "ctermid should return the buffer it received");
10 T_EXPECT_GT(strlen(ptr), 0ul, "the controlling terminal should have a name");
11}
12
13T_DECL(ctermid_null, "ctermid(NULL)")
14{
15 char *ptr = ctermid(NULL);
16 T_EXPECT_GT(strlen(ptr), 0ul, "the controlling terminal should have a name");
17}