commit ccf9b895995a2f433b160f22823af26114a6cc8b Author: Peter Rosin Date: Wed Dec 2 14:22:59 2009 +0100 msvcrt: Add test to check if signal(SIGBREAK, ...) works (todo_wine). --- AUTHORS | 1 + dlls/msvcrt/tests/Makefile.in | 1 + dlls/msvcrt/tests/signal.c | 50 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 0 deletions(-) diff --git a/AUTHORS b/AUTHORS index 20b15d6..d01e12b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -895,6 +895,7 @@ Drew Ronneberg Stephan Rose Andreas Rosenberg Bernhard Rosenkraenzer +Peter Rosin Pavel Roskin Herbert Rosmanith Elias Ross diff --git a/dlls/msvcrt/tests/Makefile.in b/dlls/msvcrt/tests/Makefile.in index 74199e1..d0486d1 100644 --- a/dlls/msvcrt/tests/Makefile.in +++ b/dlls/msvcrt/tests/Makefile.in @@ -18,6 +18,7 @@ CTESTS = \ heap.c \ printf.c \ scanf.c \ + signal.c \ string.c \ time.c diff --git a/dlls/msvcrt/tests/signal.c b/dlls/msvcrt/tests/signal.c new file mode 100644 index 0000000..b871a85 --- /dev/null +++ b/dlls/msvcrt/tests/signal.c @@ -0,0 +1,50 @@ +/* + * Unit test suite for signal function. + * + * Copyright 2009 Peter Rosin + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "wine/test.h" +#include +#include + +static int test_value = 0; + +typedef void (sighandler_type)(int); + +static void sighandler(int signum) +{ + ++test_value; +} + +static void test_signal(void) +{ + sighandler_type *old; + int res; + + old = signal(SIGBREAK, sighandler); + todo_wine ok(old != SIG_ERR, "Failed to install signal handler for SIGBREAK\n"); + test_value = 0; + res = raise(SIGBREAK); + todo_wine ok(res == 0, "Failed to raise SIGBREAK\n"); + todo_wine ok(test_value == 1, "SIGBREAK handler not invoked\n"); +} + +START_TEST(signal) +{ + test_signal(); +}