OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [infra/] [testsuite/] [cyginfra/] [tassert8.cxx] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
//==========================================================================
2
//
3
//      tassert8.cxx
4
//
5
//      Assertion test case                                                                
6
//
7
//==========================================================================
8
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
9
// -------------------------------------------                              
10
// This file is part of the eCos host tools.                                
11
// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.            
12
//
13
// This program is free software; you can redistribute it and/or modify     
14
// it under the terms of the GNU General Public License as published by     
15
// the Free Software Foundation; either version 2 or (at your option) any   
16
// later version.                                                           
17
//
18
// This program is distributed in the hope that it will be useful, but      
19
// WITHOUT ANY WARRANTY; without even the implied warranty of               
20
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        
21
// General Public License for more details.                                 
22
//
23
// You should have received a copy of the GNU General Public License        
24
// along with this program; if not, write to the                            
25
// Free Software Foundation, Inc., 51 Franklin Street,                      
26
// Fifth Floor, Boston, MA  02110-1301, USA.                                
27
// -------------------------------------------                              
28
// ####ECOSHOSTGPLCOPYRIGHTEND####                                          
29
//==========================================================================
30
//#####DESCRIPTIONBEGIN####                                             
31
//
32
// Author(s):           bartv
33
// Contributors:        bartv
34
// Date:                1998-12-23
35
// Purpose:
36
// Description:         This routine causes a basic assertion, including a
37
//                      number of callbacks. It is up to the test driver
38
//                      to analyse the results of this and take appropriate
39
//                      action.
40
//
41
//####DESCRIPTIONEND####
42
//==========================================================================
43
 
44
#define CYG_DECLARE_HOST_ASSERTION_SUPPORT
45
#define CYGDBG_USE_ASSERTS
46
#define CYGDBG_INFRA_DEBUG_PRECONDITIONS
47
#define CYGDBG_INFRA_DEBUG_POSTCONDITIONS
48
#define CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS
49
#define CYGDBG_INFRA_DEBUG_INVARIANTS
50
 
51
#include <cyg/infra/testcase.h>
52
#include <cyg/infra/cyg_ass.h>
53
 
54
extern "C"
55
void
56
callback1(void (*outputfn)(const char*))
57
{
58
    // This callback does nothing
59
}
60
 
61
extern "C"
62
void
63
callback2(void (*outputfn)(const char*))
64
{
65
    // This callback outputs a number of lines of data.
66
    for (int i = 0; i < 10; i++) {
67
        (*outputfn)("callback2 output\n");
68
    }
69
}
70
 
71
int
72
main(int argc, char** argv)
73
{
74
    cyg_assert_install_failure_callback("callback1", &callback1);
75
    cyg_assert_install_failure_callback("callback2", &callback2);
76
    CYG_FAIL("it seemed like a good idea at the time");
77
}
78
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.