X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Ferror.h;h=7e34227620552cf291799b873dfc0195699948cd;hb=1e8bc3cb173d8b4e206363de7fdabeddb32d0f53;hp=047d66b85cdc6e49f834ec13680f834f1115df23;hpb=6b2e8e60c388754cbe4f9bb3eb38f870544615c8;p=m6w6%2Flibmemcached diff --git a/libtest/error.h b/libtest/error.h index 047d66b8..7e342276 100644 --- a/libtest/error.h +++ b/libtest/error.h @@ -23,13 +23,18 @@ #pragma once enum test_return_t { - TEST_SUCCESS= 0, /* Backwards compatibility */ + TEST_SUCCESS, TEST_FAILURE, - TEST_MEMORY_ALLOCATION_FAILURE, - TEST_SKIPPED, - TEST_FATAL // Collection should not be continued + TEST_SKIPPED }; -#define test_failed(__test_return_t) ((__test_return_t) != TEST_SUCCESS) -#define test_success(__test_return_t) ((__test_return_t) == TEST_SUCCESS) +static inline bool test_success(test_return_t rc) +{ + return (rc == TEST_SUCCESS); +} + +static inline bool test_failed(test_return_t rc) +{ + return (rc != TEST_SUCCESS); +}