1 //==========================================================================
7 //==========================================================================
8 //####COPYRIGHTBEGIN####
10 // ----------------------------------------------------------------------------
11 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
13 // This file is part of the eCos host tools.
15 // This program is free software; you can redistribute it and/or modify it
16 // under the terms of the GNU General Public License as published by the Free
17 // Software Foundation; either version 2 of the License, or (at your option)
20 // This program is distributed in the hope that it will be useful, but WITHOUT
21 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
25 // You should have received a copy of the GNU General Public License along with
26 // this program; if not, write to the Free Software Foundation, Inc.,
27 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 // ----------------------------------------------------------------------------
31 //####COPYRIGHTEND####
32 //==========================================================================
33 //#####DESCRIPTIONBEGIN####
36 // Contributors: bartv
39 // Description: This routine causes a basic assertion, including a
40 // number of callbacks. It is up to the test driver
41 // to analyse the results of this and take appropriate
44 //####DESCRIPTIONEND####
45 //==========================================================================
47 #define CYG_DECLARE_HOST_ASSERTION_SUPPORT
48 #define CYGDBG_USE_ASSERTS
49 #define CYGDBG_INFRA_DEBUG_PRECONDITIONS
50 #define CYGDBG_INFRA_DEBUG_POSTCONDITIONS
51 #define CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS
52 #define CYGDBG_INFRA_DEBUG_INVARIANTS
54 #include <cyg/infra/testcase.h>
55 #include <cyg/infra/cyg_ass.h>
59 callback1(void (*outputfn)(const char*))
61 // This callback does nothing
66 callback2(void (*outputfn)(const char*))
68 // This callback outputs a number of lines of data.
69 for (int i = 0; i < 10; i++) {
70 (*outputfn)("callback2 output\n");
75 main(int argc, char** argv)
77 cyg_assert_install_failure_callback("callback1", &callback1);
78 cyg_assert_install_failure_callback("callback2", &callback2);
79 CYG_FAIL("it seemed like a good idea at the time");