summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/libuv/test/test-signal.c
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-10-07 14:14:08 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-10-07 14:14:08 +0200
commit85f4741fcf642f52ac4fa56f0aff1728727c901b (patch)
treeda8cca02913839152d2eb04c0e85a83018bcaed3 /3rdparty/libuv/test/test-signal.c
parentff01b716711b97c2fcaa709ea97f7650f106aa10 (diff)
Remove libuv library (nw)
Diffstat (limited to '3rdparty/libuv/test/test-signal.c')
-rw-r--r--3rdparty/libuv/test/test-signal.c152
1 files changed, 0 insertions, 152 deletions
diff --git a/3rdparty/libuv/test/test-signal.c b/3rdparty/libuv/test/test-signal.c
deleted file mode 100644
index fcdd8e4d2dd..00000000000
--- a/3rdparty/libuv/test/test-signal.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-
-/* This test does not pretend to be cross-platform. */
-#ifndef _WIN32
-
-#include "uv.h"
-#include "task.h"
-
-#include <errno.h>
-#include <signal.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define NSIGNALS 10
-
-struct timer_ctx {
- unsigned int ncalls;
- uv_timer_t handle;
- int signum;
-};
-
-struct signal_ctx {
- enum { CLOSE, STOP } stop_or_close;
- unsigned int ncalls;
- uv_signal_t handle;
- int signum;
-};
-
-
-static void signal_cb(uv_signal_t* handle, int signum) {
- struct signal_ctx* ctx = container_of(handle, struct signal_ctx, handle);
- ASSERT(signum == ctx->signum);
-
- if (++ctx->ncalls == NSIGNALS) {
- if (ctx->stop_or_close == STOP)
- uv_signal_stop(handle);
- else if (ctx->stop_or_close == CLOSE)
- uv_close((uv_handle_t*)handle, NULL);
- else
- ASSERT(0);
- }
-}
-
-
-static void timer_cb(uv_timer_t* handle) {
- struct timer_ctx* ctx = container_of(handle, struct timer_ctx, handle);
-
- raise(ctx->signum);
-
- if (++ctx->ncalls == NSIGNALS)
- uv_close((uv_handle_t*)handle, NULL);
-}
-
-
-static void start_watcher(uv_loop_t* loop, int signum, struct signal_ctx* ctx) {
- ctx->ncalls = 0;
- ctx->signum = signum;
- ctx->stop_or_close = CLOSE;
- ASSERT(0 == uv_signal_init(loop, &ctx->handle));
- ASSERT(0 == uv_signal_start(&ctx->handle, signal_cb, signum));
-}
-
-
-static void start_timer(uv_loop_t* loop, int signum, struct timer_ctx* ctx) {
- ctx->ncalls = 0;
- ctx->signum = signum;
- ASSERT(0 == uv_timer_init(loop, &ctx->handle));
- ASSERT(0 == uv_timer_start(&ctx->handle, timer_cb, 5, 5));
-}
-
-
-TEST_IMPL(we_get_signal) {
- struct signal_ctx sc;
- struct timer_ctx tc;
- uv_loop_t* loop;
-
- loop = uv_default_loop();
- start_timer(loop, SIGCHLD, &tc);
- start_watcher(loop, SIGCHLD, &sc);
- sc.stop_or_close = STOP; /* stop, don't close the signal handle */
- ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
- ASSERT(tc.ncalls == NSIGNALS);
- ASSERT(sc.ncalls == NSIGNALS);
-
- start_timer(loop, SIGCHLD, &tc);
- ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
- ASSERT(tc.ncalls == NSIGNALS);
- ASSERT(sc.ncalls == NSIGNALS);
-
- sc.ncalls = 0;
- sc.stop_or_close = CLOSE; /* now close it when it's done */
- uv_signal_start(&sc.handle, signal_cb, SIGCHLD);
-
- start_timer(loop, SIGCHLD, &tc);
- ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
- ASSERT(tc.ncalls == NSIGNALS);
- ASSERT(sc.ncalls == NSIGNALS);
-
- MAKE_VALGRIND_HAPPY();
- return 0;
-}
-
-
-TEST_IMPL(we_get_signals) {
- struct signal_ctx sc[4];
- struct timer_ctx tc[2];
- uv_loop_t* loop;
- unsigned int i;
-
- loop = uv_default_loop();
- start_watcher(loop, SIGUSR1, sc + 0);
- start_watcher(loop, SIGUSR1, sc + 1);
- start_watcher(loop, SIGUSR2, sc + 2);
- start_watcher(loop, SIGUSR2, sc + 3);
- start_timer(loop, SIGUSR1, tc + 0);
- start_timer(loop, SIGUSR2, tc + 1);
- ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
-
- for (i = 0; i < ARRAY_SIZE(sc); i++)
- ASSERT(sc[i].ncalls == NSIGNALS);
-
- for (i = 0; i < ARRAY_SIZE(tc); i++)
- ASSERT(tc[i].ncalls == NSIGNALS);
-
- MAKE_VALGRIND_HAPPY();
- return 0;
-}
-
-#endif /* _WIN32 */
subject'>Revert "machine type attribute added in the xml" Olivier Galibert3-19/+5 Too prone to abuse, we're afraid. This reverts commit 198c77327e08cb6f0dfa2183d6fa226f8908294d. 2015-05-29machine type attribute added in the xml k2-git3-5/+19 2015-05-29slight update to the previous commit (nw) Dirk Best1-3/+6 2015-05-29wd_fdc: after a force interrupt command, return status type 1 (fixes sam Dirk Best1-0/+3 coupe) 2015-05-29wd_fdc & super80: allow ENMF line to be switched. Robbbert2-2/+5 2015-05-29fix (nw) Miodrag Milanovic1-1/+1 2015-05-29correct credits -> license is covered hap2-4/+4 2015-05-29Fixes for Andreas Naive (nw) Miodrag Milanovic8-9/+9 2015-05-29wd_fdc: add support for the enmf (enable minifloppy) pin, which enables Dirk Best4-19/+67 an internal clock divider for some operations. updated microbee and pcd to take advantage of this, both systems now boot without patches. 2015-05-29camplynx: handle level9 adventures. Not working though due to banking issues. Robbbert1-18/+22 2015-05-29mbee: motor on always, to fix cp/m select error in the shell. Robbbert1-1/+5 2015-05-29namcos1.c: clean up audiocpu ROM loading/banking too (nw) Alex W. Jackson2-98/+98 2015-05-29namcos1.c: load MCU internal and external (voice) ROMs in separate regions (nw) Alex W. Jackson2-189/+265 2015-05-29fixed clang (nw) Miodrag Milanovic1-0/+1 2015-05-29namcos1.c: switched to configured banking, enabled save state support (nw) Ivan Vangelista2-47/+48 2015-05-29Fixed a compile error in MATE. Robbbert1-2/+2 2015-05-29Fixed the build. Robbbert2-3/+3 2015-05-28oops, forgot one Cowering1-0/+6 2015-05-28compile fixes for GCC5.1.1 win64 and CPP11 mode.. requested by mingw team to ↵ Cowering14-44/+70 test LTO fixes. please add #ifdefs if 64 bit printf does not work for you 2015-05-28Addition of commands and details as well as some reordering to match ↵ Scott Stone1-28/+53 -showusage output (nw) 2015-05-28Champion Super 2 & 3 games: Improved the internal layout to represent RobertoFresca2-18/+43 a realistic control panel, with clickable button-lamps and a coin in. Also added the missing BET MAX function to the HOLD 1 input/button. [Roberto Fresca] 2015-05-28We cannot relicense files for which we have not yet received responses (nw) balr0g276-283/+283 2015-05-28Added skeleton support for Windows Phone and Windows Store - far from ↵ Miodrag Milanovic3-1/+42 working(nw) 2015-05-28chsuper.c driver: Reworked all inputs and implemented full outputs RobertoFresca2-68/+406 from the scratch. Added DIP switches, DIP locations, extra input port present in the test mode, implemented coin counters and hopper out / ticket out signals, implemented full set of lamps and workaround for the possible Hold3 lamp line circuitry. Also added a nice control panel internal layout. Documented all ports properly and added some findings. Changed the CPU clock to 3 MHz to get the game more playable. Need to check against a real PCB. [Roberto Fresca] 2015-05-283rdparty.lua: add check for nil first (nw) Peter Ferrie1-1/+1 2015-05-28z80ne: updated to use the new wd fdc. remove custom dmk implementation Dirk Best6-874/+46 2015-05-28wd_fdc: changes to get z80ne booting (also fix cgenie fm mode) Dirk Best1-7/+21 - force interrupt is executed without delay - on receiving a command, immediately set busy - fix missing setting of ddm in fm mode 2015-05-28beta128: patch some TR-DOS bug so Pentagon and Scorpion works ok with FDD ↵ MetalliC3-4/+10 until wd_fdc cant handle this (nw)