Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

t_signal_fcns.c

Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 2005 by Kevin L. Mitchell <klmitch@mit.edu>
00003 **
00004 ** This program is free software; you can redistribute it and/or modify
00005 ** it under the terms of the GNU General Public License as published by
00006 ** the Free Software Foundation; either version 2 of the License, or
00007 ** (at your option) any later version.
00008 **
00009 ** This program is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 ** GNU General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU General Public License
00015 ** along with this program; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 **
00018 ** @(#)$Id: t_signal_fcns.c,v 1.1 2005/09/15 18:14:11 klmitch Exp $
00019 */
00028 #include "event-test.h"
00029 
00030 #include <signal.h>
00031 
00032 RCSTAG("@(#)$Id: t_signal_fcns.c,v 1.1 2005/09/15 18:14:11 klmitch Exp $");
00033 
00034 TEST_PROG(t_signal_fcns, "Test operation of signal manipulation functions")
00035      TEST_ARG(t_signal_fcns, "<event-test.tc>")
00036      TEST_ARG(t_signal_fcns, "<engmodule.la>")
00037      TEST_DEP(t_signal_fcns, t_evg_alloc)
00038 
00045 int
00046 main(int argc, char **argv)
00047 {
00048   char *prog;
00049   ev_err_t err;
00050   ev_ctx_t ctx;
00051   ev_sig_t *sig;
00052 
00053   ev_test_init(t_signal_fcns); /* initialize test program */
00054   ev_prog_name(prog, argv); /* calculate program name... */
00055   ev_lib_init(argc, argv, prog, &ctx); /* initialize event library */
00056 
00057   TEST(t_signal_fcns, signal_create, "Test that signal_create() creates a "
00058        "signal generator",
00059        (!(err = signal_create(&ctx, SIGINT, 0, 0, &sig))), FATAL(0),
00060        ("signal_create() properly created a signal generator"),
00061        ("signal_create() failed to create a signal generator; error %u", err));
00062 
00063   TEST(t_signal_fcns, signal_destroy, "Test that signal_destroy() destroys a "
00064        "signal generator",
00065        (!(err = signal_destroy(&ctx, sig))), FATAL(0),
00066        ("signal_destroy() properly destroyed a signal generator"),
00067        ("signal_destroy() failed to destroy a signal generator; error %u",
00068         err));
00069 
00070   return 0;
00071 }

Generated on Wed Dec 28 23:36:56 2005 for event by  doxygen 1.4.4