projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Added missing constant.
[m6w6/libmemcached]
/
tests
/
test.h
diff --git
a/tests/test.h
b/tests/test.h
index fc10c8d5492a94bfd28f164e9d28bac39df3fc8c..28388bbd7f0add79e79863005a50c5b11b36cf48 100644
(file)
--- a/
tests/test.h
+++ b/
tests/test.h
@@
-16,9
+16,12
@@
extern "C" {
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stdbool.h>
#include <stdint.h>
#include <stdint.h>
+#if !defined(__cplusplus)
+# include <stdbool.h>
+#endif
+
typedef struct world_st world_st;
typedef struct collection_st collection_st;
typedef struct test_st test_st;
typedef struct world_st world_st;
typedef struct collection_st collection_st;
typedef struct test_st test_st;
@@
-144,7
+147,15
@@
void create_core(void);
*/
const char *test_strerror(test_return_t code);
*/
const char *test_strerror(test_return_t code);
-#define test_truth(A) \
+#define test_fail(A) \
+do \
+{ \
+ fprintf(stderr, "\nFailed in %s:%d: %s\n", __FILE__, __LINE__, #A);\
+ create_core(); \
+ return TEST_FAILURE; \
+} while (0)
+
+#define test_true(A) \
do \
{ \
if (! (A)) { \
do \
{ \
if (! (A)) { \