foolio 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +29 -0
- data/Rakefile +21 -0
- data/examples/timer.rb +20 -0
- data/ext/foolio/extconf.rb +34 -0
- data/ext/foolio/foolio_ext.c +921 -0
- data/ext/foolio/gen.rb +50 -0
- data/ext/foolio/make_table.rb +12 -0
- data/ext/foolio/templ +243 -0
- data/ext/libuv/.gitignore +33 -0
- data/ext/libuv/.mailmap +13 -0
- data/ext/libuv/.travis.yml +9 -0
- data/ext/libuv/AUTHORS +61 -0
- data/ext/libuv/LICENSE +44 -0
- data/ext/libuv/Makefile +71 -0
- data/ext/libuv/README.md +90 -0
- data/ext/libuv/common.gypi +178 -0
- data/ext/libuv/gyp_uv +73 -0
- data/ext/libuv/include/uv-private/eio.h +403 -0
- data/ext/libuv/include/uv-private/ev.h +838 -0
- data/ext/libuv/include/uv-private/ngx-queue.h +108 -0
- data/ext/libuv/include/uv-private/tree.h +768 -0
- data/ext/libuv/include/uv-private/uv-unix.h +324 -0
- data/ext/libuv/include/uv-private/uv-win.h +517 -0
- data/ext/libuv/include/uv.h +1838 -0
- data/ext/libuv/src/fs-poll.c +235 -0
- data/ext/libuv/src/inet.c +293 -0
- data/ext/libuv/src/unix/async.c +148 -0
- data/ext/libuv/src/unix/core.c +696 -0
- data/ext/libuv/src/unix/cygwin.c +83 -0
- data/ext/libuv/src/unix/darwin.c +342 -0
- data/ext/libuv/src/unix/dl.c +83 -0
- data/ext/libuv/src/unix/eio/Changes +63 -0
- data/ext/libuv/src/unix/eio/LICENSE +36 -0
- data/ext/libuv/src/unix/eio/Makefile.am +15 -0
- data/ext/libuv/src/unix/eio/aclocal.m4 +8957 -0
- data/ext/libuv/src/unix/eio/autogen.sh +3 -0
- data/ext/libuv/src/unix/eio/config.h.in +86 -0
- data/ext/libuv/src/unix/eio/config_cygwin.h +80 -0
- data/ext/libuv/src/unix/eio/config_darwin.h +141 -0
- data/ext/libuv/src/unix/eio/config_freebsd.h +81 -0
- data/ext/libuv/src/unix/eio/config_linux.h +94 -0
- data/ext/libuv/src/unix/eio/config_netbsd.h +81 -0
- data/ext/libuv/src/unix/eio/config_openbsd.h +137 -0
- data/ext/libuv/src/unix/eio/config_sunos.h +84 -0
- data/ext/libuv/src/unix/eio/configure.ac +22 -0
- data/ext/libuv/src/unix/eio/demo.c +194 -0
- data/ext/libuv/src/unix/eio/ecb.h +370 -0
- data/ext/libuv/src/unix/eio/eio.3 +3428 -0
- data/ext/libuv/src/unix/eio/eio.c +2593 -0
- data/ext/libuv/src/unix/eio/eio.pod +969 -0
- data/ext/libuv/src/unix/eio/libeio.m4 +195 -0
- data/ext/libuv/src/unix/eio/xthread.h +164 -0
- data/ext/libuv/src/unix/error.c +105 -0
- data/ext/libuv/src/unix/ev/Changes +388 -0
- data/ext/libuv/src/unix/ev/LICENSE +36 -0
- data/ext/libuv/src/unix/ev/Makefile.am +18 -0
- data/ext/libuv/src/unix/ev/Makefile.in +771 -0
- data/ext/libuv/src/unix/ev/README +58 -0
- data/ext/libuv/src/unix/ev/aclocal.m4 +8957 -0
- data/ext/libuv/src/unix/ev/autogen.sh +6 -0
- data/ext/libuv/src/unix/ev/config.guess +1526 -0
- data/ext/libuv/src/unix/ev/config.h.in +125 -0
- data/ext/libuv/src/unix/ev/config.sub +1658 -0
- data/ext/libuv/src/unix/ev/config_cygwin.h +123 -0
- data/ext/libuv/src/unix/ev/config_darwin.h +122 -0
- data/ext/libuv/src/unix/ev/config_freebsd.h +120 -0
- data/ext/libuv/src/unix/ev/config_linux.h +141 -0
- data/ext/libuv/src/unix/ev/config_netbsd.h +120 -0
- data/ext/libuv/src/unix/ev/config_openbsd.h +126 -0
- data/ext/libuv/src/unix/ev/config_sunos.h +122 -0
- data/ext/libuv/src/unix/ev/configure +13037 -0
- data/ext/libuv/src/unix/ev/configure.ac +18 -0
- data/ext/libuv/src/unix/ev/depcomp +630 -0
- data/ext/libuv/src/unix/ev/ev++.h +816 -0
- data/ext/libuv/src/unix/ev/ev.3 +5311 -0
- data/ext/libuv/src/unix/ev/ev.c +3925 -0
- data/ext/libuv/src/unix/ev/ev.pod +5243 -0
- data/ext/libuv/src/unix/ev/ev_epoll.c +266 -0
- data/ext/libuv/src/unix/ev/ev_kqueue.c +235 -0
- data/ext/libuv/src/unix/ev/ev_poll.c +148 -0
- data/ext/libuv/src/unix/ev/ev_port.c +179 -0
- data/ext/libuv/src/unix/ev/ev_select.c +310 -0
- data/ext/libuv/src/unix/ev/ev_vars.h +203 -0
- data/ext/libuv/src/unix/ev/ev_win32.c +153 -0
- data/ext/libuv/src/unix/ev/ev_wrap.h +196 -0
- data/ext/libuv/src/unix/ev/event.c +402 -0
- data/ext/libuv/src/unix/ev/event.h +170 -0
- data/ext/libuv/src/unix/ev/install-sh +294 -0
- data/ext/libuv/src/unix/ev/libev.m4 +39 -0
- data/ext/libuv/src/unix/ev/ltmain.sh +8413 -0
- data/ext/libuv/src/unix/ev/missing +336 -0
- data/ext/libuv/src/unix/ev/mkinstalldirs +111 -0
- data/ext/libuv/src/unix/freebsd.c +326 -0
- data/ext/libuv/src/unix/fs.c +739 -0
- data/ext/libuv/src/unix/internal.h +188 -0
- data/ext/libuv/src/unix/kqueue.c +120 -0
- data/ext/libuv/src/unix/linux/inotify.c +239 -0
- data/ext/libuv/src/unix/linux/linux-core.c +557 -0
- data/ext/libuv/src/unix/linux/syscalls.c +388 -0
- data/ext/libuv/src/unix/linux/syscalls.h +124 -0
- data/ext/libuv/src/unix/loop-watcher.c +62 -0
- data/ext/libuv/src/unix/loop.c +94 -0
- data/ext/libuv/src/unix/netbsd.c +108 -0
- data/ext/libuv/src/unix/openbsd.c +295 -0
- data/ext/libuv/src/unix/pipe.c +259 -0
- data/ext/libuv/src/unix/poll.c +114 -0
- data/ext/libuv/src/unix/process.c +495 -0
- data/ext/libuv/src/unix/signal.c +269 -0
- data/ext/libuv/src/unix/stream.c +990 -0
- data/ext/libuv/src/unix/sunos.c +481 -0
- data/ext/libuv/src/unix/tcp.c +393 -0
- data/ext/libuv/src/unix/thread.c +251 -0
- data/ext/libuv/src/unix/timer.c +136 -0
- data/ext/libuv/src/unix/tty.c +145 -0
- data/ext/libuv/src/unix/udp.c +659 -0
- data/ext/libuv/src/unix/uv-eio.c +107 -0
- data/ext/libuv/src/unix/uv-eio.h +13 -0
- data/ext/libuv/src/uv-common.c +380 -0
- data/ext/libuv/src/uv-common.h +170 -0
- data/ext/libuv/src/win/async.c +100 -0
- data/ext/libuv/src/win/atomicops-inl.h +56 -0
- data/ext/libuv/src/win/core.c +278 -0
- data/ext/libuv/src/win/dl.c +86 -0
- data/ext/libuv/src/win/error.c +155 -0
- data/ext/libuv/src/win/fs-event.c +510 -0
- data/ext/libuv/src/win/fs.c +1948 -0
- data/ext/libuv/src/win/getaddrinfo.c +365 -0
- data/ext/libuv/src/win/handle-inl.h +149 -0
- data/ext/libuv/src/win/handle.c +154 -0
- data/ext/libuv/src/win/internal.h +343 -0
- data/ext/libuv/src/win/loop-watcher.c +122 -0
- data/ext/libuv/src/win/pipe.c +1672 -0
- data/ext/libuv/src/win/poll.c +616 -0
- data/ext/libuv/src/win/process-stdio.c +500 -0
- data/ext/libuv/src/win/process.c +1013 -0
- data/ext/libuv/src/win/req-inl.h +220 -0
- data/ext/libuv/src/win/req.c +25 -0
- data/ext/libuv/src/win/signal.c +57 -0
- data/ext/libuv/src/win/stream-inl.h +67 -0
- data/ext/libuv/src/win/stream.c +167 -0
- data/ext/libuv/src/win/tcp.c +1394 -0
- data/ext/libuv/src/win/thread.c +372 -0
- data/ext/libuv/src/win/threadpool.c +74 -0
- data/ext/libuv/src/win/timer.c +224 -0
- data/ext/libuv/src/win/tty.c +1799 -0
- data/ext/libuv/src/win/udp.c +716 -0
- data/ext/libuv/src/win/util.c +864 -0
- data/ext/libuv/src/win/winapi.c +132 -0
- data/ext/libuv/src/win/winapi.h +4452 -0
- data/ext/libuv/src/win/winsock.c +557 -0
- data/ext/libuv/src/win/winsock.h +171 -0
- data/ext/libuv/test/benchmark-async-pummel.c +97 -0
- data/ext/libuv/test/benchmark-async.c +137 -0
- data/ext/libuv/test/benchmark-fs-stat.c +135 -0
- data/ext/libuv/test/benchmark-getaddrinfo.c +94 -0
- data/ext/libuv/test/benchmark-list.h +127 -0
- data/ext/libuv/test/benchmark-loop-count.c +88 -0
- data/ext/libuv/test/benchmark-million-timers.c +65 -0
- data/ext/libuv/test/benchmark-ping-pongs.c +213 -0
- data/ext/libuv/test/benchmark-pound.c +324 -0
- data/ext/libuv/test/benchmark-pump.c +462 -0
- data/ext/libuv/test/benchmark-sizes.c +44 -0
- data/ext/libuv/test/benchmark-spawn.c +162 -0
- data/ext/libuv/test/benchmark-tcp-write-batch.c +140 -0
- data/ext/libuv/test/benchmark-thread.c +64 -0
- data/ext/libuv/test/benchmark-udp-packet-storm.c +247 -0
- data/ext/libuv/test/blackhole-server.c +118 -0
- data/ext/libuv/test/dns-server.c +321 -0
- data/ext/libuv/test/echo-server.c +378 -0
- data/ext/libuv/test/fixtures/empty_file +0 -0
- data/ext/libuv/test/fixtures/load_error.node +1 -0
- data/ext/libuv/test/run-benchmarks.c +64 -0
- data/ext/libuv/test/run-tests.c +138 -0
- data/ext/libuv/test/runner-unix.c +295 -0
- data/ext/libuv/test/runner-unix.h +36 -0
- data/ext/libuv/test/runner-win.c +285 -0
- data/ext/libuv/test/runner-win.h +42 -0
- data/ext/libuv/test/runner.c +355 -0
- data/ext/libuv/test/runner.h +159 -0
- data/ext/libuv/test/task.h +112 -0
- data/ext/libuv/test/test-async.c +118 -0
- data/ext/libuv/test/test-callback-order.c +76 -0
- data/ext/libuv/test/test-callback-stack.c +203 -0
- data/ext/libuv/test/test-connection-fail.c +148 -0
- data/ext/libuv/test/test-cwd-and-chdir.c +64 -0
- data/ext/libuv/test/test-delayed-accept.c +188 -0
- data/ext/libuv/test/test-dlerror.c +58 -0
- data/ext/libuv/test/test-error.c +59 -0
- data/ext/libuv/test/test-fail-always.c +29 -0
- data/ext/libuv/test/test-fs-event.c +474 -0
- data/ext/libuv/test/test-fs-poll.c +146 -0
- data/ext/libuv/test/test-fs.c +1843 -0
- data/ext/libuv/test/test-get-currentexe.c +63 -0
- data/ext/libuv/test/test-get-loadavg.c +36 -0
- data/ext/libuv/test/test-get-memory.c +38 -0
- data/ext/libuv/test/test-getaddrinfo.c +122 -0
- data/ext/libuv/test/test-getsockname.c +342 -0
- data/ext/libuv/test/test-hrtime.c +54 -0
- data/ext/libuv/test/test-idle.c +81 -0
- data/ext/libuv/test/test-ipc-send-recv.c +209 -0
- data/ext/libuv/test/test-ipc.c +620 -0
- data/ext/libuv/test/test-list.h +427 -0
- data/ext/libuv/test/test-loop-handles.c +336 -0
- data/ext/libuv/test/test-multiple-listen.c +102 -0
- data/ext/libuv/test/test-mutexes.c +63 -0
- data/ext/libuv/test/test-pass-always.c +28 -0
- data/ext/libuv/test/test-ping-pong.c +253 -0
- data/ext/libuv/test/test-pipe-bind-error.c +140 -0
- data/ext/libuv/test/test-pipe-connect-error.c +96 -0
- data/ext/libuv/test/test-platform-output.c +87 -0
- data/ext/libuv/test/test-poll-close.c +72 -0
- data/ext/libuv/test/test-poll.c +573 -0
- data/ext/libuv/test/test-process-title.c +49 -0
- data/ext/libuv/test/test-ref.c +338 -0
- data/ext/libuv/test/test-run-once.c +48 -0
- data/ext/libuv/test/test-semaphore.c +111 -0
- data/ext/libuv/test/test-shutdown-close.c +103 -0
- data/ext/libuv/test/test-shutdown-eof.c +183 -0
- data/ext/libuv/test/test-signal.c +162 -0
- data/ext/libuv/test/test-spawn.c +863 -0
- data/ext/libuv/test/test-stdio-over-pipes.c +246 -0
- data/ext/libuv/test/test-tcp-bind-error.c +191 -0
- data/ext/libuv/test/test-tcp-bind6-error.c +154 -0
- data/ext/libuv/test/test-tcp-close-while-connecting.c +80 -0
- data/ext/libuv/test/test-tcp-close.c +129 -0
- data/ext/libuv/test/test-tcp-connect-error-after-write.c +95 -0
- data/ext/libuv/test/test-tcp-connect-error.c +70 -0
- data/ext/libuv/test/test-tcp-connect-timeout.c +85 -0
- data/ext/libuv/test/test-tcp-connect6-error.c +68 -0
- data/ext/libuv/test/test-tcp-flags.c +51 -0
- data/ext/libuv/test/test-tcp-shutdown-after-write.c +131 -0
- data/ext/libuv/test/test-tcp-unexpected-read.c +113 -0
- data/ext/libuv/test/test-tcp-write-error.c +168 -0
- data/ext/libuv/test/test-tcp-write-to-half-open-connection.c +135 -0
- data/ext/libuv/test/test-tcp-writealot.c +170 -0
- data/ext/libuv/test/test-thread.c +183 -0
- data/ext/libuv/test/test-threadpool.c +57 -0
- data/ext/libuv/test/test-timer-again.c +141 -0
- data/ext/libuv/test/test-timer.c +152 -0
- data/ext/libuv/test/test-tty.c +110 -0
- data/ext/libuv/test/test-udp-dgram-too-big.c +86 -0
- data/ext/libuv/test/test-udp-ipv6.c +156 -0
- data/ext/libuv/test/test-udp-multicast-join.c +139 -0
- data/ext/libuv/test/test-udp-multicast-ttl.c +86 -0
- data/ext/libuv/test/test-udp-options.c +86 -0
- data/ext/libuv/test/test-udp-send-and-recv.c +208 -0
- data/ext/libuv/test/test-util.c +97 -0
- data/ext/libuv/test/test-walk-handles.c +77 -0
- data/ext/libuv/uv.gyp +375 -0
- data/ext/libuv/vcbuild.bat +105 -0
- data/foolio.gemspec +18 -0
- data/lib/foolio.rb +9 -0
- data/lib/foolio/handle.rb +27 -0
- data/lib/foolio/listener.rb +26 -0
- data/lib/foolio/loop.rb +79 -0
- data/lib/foolio/stream.rb +109 -0
- data/lib/foolio/version.rb +3 -0
- metadata +309 -0
@@ -0,0 +1,58 @@
|
|
1
|
+
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to
|
5
|
+
* deal in the Software without restriction, including without limitation the
|
6
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
18
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
19
|
+
* IN THE SOFTWARE.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "uv.h"
|
23
|
+
#include "task.h"
|
24
|
+
#include <string.h>
|
25
|
+
|
26
|
+
|
27
|
+
TEST_IMPL(dlerror) {
|
28
|
+
const char* path = "test/fixtures/load_error.node";
|
29
|
+
const char* msg;
|
30
|
+
uv_lib_t lib;
|
31
|
+
int r;
|
32
|
+
|
33
|
+
#ifdef __linux__
|
34
|
+
const char* dlerror_desc = "file too short";
|
35
|
+
#elif defined (__sun__)
|
36
|
+
const char* dlerror_desc = "unknown file type";
|
37
|
+
#elif defined (_WIN32)
|
38
|
+
const char* dlerror_desc = "%1 is not a valid Win32 application";
|
39
|
+
#else
|
40
|
+
const char* dlerror_desc = "";
|
41
|
+
#endif
|
42
|
+
|
43
|
+
r = uv_dlopen(path, &lib);
|
44
|
+
ASSERT(r == -1);
|
45
|
+
|
46
|
+
msg = uv_dlerror(&lib);
|
47
|
+
ASSERT(msg != NULL);
|
48
|
+
ASSERT(strstr(msg, dlerror_desc) != NULL);
|
49
|
+
|
50
|
+
/* Should return the same error twice in a row. */
|
51
|
+
msg = uv_dlerror(&lib);
|
52
|
+
ASSERT(msg != NULL);
|
53
|
+
ASSERT(strstr(msg, dlerror_desc) != NULL);
|
54
|
+
|
55
|
+
uv_dlclose(&lib);
|
56
|
+
|
57
|
+
return 0;
|
58
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to
|
5
|
+
* deal in the Software without restriction, including without limitation the
|
6
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
18
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
19
|
+
* IN THE SOFTWARE.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "uv.h"
|
23
|
+
#include "task.h"
|
24
|
+
|
25
|
+
#include <stdio.h>
|
26
|
+
#include <stdlib.h>
|
27
|
+
#include <string.h>
|
28
|
+
|
29
|
+
|
30
|
+
/*
|
31
|
+
* Synthetic errors (errors that originate from within libuv, not the system)
|
32
|
+
* should produce sensible error messages when run through uv_strerror().
|
33
|
+
*
|
34
|
+
* See https://github.com/joyent/libuv/issues/210
|
35
|
+
*/
|
36
|
+
TEST_IMPL(error_message) {
|
37
|
+
uv_err_t e;
|
38
|
+
|
39
|
+
/* Cop out. Can't do proper checks on systems with
|
40
|
+
* i18n-ized error messages...
|
41
|
+
*/
|
42
|
+
e.code = 0, e.sys_errno_ = 0;
|
43
|
+
|
44
|
+
if (strcmp(uv_strerror(e), "Success") != 0) {
|
45
|
+
printf("i18n error messages detected, skipping test.\n");
|
46
|
+
return 0;
|
47
|
+
}
|
48
|
+
|
49
|
+
e.code = UV_EINVAL, e.sys_errno_ = 0;
|
50
|
+
ASSERT(strstr(uv_strerror(e), "Success") == NULL);
|
51
|
+
|
52
|
+
e.code = UV_UNKNOWN, e.sys_errno_ = 0;
|
53
|
+
ASSERT(strcmp(uv_strerror(e), "Unknown error") == 0);
|
54
|
+
|
55
|
+
e.code = 1337, e.sys_errno_ = 0;
|
56
|
+
ASSERT(strcmp(uv_strerror(e), "Unknown error") == 0);
|
57
|
+
|
58
|
+
return 0;
|
59
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to
|
5
|
+
* deal in the Software without restriction, including without limitation the
|
6
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
18
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
19
|
+
* IN THE SOFTWARE.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "task.h"
|
23
|
+
|
24
|
+
|
25
|
+
TEST_IMPL(fail_always) {
|
26
|
+
/* This test always fails. It is used to test the test runner. */
|
27
|
+
FATAL("Yes, it always fails");
|
28
|
+
return 2;
|
29
|
+
}
|
@@ -0,0 +1,474 @@
|
|
1
|
+
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to
|
5
|
+
* deal in the Software without restriction, including without limitation the
|
6
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
18
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
19
|
+
* IN THE SOFTWARE.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "uv.h"
|
23
|
+
#include "task.h"
|
24
|
+
|
25
|
+
#include <string.h>
|
26
|
+
#include <fcntl.h>
|
27
|
+
|
28
|
+
#ifndef HAVE_KQUEUE
|
29
|
+
# if __APPLE__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__
|
30
|
+
# define HAVE_KQUEUE 1
|
31
|
+
# endif
|
32
|
+
#endif
|
33
|
+
|
34
|
+
static uv_fs_event_t fs_event;
|
35
|
+
static uv_timer_t timer;
|
36
|
+
static int timer_cb_called = 0;
|
37
|
+
static int close_cb_called = 0;
|
38
|
+
static int fs_event_cb_called = 0;
|
39
|
+
static int timer_cb_touch_called = 0;
|
40
|
+
|
41
|
+
static void create_dir(uv_loop_t* loop, const char* name) {
|
42
|
+
int r;
|
43
|
+
uv_fs_t req;
|
44
|
+
r = uv_fs_mkdir(loop, &req, name, 0755, NULL);
|
45
|
+
ASSERT(r == 0 || uv_last_error(loop).code == UV_EEXIST);
|
46
|
+
uv_fs_req_cleanup(&req);
|
47
|
+
}
|
48
|
+
|
49
|
+
static void create_file(uv_loop_t* loop, const char* name) {
|
50
|
+
int r;
|
51
|
+
uv_file file;
|
52
|
+
uv_fs_t req;
|
53
|
+
|
54
|
+
r = uv_fs_open(loop, &req, name, O_WRONLY | O_CREAT,
|
55
|
+
S_IWRITE | S_IREAD, NULL);
|
56
|
+
ASSERT(r != -1);
|
57
|
+
file = r;
|
58
|
+
uv_fs_req_cleanup(&req);
|
59
|
+
r = uv_fs_close(loop, &req, file, NULL);
|
60
|
+
ASSERT(r == 0);
|
61
|
+
uv_fs_req_cleanup(&req);
|
62
|
+
}
|
63
|
+
|
64
|
+
static void touch_file(uv_loop_t* loop, const char* name) {
|
65
|
+
int r;
|
66
|
+
uv_file file;
|
67
|
+
uv_fs_t req;
|
68
|
+
|
69
|
+
r = uv_fs_open(loop, &req, name, O_RDWR, 0, NULL);
|
70
|
+
ASSERT(r != -1);
|
71
|
+
file = r;
|
72
|
+
uv_fs_req_cleanup(&req);
|
73
|
+
|
74
|
+
r = uv_fs_write(loop, &req, file, "foo", 4, -1, NULL);
|
75
|
+
ASSERT(r != -1);
|
76
|
+
uv_fs_req_cleanup(&req);
|
77
|
+
|
78
|
+
r = uv_fs_close(loop, &req, file, NULL);
|
79
|
+
ASSERT(r != -1);
|
80
|
+
uv_fs_req_cleanup(&req);
|
81
|
+
}
|
82
|
+
|
83
|
+
static void close_cb(uv_handle_t* handle) {
|
84
|
+
ASSERT(handle != NULL);
|
85
|
+
close_cb_called++;
|
86
|
+
}
|
87
|
+
|
88
|
+
static void fail_cb(uv_fs_event_t* handle,
|
89
|
+
const char* path,
|
90
|
+
int events,
|
91
|
+
int status) {
|
92
|
+
ASSERT(0 && "fail_cb called");
|
93
|
+
}
|
94
|
+
|
95
|
+
static void fs_event_cb_dir(uv_fs_event_t* handle, const char* filename,
|
96
|
+
int events, int status) {
|
97
|
+
++fs_event_cb_called;
|
98
|
+
ASSERT(handle == &fs_event);
|
99
|
+
ASSERT(status == 0);
|
100
|
+
ASSERT(events == UV_RENAME);
|
101
|
+
ASSERT(filename == NULL || strcmp(filename, "file1") == 0);
|
102
|
+
uv_close((uv_handle_t*)handle, close_cb);
|
103
|
+
}
|
104
|
+
|
105
|
+
static void fs_event_cb_file(uv_fs_event_t* handle, const char* filename,
|
106
|
+
int events, int status) {
|
107
|
+
++fs_event_cb_called;
|
108
|
+
ASSERT(handle == &fs_event);
|
109
|
+
ASSERT(status == 0);
|
110
|
+
ASSERT(events == UV_CHANGE);
|
111
|
+
ASSERT(filename == NULL || strcmp(filename, "file2") == 0);
|
112
|
+
uv_close((uv_handle_t*)handle, close_cb);
|
113
|
+
}
|
114
|
+
|
115
|
+
static void timber_cb_close_handle(uv_timer_t* timer, int status) {
|
116
|
+
uv_handle_t* handle;
|
117
|
+
|
118
|
+
ASSERT(timer != NULL);
|
119
|
+
ASSERT(status == 0);
|
120
|
+
handle = timer->data;
|
121
|
+
|
122
|
+
uv_close((uv_handle_t*)timer, NULL);
|
123
|
+
uv_close((uv_handle_t*)handle, close_cb);
|
124
|
+
}
|
125
|
+
|
126
|
+
static void fs_event_cb_file_current_dir(uv_fs_event_t* handle,
|
127
|
+
const char* filename, int events, int status) {
|
128
|
+
ASSERT(fs_event_cb_called == 0);
|
129
|
+
++fs_event_cb_called;
|
130
|
+
|
131
|
+
ASSERT(handle == &fs_event);
|
132
|
+
ASSERT(status == 0);
|
133
|
+
ASSERT(events == UV_CHANGE);
|
134
|
+
ASSERT(filename == NULL || strcmp(filename, "watch_file") == 0);
|
135
|
+
|
136
|
+
/* Regression test for SunOS: touch should generate just one event. */
|
137
|
+
{
|
138
|
+
static uv_timer_t timer;
|
139
|
+
uv_timer_init(handle->loop, &timer);
|
140
|
+
timer.data = handle;
|
141
|
+
uv_timer_start(&timer, timber_cb_close_handle, 250, 0);
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
145
|
+
static void timer_cb_dir(uv_timer_t* handle, int status) {
|
146
|
+
++timer_cb_called;
|
147
|
+
create_file(handle->loop, "watch_dir/file1");
|
148
|
+
uv_close((uv_handle_t*)handle, close_cb);
|
149
|
+
}
|
150
|
+
|
151
|
+
static void timer_cb_file(uv_timer_t* handle, int status) {
|
152
|
+
++timer_cb_called;
|
153
|
+
|
154
|
+
if (timer_cb_called == 1) {
|
155
|
+
touch_file(handle->loop, "watch_dir/file1");
|
156
|
+
} else {
|
157
|
+
touch_file(handle->loop, "watch_dir/file2");
|
158
|
+
uv_close((uv_handle_t*)handle, close_cb);
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
static void timer_cb_touch(uv_timer_t* timer, int status) {
|
163
|
+
ASSERT(status == 0);
|
164
|
+
uv_close((uv_handle_t*)timer, NULL);
|
165
|
+
touch_file(timer->loop, "watch_file");
|
166
|
+
timer_cb_touch_called++;
|
167
|
+
}
|
168
|
+
|
169
|
+
static void timer_cb_watch_twice(uv_timer_t* handle, int status) {
|
170
|
+
uv_fs_event_t* handles = handle->data;
|
171
|
+
uv_close((uv_handle_t*) (handles + 0), NULL);
|
172
|
+
uv_close((uv_handle_t*) (handles + 1), NULL);
|
173
|
+
uv_close((uv_handle_t*) handle, NULL);
|
174
|
+
}
|
175
|
+
|
176
|
+
TEST_IMPL(fs_event_watch_dir) {
|
177
|
+
uv_fs_t fs_req;
|
178
|
+
uv_loop_t* loop = uv_default_loop();
|
179
|
+
int r;
|
180
|
+
|
181
|
+
/* Setup */
|
182
|
+
uv_fs_unlink(loop, &fs_req, "watch_dir/file1", NULL);
|
183
|
+
uv_fs_unlink(loop, &fs_req, "watch_dir/file2", NULL);
|
184
|
+
uv_fs_rmdir(loop, &fs_req, "watch_dir", NULL);
|
185
|
+
create_dir(loop, "watch_dir");
|
186
|
+
|
187
|
+
r = uv_fs_event_init(loop, &fs_event, "watch_dir", fs_event_cb_dir, 0);
|
188
|
+
ASSERT(r != -1);
|
189
|
+
r = uv_timer_init(loop, &timer);
|
190
|
+
ASSERT(r != -1);
|
191
|
+
r = uv_timer_start(&timer, timer_cb_dir, 100, 0);
|
192
|
+
ASSERT(r != -1);
|
193
|
+
|
194
|
+
uv_run(loop);
|
195
|
+
|
196
|
+
ASSERT(fs_event_cb_called == 1);
|
197
|
+
ASSERT(timer_cb_called == 1);
|
198
|
+
ASSERT(close_cb_called == 2);
|
199
|
+
|
200
|
+
/* Cleanup */
|
201
|
+
r = uv_fs_unlink(loop, &fs_req, "watch_dir/file1", NULL);
|
202
|
+
r = uv_fs_unlink(loop, &fs_req, "watch_dir/file2", NULL);
|
203
|
+
r = uv_fs_rmdir(loop, &fs_req, "watch_dir", NULL);
|
204
|
+
|
205
|
+
return 0;
|
206
|
+
}
|
207
|
+
|
208
|
+
TEST_IMPL(fs_event_watch_file) {
|
209
|
+
uv_fs_t fs_req;
|
210
|
+
uv_loop_t* loop = uv_default_loop();
|
211
|
+
int r;
|
212
|
+
|
213
|
+
/* Setup */
|
214
|
+
uv_fs_unlink(loop, &fs_req, "watch_dir/file1", NULL);
|
215
|
+
uv_fs_unlink(loop, &fs_req, "watch_dir/file2", NULL);
|
216
|
+
uv_fs_rmdir(loop, &fs_req, "watch_dir", NULL);
|
217
|
+
create_dir(loop, "watch_dir");
|
218
|
+
create_file(loop, "watch_dir/file1");
|
219
|
+
create_file(loop, "watch_dir/file2");
|
220
|
+
|
221
|
+
r = uv_fs_event_init(loop, &fs_event, "watch_dir/file2", fs_event_cb_file, 0);
|
222
|
+
ASSERT(r != -1);
|
223
|
+
r = uv_timer_init(loop, &timer);
|
224
|
+
ASSERT(r != -1);
|
225
|
+
r = uv_timer_start(&timer, timer_cb_file, 100, 100);
|
226
|
+
ASSERT(r != -1);
|
227
|
+
|
228
|
+
uv_run(loop);
|
229
|
+
|
230
|
+
ASSERT(fs_event_cb_called == 1);
|
231
|
+
ASSERT(timer_cb_called == 2);
|
232
|
+
ASSERT(close_cb_called == 2);
|
233
|
+
|
234
|
+
/* Cleanup */
|
235
|
+
r = uv_fs_unlink(loop, &fs_req, "watch_dir/file1", NULL);
|
236
|
+
r = uv_fs_unlink(loop, &fs_req, "watch_dir/file2", NULL);
|
237
|
+
r = uv_fs_rmdir(loop, &fs_req, "watch_dir", NULL);
|
238
|
+
|
239
|
+
return 0;
|
240
|
+
}
|
241
|
+
|
242
|
+
TEST_IMPL(fs_event_watch_file_twice) {
|
243
|
+
const char path[] = "test/fixtures/empty_file";
|
244
|
+
uv_fs_event_t watchers[2];
|
245
|
+
uv_timer_t timer;
|
246
|
+
uv_loop_t* loop;
|
247
|
+
|
248
|
+
loop = uv_default_loop();
|
249
|
+
timer.data = watchers;
|
250
|
+
|
251
|
+
ASSERT(0 == uv_fs_event_init(loop, watchers + 0, path, fail_cb, 0));
|
252
|
+
ASSERT(0 == uv_fs_event_init(loop, watchers + 1, path, fail_cb, 0));
|
253
|
+
ASSERT(0 == uv_timer_init(loop, &timer));
|
254
|
+
ASSERT(0 == uv_timer_start(&timer, timer_cb_watch_twice, 10, 0));
|
255
|
+
ASSERT(0 == uv_run(loop));
|
256
|
+
|
257
|
+
return 0;
|
258
|
+
}
|
259
|
+
|
260
|
+
TEST_IMPL(fs_event_watch_file_current_dir) {
|
261
|
+
uv_timer_t timer;
|
262
|
+
uv_loop_t* loop;
|
263
|
+
uv_fs_t fs_req;
|
264
|
+
int r;
|
265
|
+
|
266
|
+
loop = uv_default_loop();
|
267
|
+
|
268
|
+
/* Setup */
|
269
|
+
uv_fs_unlink(loop, &fs_req, "watch_file", NULL);
|
270
|
+
create_file(loop, "watch_file");
|
271
|
+
|
272
|
+
r = uv_fs_event_init(loop, &fs_event, "watch_file",
|
273
|
+
fs_event_cb_file_current_dir, 0);
|
274
|
+
ASSERT(r != -1);
|
275
|
+
|
276
|
+
r = uv_timer_init(loop, &timer);
|
277
|
+
ASSERT(r == 0);
|
278
|
+
|
279
|
+
r = uv_timer_start(&timer, timer_cb_touch, 1, 0);
|
280
|
+
ASSERT(r == 0);
|
281
|
+
|
282
|
+
ASSERT(timer_cb_touch_called == 0);
|
283
|
+
ASSERT(fs_event_cb_called == 0);
|
284
|
+
ASSERT(close_cb_called == 0);
|
285
|
+
|
286
|
+
uv_run(loop);
|
287
|
+
|
288
|
+
ASSERT(timer_cb_touch_called == 1);
|
289
|
+
ASSERT(fs_event_cb_called == 1);
|
290
|
+
ASSERT(close_cb_called == 1);
|
291
|
+
|
292
|
+
/* Cleanup */
|
293
|
+
r = uv_fs_unlink(loop, &fs_req, "watch_file", NULL);
|
294
|
+
return 0;
|
295
|
+
}
|
296
|
+
|
297
|
+
|
298
|
+
TEST_IMPL(fs_event_no_callback_on_close) {
|
299
|
+
uv_fs_t fs_req;
|
300
|
+
uv_loop_t* loop = uv_default_loop();
|
301
|
+
int r;
|
302
|
+
|
303
|
+
/* Setup */
|
304
|
+
uv_fs_unlink(loop, &fs_req, "watch_dir/file1", NULL);
|
305
|
+
uv_fs_rmdir(loop, &fs_req, "watch_dir", NULL);
|
306
|
+
create_dir(loop, "watch_dir");
|
307
|
+
create_file(loop, "watch_dir/file1");
|
308
|
+
|
309
|
+
r = uv_fs_event_init(loop,
|
310
|
+
&fs_event,
|
311
|
+
"watch_dir/file1",
|
312
|
+
fs_event_cb_file,
|
313
|
+
0);
|
314
|
+
ASSERT(r != -1);
|
315
|
+
|
316
|
+
uv_close((uv_handle_t*)&fs_event, close_cb);
|
317
|
+
|
318
|
+
uv_run(loop);
|
319
|
+
|
320
|
+
ASSERT(fs_event_cb_called == 0);
|
321
|
+
ASSERT(close_cb_called == 1);
|
322
|
+
|
323
|
+
/* Cleanup */
|
324
|
+
r = uv_fs_unlink(loop, &fs_req, "watch_dir/file1", NULL);
|
325
|
+
r = uv_fs_rmdir(loop, &fs_req, "watch_dir", NULL);
|
326
|
+
|
327
|
+
return 0;
|
328
|
+
}
|
329
|
+
|
330
|
+
|
331
|
+
static void fs_event_fail(uv_fs_event_t* handle, const char* filename,
|
332
|
+
int events, int status) {
|
333
|
+
ASSERT(0 && "should never be called");
|
334
|
+
}
|
335
|
+
|
336
|
+
|
337
|
+
static void timer_cb(uv_timer_t* handle, int status) {
|
338
|
+
int r;
|
339
|
+
|
340
|
+
ASSERT(status == 0);
|
341
|
+
|
342
|
+
r = uv_fs_event_init(handle->loop, &fs_event, ".", fs_event_fail, 0);
|
343
|
+
ASSERT(r == 0);
|
344
|
+
|
345
|
+
uv_close((uv_handle_t*)&fs_event, close_cb);
|
346
|
+
uv_close((uv_handle_t*)handle, close_cb);
|
347
|
+
}
|
348
|
+
|
349
|
+
|
350
|
+
TEST_IMPL(fs_event_immediate_close) {
|
351
|
+
uv_timer_t timer;
|
352
|
+
uv_loop_t* loop;
|
353
|
+
int r;
|
354
|
+
|
355
|
+
loop = uv_default_loop();
|
356
|
+
|
357
|
+
r = uv_timer_init(loop, &timer);
|
358
|
+
ASSERT(r == 0);
|
359
|
+
|
360
|
+
r = uv_timer_start(&timer, timer_cb, 1, 0);
|
361
|
+
ASSERT(r == 0);
|
362
|
+
|
363
|
+
uv_run(loop);
|
364
|
+
|
365
|
+
ASSERT(close_cb_called == 2);
|
366
|
+
|
367
|
+
return 0;
|
368
|
+
}
|
369
|
+
|
370
|
+
|
371
|
+
TEST_IMPL(fs_event_close_with_pending_event) {
|
372
|
+
uv_loop_t* loop;
|
373
|
+
uv_fs_t fs_req;
|
374
|
+
int r;
|
375
|
+
|
376
|
+
loop = uv_default_loop();
|
377
|
+
|
378
|
+
create_dir(loop, "watch_dir");
|
379
|
+
create_file(loop, "watch_dir/file");
|
380
|
+
|
381
|
+
r = uv_fs_event_init(loop, &fs_event, "watch_dir", fs_event_fail, 0);
|
382
|
+
ASSERT(r == 0);
|
383
|
+
|
384
|
+
/* Generate an fs event. */
|
385
|
+
touch_file(loop, "watch_dir/file");
|
386
|
+
|
387
|
+
uv_close((uv_handle_t*)&fs_event, close_cb);
|
388
|
+
|
389
|
+
uv_run(loop);
|
390
|
+
|
391
|
+
ASSERT(close_cb_called == 1);
|
392
|
+
|
393
|
+
/* Clean up */
|
394
|
+
r = uv_fs_unlink(loop, &fs_req, "watch_dir/file", NULL);
|
395
|
+
ASSERT(r == 0);
|
396
|
+
r = uv_fs_rmdir(loop, &fs_req, "watch_dir", NULL);
|
397
|
+
ASSERT(r == 0);
|
398
|
+
|
399
|
+
return 0;
|
400
|
+
}
|
401
|
+
|
402
|
+
#if HAVE_KQUEUE
|
403
|
+
|
404
|
+
/* kqueue doesn't register fs events if you don't have an active watcher.
|
405
|
+
* The file descriptor needs to be part of the kqueue set of interest and
|
406
|
+
* that's not the case until we actually enter the event loop.
|
407
|
+
*/
|
408
|
+
TEST_IMPL(fs_event_close_in_callback) {
|
409
|
+
fprintf(stderr, "Skipping test, doesn't work with kqueue.\n");
|
410
|
+
return 0;
|
411
|
+
}
|
412
|
+
|
413
|
+
#else /* !HAVE_KQUEUE */
|
414
|
+
|
415
|
+
static void fs_event_cb_close(uv_fs_event_t* handle, const char* filename,
|
416
|
+
int events, int status) {
|
417
|
+
ASSERT(status == 0);
|
418
|
+
|
419
|
+
ASSERT(fs_event_cb_called < 3);
|
420
|
+
++fs_event_cb_called;
|
421
|
+
|
422
|
+
if (fs_event_cb_called == 3) {
|
423
|
+
uv_close((uv_handle_t*) handle, close_cb);
|
424
|
+
}
|
425
|
+
}
|
426
|
+
|
427
|
+
|
428
|
+
TEST_IMPL(fs_event_close_in_callback) {
|
429
|
+
uv_loop_t* loop;
|
430
|
+
uv_fs_t fs_req;
|
431
|
+
int r;
|
432
|
+
|
433
|
+
loop = uv_default_loop();
|
434
|
+
|
435
|
+
create_dir(loop, "watch_dir");
|
436
|
+
create_file(loop, "watch_dir/file1");
|
437
|
+
create_file(loop, "watch_dir/file2");
|
438
|
+
create_file(loop, "watch_dir/file3");
|
439
|
+
create_file(loop, "watch_dir/file4");
|
440
|
+
create_file(loop, "watch_dir/file5");
|
441
|
+
|
442
|
+
r = uv_fs_event_init(loop, &fs_event, "watch_dir", fs_event_cb_close, 0);
|
443
|
+
ASSERT(r == 0);
|
444
|
+
|
445
|
+
/* Generate a couple of fs events. */
|
446
|
+
touch_file(loop, "watch_dir/file1");
|
447
|
+
touch_file(loop, "watch_dir/file2");
|
448
|
+
touch_file(loop, "watch_dir/file3");
|
449
|
+
touch_file(loop, "watch_dir/file4");
|
450
|
+
touch_file(loop, "watch_dir/file5");
|
451
|
+
|
452
|
+
uv_run(loop);
|
453
|
+
|
454
|
+
ASSERT(close_cb_called == 1);
|
455
|
+
ASSERT(fs_event_cb_called == 3);
|
456
|
+
|
457
|
+
/* Clean up */
|
458
|
+
r = uv_fs_unlink(loop, &fs_req, "watch_dir/file1", NULL);
|
459
|
+
ASSERT(r == 0);
|
460
|
+
r = uv_fs_unlink(loop, &fs_req, "watch_dir/file2", NULL);
|
461
|
+
ASSERT(r == 0);
|
462
|
+
r = uv_fs_unlink(loop, &fs_req, "watch_dir/file3", NULL);
|
463
|
+
ASSERT(r == 0);
|
464
|
+
r = uv_fs_unlink(loop, &fs_req, "watch_dir/file4", NULL);
|
465
|
+
ASSERT(r == 0);
|
466
|
+
r = uv_fs_unlink(loop, &fs_req, "watch_dir/file5", NULL);
|
467
|
+
ASSERT(r == 0);
|
468
|
+
r = uv_fs_rmdir(loop, &fs_req, "watch_dir", NULL);
|
469
|
+
ASSERT(r == 0);
|
470
|
+
|
471
|
+
return 0;
|
472
|
+
}
|
473
|
+
|
474
|
+
#endif /* HAVE_KQUEUE */
|