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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [infra/] [testsuite/] [cyginfra/] [tassert5.c] - Blame information for rev 790

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

Line No. Rev Author Line
1 786 skrzyp
/* ==========================================================================
2
 *
3
 *      tassert5.c
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-11-27
35
 * Purpose:
36
 * Description:         A C equivalent of tassert2.cxx
37
 *
38
 *####DESCRIPTIONEND####
39
 *==========================================================================
40
 */
41
 
42
#define CYGDBG_USE_ASSERTS
43
#define CYGDBG_INFRA_DEBUG_PRECONDITIONS
44
#define CYGDBG_INFRA_DEBUG_POSTCONDITIONS
45
#define CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS
46
#define CYGDBG_INFRA_DEBUG_INVARIANTS
47
 
48
#include <cyg/infra/testcase.h>
49
#include <cyg/infra/cyg_ass.h>
50
#include <stdlib.h>
51
 
52
 
53
static const char message[] = "This should never be seen.";
54
 
55
int main(int argc, char** argv)
56
{
57
    CYG_ASSERT( true, message);
58
    CYG_ASSERTC(true);
59
 
60
    CYG_CHECK_DATA_PTR( &argc, message);
61
    CYG_CHECK_FUNC_PTR( &main, message);
62
    CYG_CHECK_DATA_PTRC(&argc);
63
    CYG_CHECK_FUNC_PTRC(&main);
64
 
65
    CYG_PRECONDITION(true, message);
66
    CYG_PRECONDITIONC(true);
67
 
68
    CYG_POSTCONDITION(true, message);
69
    CYG_POSTCONDITIONC(true);
70
 
71
    CYG_LOOP_INVARIANT(true, message);
72
    CYG_LOOP_INVARIANTC(true);
73
 
74
    CYG_INVARIANT(true, message);
75
    CYG_INVARIANTC(true);
76
 
77
    CYG_TEST_PASS_FINISH("true assertions do nothing");
78
    return 0;
79
}
80
 

powered by: WebSVN 2.1.0

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