#include <pthread.h>
#include <stdio.h>
#include <errno.h>

#define FAILED do \
    { \
        fprintf (stderr, "FAIL: at <%s:%d> %s\n", \
            __FILE__, __LINE__, strerror (errno)); \
        exit (1); \
    } while (0)

#define FAILED_ERRNO(code) do \
    { \
        fprintf (stderr, "FAIL: at <%s:%d> %s\n", \
            __FILE__, __LINE__, strerror (code)); \
        exit (1); \
    } while (0)

#define PASSED do \
    { \
        fprintf (stderr, "PASS: %s\n", __FILE__); \
        exit (0); \
    } while (0)
