2004-01-15 00:07:17 +00:00
|
|
|
/*
|
2005-11-05 19:57:48 +00: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 20:09:25 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 01:38:40 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-01-15 00:07:17 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#ifndef OMPI_SUPPORT_H
|
|
|
|
#define OMPI_SUPPORT_H
|
2004-01-15 00:07:17 +00:00
|
|
|
|
2004-06-15 22:41:41 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2004-08-05 19:50:54 +00:00
|
|
|
#define TEST_AND_REPORT(res, exp_res, str) \
|
|
|
|
if( res == exp_res ) test_success(); \
|
|
|
|
else test_failure(str);
|
|
|
|
|
2005-04-08 17:56:16 +00:00
|
|
|
void test_init(const char *a);
|
2004-01-15 00:33:59 +00:00
|
|
|
void test_success(void);
|
2005-04-08 17:56:16 +00:00
|
|
|
void test_failure(const char *a);
|
2004-02-11 21:12:00 +00:00
|
|
|
int test_verify_str(const char *expected_result, const char *test_result);
|
2004-01-27 20:11:48 +00:00
|
|
|
int test_verify_int(int expected_result, int test_result);
|
2004-01-15 00:59:26 +00:00
|
|
|
int test_finalize(void);
|
2005-04-08 17:56:16 +00:00
|
|
|
void test_comment (const char* userstr);
|
|
|
|
void test_fail_stop(const char *msg, int status);
|
2004-08-12 23:03:39 +00:00
|
|
|
|
2004-01-15 00:07:17 +00:00
|
|
|
|
2004-06-15 22:41:41 +00: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 15:33:53 +00:00
|
|
|
#endif /* OMPI_SUPPORT_H */
|
2004-01-15 00:07:17 +00:00
|
|
|
|