2004-01-15 03:07:17 +03:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-01-15 03:07:17 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#ifndef OMPI_SUPPORT_H
|
|
|
|
#define OMPI_SUPPORT_H
|
2004-01-15 03:07:17 +03:00
|
|
|
|
2004-06-16 02:41:41 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2004-08-05 23:50:54 +04:00
|
|
|
#define TEST_AND_REPORT(res, exp_res, str) \
|
|
|
|
if( res == exp_res ) test_success(); \
|
|
|
|
else test_failure(str);
|
|
|
|
|
2005-04-08 21:56:16 +04:00
|
|
|
void test_init(const char *a);
|
2004-01-15 03:33:59 +03:00
|
|
|
void test_success(void);
|
2005-04-08 21:56:16 +04:00
|
|
|
void test_failure(const char *a);
|
2004-02-12 00:12:00 +03:00
|
|
|
int test_verify_str(const char *expected_result, const char *test_result);
|
2004-01-27 23:11:48 +03:00
|
|
|
int test_verify_int(int expected_result, int test_result);
|
2004-01-15 03:59:26 +03:00
|
|
|
int test_finalize(void);
|
2005-04-08 21:56:16 +04:00
|
|
|
void test_comment (const char* userstr);
|
|
|
|
void test_fail_stop(const char *msg, int status);
|
2004-08-13 03:03:39 +04:00
|
|
|
|
2004-01-15 03:07:17 +03:00
|
|
|
|
2004-06-16 02:41:41 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* test_verify: Non-fatal assertion macro.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define test_verify(MESSAGE, EXPR) \
|
|
|
|
do { \
|
|
|
|
if (!(EXPR)) { \
|
|
|
|
char s[256]; \
|
|
|
|
sprintf(s, "%s:%d: %s: %s\n", \
|
|
|
|
__FILE__, __LINE__, MESSAGE, # EXPR); \
|
|
|
|
test_failure(s); \
|
|
|
|
} else { \
|
|
|
|
test_success(); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#endif /* OMPI_SUPPORT_H */
|
2004-01-15 03:07:17 +03:00
|
|
|
|