#ifndef __TEST_INIT_H__
#define __TEST_INIT_H__

#include <config.h>

#ifdef _WIN32

#define WIN32_LEAN_AND_MEAN

#include <windows.h>

static void test_init(void)
{
  SetErrorMode(SEM_NOGPFAULTERRORBOX | SEM_FAILCRITICALERRORS);
}

#else

#define test_init()

#endif


#ifndef ASSERT_STREAM
# define ASSERT_STREAM stderr
#endif

#define ASSERT(expr) \
  do                                                                         \
    {                                                                        \
      if (!(expr))                                                           \
        {                                                                    \
          fprintf (ASSERT_STREAM, "%s:%d: assertion failed: %s\n",           \
                   __FILE__, __LINE__, #expr);                               \
          fflush (ASSERT_STREAM);                                            \
          abort ();                                                          \
        }                                                                    \
    }                                                                        \
  while (0)


#endif
