Translation update done using Pootle.
[gammu.git] / tests / common.h
blob1b6bfca4634610f08baa86c4cbfee0a70c3da7d1
1 #ifndef _test_common_h_
2 #define _test_common_h_
4 #include <stdlib.h>
6 /**
7 * Common functions for test.
8 */
10 #define test_result(val) \
11 { \
12 if (!(val)) {\
13 fprintf(stderr, "Test \"%s\" failed!\n", ""#val); \
14 exit(2); \
15 } \
18 #define gammu_test_result(error, text) \
19 { \
20 if (error != ERR_NONE) {\
21 fprintf(stderr, "%s\n", GSM_ErrorString(error)); \
22 fprintf(stderr, "Test \"%s\" failed!\n", text); \
23 exit(2); \
24 } \
27 #define gammu_test_result_code(error, text, expect) \
28 { \
29 if (error != expect) {\
30 fprintf(stderr, "%s\n", GSM_ErrorString(error)); \
31 fprintf(stderr, "Test \"%s\" failed!\n", text); \
32 exit(2); \
33 } \
36 #endif