X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Ferror.h;h=f567d2a3a62b9735ca7298a9bb46537263e6b394;hb=31048f6090b7c82605d2bbf7653d9884a14fe45b;hp=ca6c575d068fcd265b34bcccc2376e24c161feba;hpb=48171051f3c496c6bb2841a3abadbe9faa9cad07;p=awesomized%2Flibmemcached diff --git a/libtest/error.h b/libtest/error.h index ca6c575d..f567d2a3 100644 --- a/libtest/error.h +++ b/libtest/error.h @@ -1,8 +1,8 @@ /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * libtest * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * Data Differential YATL (i.e. libtest) library + * + * Copyright (C) 2012 Data Differential, http://datadifferential.com/ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -34,17 +34,21 @@ * */ - #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); +}