File: utils_error_test.c

package info (click to toggle)
otf2 3.1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,000 kB
  • sloc: ansic: 92,997; python: 16,977; cpp: 9,057; sh: 6,299; makefile: 238; awk: 54
file content (86 lines) | stat: -rw-r--r-- 2,805 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
 * This file is part of the Score-P software ecosystem (http://www.score-p.org)
 *
 * Copyright (c) 2009-2012,
 * RWTH Aachen University, Germany
 *
 * Copyright (c) 2009-2012,
 * Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany
 *
 * Copyright (c) 2009-2012,
 * Technische Universitaet Dresden, Germany
 *
 * Copyright (c) 2009-2012,
 * University of Oregon, Eugene, USA
 *
 * Copyright (c) 2009-2012, 2022,
 * Forschungszentrum Juelich GmbH, Germany
 *
 * Copyright (c) 2009-2012,
 * German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany
 *
 * Copyright (c) 2009-2012,
 * Technische Universitaet Muenchen, Germany
 *
 * This software may be modified and distributed under the terms of
 * a BSD-style license.  See the COPYING file in the package base
 * directory for details.
 *
 */



/**
 * @file
 *
 *
 */

#include <config.h>
#include <UTILS_Error.h>

#include <stdio.h>

#include <utils_package.h>


int
main()
{
    printf( "================================================================\n"
            "The following error test will print error messages in order\n"
            "to test whether the error system works correctly. If we suppress\n"
            "this messages we would no longer see, if a segmentation fault\n"
            "occurs.\n"
            "================================================================\n"
            );
    errno = 0;
    UTILS_ERROR_POSIX( "This error message is no real error: Success" );
    errno = ENOMEM;
    UTILS_ERROR_POSIX( "This error message is no real error: Valid errno" );
    errno = 1024;
    UTILS_ERROR_POSIX( "This error message is no real error: Unknown POSIX" );
    errno = -1024;
    UTILS_ERROR_POSIX( "This error message is no real error: Unknown POSIX II" );
    UTILS_ERROR( PACKAGE_SUCCESS,
                 "This error message is no real error: "
                 UTILS_STRINGIFY( PACKAGE_SUCCESS ) );
    UTILS_ERROR( PACKAGE_ERROR_END_OF_FUNCTION,
                 "This error message is no real error: "
                 UTILS_STRINGIFY( PACKAGE_ERROR_END_OF_FUNCTION ) );
    UTILS_ERROR( PACKAGE_ERROR_END_OF_FUNCTION, "Just a test of the error system." );
    UTILS_ERROR( 1024,
                 "This error message is no real error: error invalid positive code" );
    UTILS_ERROR( -1024,
                 "This error message is no real error: error invalid negative code" );

    UTILS_WARNING( "This is just a warning from the exception module." );

    UTILS_DEPRECATED( "This is just a deprecation warning from the exception module." );

    printf( "================================================================\n"
            "End of error tests.\n"
            "================================================================\n"
            );
    return 0;
}