Roxen.git / server / etc / include / testsuite.h

version» Context lines:

Roxen.git/server/etc/include/testsuite.h:12:    cpp_test_true (__FILE__, __LINE__, \    lambda() {return (EXPR);}, \    #EXPR, ({ARGS}))      #define TEST_FALSE(EXPR, ARGS...) \    cpp_test_true (__FILE__, __LINE__, \    lambda() {return !(EXPR);}, \    #EXPR, ({ARGS}))      #define TEST_EQUAL(A, B) \ -  do { \ +  lambda () { \    int len__ = min (max (sizeof (#A), sizeof (#B)), 40); \    array args__ = ({len__, #A, 0, len__, #B, 0}); \    cpp_test_true (__FILE__, __LINE__, \    lambda() { \    return equal (args__[2] = (A), args__[5] = (B)); \    }, \    "%-*s (is %O) equals\n" \    "%-*s (is %O)?", \    args__); \    args__ = 0; \ -  } while (0) +  }()      #define TEST_NOT_EQUAL(A, B) \ -  do { \ +  lambda () { \    int len__ = min (max (sizeof (#A), sizeof (#B)), 40); \    array args__ = ({len__, #A, 0, len__, #B, 0}); \    cpp_test_true (__FILE__, __LINE__, \    lambda() { \    return !equal (args__[2] = (A), args__[5] = (B)); \    }, \    "%-*s (is %O) does not equal\n" \    "%-*s (is %O)?", \    args__); \    args__ = 0; \ -  } while (0) +  }()      #define TEST_CMP(A, OP, B) \ -  do { \ +  lambda () { \    int len__ = min (max (sizeof (#A), sizeof (#B)), 40); \    array args__ = ({len__, #A, 0, len__, #B, 0}); \    cpp_test_true (__FILE__, __LINE__, \    lambda() { \    return (args__[2] = (A)) OP (args__[5] = (B)); \    }, \    "%-*s (is %O) " #OP "\n" \    "%-*s (is %O)?", \    args__); \    args__ = 0; \ -  } while (0) +  }()      #define TEST_ERROR(CODE, ARGS...) \    cpp_test_true (__FILE__, __LINE__, \    lambda() {return catch {CODE;};}, \    #CODE, ({ARGS}))      #define TEST_NOT_ERROR(CODE, ARGS...) \    cpp_test_true (__FILE__, __LINE__, \    lambda() {return !catch {CODE;};}, \    #CODE, ({ARGS}))