summaryrefslogtreecommitdiff
path: root/test/misc/tst-inotify.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-28 20:29:21 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-28 20:31:55 +0200
commit99ef2719fb3d703fe38c4113cd7f5adec516dd3a (patch)
tree2c1f77cb41b60ccbf8faa77a3640491a3546b546 /test/misc/tst-inotify.c
parent543308f6c46cf2edf8a524bc9c631e472570fe72 (diff)
test: remove test suite
The test suite is now a developed in a separate git repository. See here: http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng-test.git The test suite should be just like every other software compiled with the cross-toolchain. In the past strange problems where found when the test suite got build in the toolchain creation step.
Diffstat (limited to 'test/misc/tst-inotify.c')
-rw-r--r--test/misc/tst-inotify.c65
1 files changed, 0 insertions, 65 deletions
diff --git a/test/misc/tst-inotify.c b/test/misc/tst-inotify.c
deleted file mode 100644
index f9f6830e3..000000000
--- a/test/misc/tst-inotify.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* vi: set sw=4 ts=4 sts=4: */
-/*
- * inotify test for uClibc
- * Copyright (C) 2012 by Kevin Cernekee <cernekee@gmail.com>
- *
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include <inttypes.h>
-#include <sys/inotify.h>
-#include <sys/fcntl.h>
-
-static int
-do_test(void)
-{
- int ifd, fd, ret, result = 0;
- struct inotify_event e;
- char tfile[] = "/tmp/inotify.XXXXXX";
-
- fd = mkstemp(tfile);
- close(fd);
-
- ifd = inotify_init1(IN_NONBLOCK);
- if (ifd < 0) {
- perror("inotify_init1()");
- result = 1;
- }
- if (inotify_add_watch(ifd, tfile, IN_DELETE_SELF) < 0) {
- perror("inotify_add_watch()");
- result = 1;
- }
-
- /* nonblocking inotify should return immediately with no events */
- ret = read(ifd, &e, sizeof(e));
- if (ret != -1 || errno != EAGAIN) {
- fprintf(stderr, "first read() returned %d\n", ret);
- result = 1;
- }
-
- /* generate an event */
- unlink(tfile);
-
- /* now check whether our event was seen */
- ret = read(ifd, &e, sizeof(e));
- if (ret != sizeof(e)) {
- fprintf(stderr, "second read() returned %d\n", ret);
- result = 1;
- }
-
- if (!(e.mask & IN_DELETE_SELF)) {
- fprintf(stderr, "incorrect event mask: %" PRIx32 "\n", e.mask);
- result = 1;
- }
-
- return result;
-}
-
-#define TIMEOUT 5
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"