1
1
openmpi/test/support/support.h
Graham Fagg 1d780192ef Added test_comment() that prints user string to STDOUT unlike test_* which print to STDERR.
Used for more verbose test results when needed.

This commit was SVN r2096.
2004-08-12 23:03:39 +00:00

43 строки
1.2 KiB
C

/*
* $HEADER$
*/
#ifndef OMPI_SUPPORT_H
#define OMPI_SUPPORT_H
#include <stdio.h>
#include <stdlib.h>
#define TEST_AND_REPORT(res, exp_res, str) \
if( res == exp_res ) test_success(); \
else test_failure(str);
void test_init(char *a);
void test_success(void);
void test_failure(char *a);
int test_verify_str(const char *expected_result, const char *test_result);
int test_verify_int(int expected_result, int test_result);
int test_finalize(void);
void test_comment (char* userstr);
/*
* 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)
#endif /* OMPI_SUPPORT_H */