X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Ftest.h;h=2245e798da6899253d1ddd072ef49017e2538d14;hb=625e84ebfc422790372bc2984f504bdcb4da779c;hp=0493f3106b1b4b657aefb312d6195fb49a141af5;hpb=f0b9c972a973d997db6660680938dd5acb2baa46;p=m6w6%2Flibmemcached diff --git a/libtest/test.h b/libtest/test.h index 0493f310..2245e798 100644 --- a/libtest/test.h +++ b/libtest/test.h @@ -56,13 +56,25 @@ typedef struct world_st world_st; typedef struct collection_st collection_st; typedef struct test_st test_st; -typedef enum { - TEST_SUCCESS= 0, /* Backwards compatibility */ +enum test_return_t { + TEST_SUCCESS, /* Backwards compatibility */ TEST_FAILURE, TEST_MEMORY_ALLOCATION_FAILURE, TEST_SKIPPED, + TEST_FATAL, // Collection should not be continued TEST_MAXIMUM_RETURN /* Always add new error code before */ -} test_return_t; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum test_return_t test_return_t; + +#ifdef __cplusplus +} +#endif + typedef void *(*test_callback_create_fn)(test_return_t *error); typedef test_return_t (*test_callback_fn)(void *); @@ -228,6 +240,15 @@ do \ } \ } while (0) +#define test_skip(A,B) \ +do \ +{ \ + if ((A) != (B)) \ + { \ + return TEST_SKIPPED; \ + } \ +} while (0) + #define test_compare_got(A,B,C) \ do \ { \