/*
 * SPDX-FileCopyrightText: (c) 2009 RWTH Aachen University <rwth-aachen.de>
 * SPDX-FileCopyrightText: (c) 2009 Gesellschaft für numerische Simulation mbH Braunschweig <gns-mbh.com>
 * SPDX-FileCopyrightText: (c) 2009 Technische Universität Dresden <tu-dresden.de>
 * SPDX-FileCopyrightText: (c) 2009 University of Oregon <uoregon.edu>
 * SPDX-FileCopyrightText: (c) 2009 Forschungszentrum Jülich GmbH <fz-juelich.de>
 * SPDX-FileCopyrightText: (c) 2009 German Research School for Simulation Sciences GmbH
 * SPDX-FileCopyrightText: (c) 2009 Technische Universität München <tum.de>
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *
 */



/**
 * @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;
}
