OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [tools/] [src/] [infra/] [testsuite/] [cyginfra/] [tassert5.c] - Blame information for rev 339

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 unneback
/* ==========================================================================
2
 *
3
 *      tassert5.c
4
 *
5
 *      Assertion test case
6
 *
7
 *==========================================================================
8
 *####COPYRIGHTBEGIN####
9
 *
10
 * ----------------------------------------------------------------------------
11
 * Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
12
 *
13
 * This file is part of the eCos host tools.
14
 *
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)
18
 * any later version.
19
 *
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
23
 * more details.
24
 *
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.
28
 *
29
 * ----------------------------------------------------------------------------
30
 *
31
 *####COPYRIGHTEND####
32
 *==========================================================================
33
 *#####DESCRIPTIONBEGIN####
34
 *
35
 * Author(s):           bartv
36
 * Contributors:        bartv
37
 * Date:                1998-11-27
38
 * Purpose:
39
 * Description:         A C equivalent of tassert2.cxx
40
 *
41
 *####DESCRIPTIONEND####
42
 *==========================================================================
43
 */
44
 
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
#include <stdlib.h>
54
 
55
 
56
static const char message[] = "This should never be seen.";
57
 
58
int main(int argc, char** argv)
59
{
60
    CYG_ASSERT( true, message);
61
    CYG_ASSERTC(true);
62
 
63
    CYG_CHECK_DATA_PTR( &argc, message);
64
    CYG_CHECK_FUNC_PTR( &main, message);
65
    CYG_CHECK_DATA_PTRC(&argc);
66
    CYG_CHECK_FUNC_PTRC(&main);
67
 
68
    CYG_PRECONDITION(true, message);
69
    CYG_PRECONDITIONC(true);
70
 
71
    CYG_POSTCONDITION(true, message);
72
    CYG_POSTCONDITIONC(true);
73
 
74
    CYG_LOOP_INVARIANT(true, message);
75
    CYG_LOOP_INVARIANTC(true);
76
 
77
    CYG_INVARIANT(true, message);
78
    CYG_INVARIANTC(true);
79
 
80
    CYG_TEST_PASS_FINISH("true assertions do nothing");
81
    return 0;
82
}
83
 

powered by: WebSVN 2.1.0

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