]>
Commit | Line | Data |
---|---|---|
a9aaacca A |
1 | #include <stdio.h> |
2 | ||
3 | #include <darwintest.h> | |
4 | ||
5 | T_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 | ||
13 | T_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 | } |