diff options
author | Mattias Andrée <maandree@kth.se> | 2018-11-02 14:44:11 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2018-11-02 14:44:11 +0100 |
commit | bc8b4e954c5e509d4f4148039be5a6e458f5c1a3 (patch) | |
tree | b86e6b11b3f938298824748f670d696733b2b66c /libsimple.c | |
parent | Documentation (diff) | |
download | libsimple-bc8b4e954c5e509d4f4148039be5a6e458f5c1a3.tar.gz libsimple-bc8b4e954c5e509d4f4148039be5a6e458f5c1a3.tar.bz2 libsimple-bc8b4e954c5e509d4f4148039be5a6e458f5c1a3.tar.xz |
Remove FREE and CLOSE, and add symlinks for upcoming man pages
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | libsimple.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/libsimple.c b/libsimple.c index 1cf1cfb..6e1318f 100644 --- a/libsimple.c +++ b/libsimple.c @@ -91,12 +91,12 @@ int main(void) { struct allocinfo *volatile info; - void *ptr, *ptr2; + void *ptr; struct timespec ts, ts1, ts2; struct timeval tv1, tv2; const char *cs; char buf[1024], *s; - int intarray[10], fds[2], oldfd; + int intarray[10]; size_t i, j, n; assert(libsimple_default_failure_exit == 1); @@ -1176,32 +1176,6 @@ main(void) assert(!alloc_fail_in); } - assert((ptr = malloc(1))); - ptr2 = ptr; - if (have_custom_malloc()) { - info = get_allocinfo(ptr); - info->refcount = 2; - } - FREE(ptr); - assert(ptr == NULL); - if (have_custom_malloc()) { - assert(info->refcount == 1); - free(ptr2); - } - - assert(!pipe(fds)); - assert(fds[0] > 2 && fds[1] > 2 && fds[0] != fds[1]); - oldfd = fds[1]; - assert(!CLOSE(fds[1])); - assert(fds[1] == -1); - assert(!CLOSE(fds[1])); - errno = 0; - assert(CLOSE(oldfd) == -1 && errno == EBADF); - errno = 0; - assert(oldfd == -1); - assert(!read(fds[0], buf, sizeof(buf))); - close(fds[0]); - assert(libsimple_memeq("abcxyz", "abc123", 3)); assert(!libsimple_memeq("abcxyz", "abc123", 4)); assert(libsimple_memeq("abcxyz", "abcx23", 4)); |