/*
 * Copyright (C) 2020-2021 Aloysius Indrayanto
 *
 * This file is part of the eCxx library, see LICENSE file for the license details.
 */


#ifndef ECXX_TEST_UTILITY_H
#define ECXX_TEST_UTILITY_H


#include <stdio.h>

#include <eCxx/eCxx.h>
using namespace eCxx::fixed_point_literals;

#ifdef ECXX_HAVE_PROGRAM_STRING_LITERALS
using namespace eCxx::program_string_literals;
#endif


//
// Helper macros
//
#define _____________________NL1(    )   printf("\n"  )
#define _____________________NL2(    )   printf("\n\n")

#define _DIVIDERLINE_DASHSTR_NL1(    )   printf("-----\n"  )
#define _DIVIDERLINE_DASHSTR_NL2(    )   printf("-----\n\n")

#define _____________USERSTR_NL0(S   )   printf("%s",     S)
#define _____________USERSTR_NL1(S   )   printf("%s\n",   S)
#define _____________USERSTR_NL2(S   )   printf("%s\n\n", S)

#define _EXECUTECODE_CODESTR_NL0(...)    __VA_ARGS__; printf("%s",     STRINGIFY(__VA_ARGS__))
#define _EXECUTECODE_CODESTR_NL1(...)    __VA_ARGS__; printf("%s\n",   STRINGIFY(__VA_ARGS__))
#define _EXECUTECODE_CODESTR_NL2(...)    __VA_ARGS__; printf("%s\n\n", STRINGIFY(__VA_ARGS__))

#define _CODESTR_NL1_CODERES_NL0(F, ...) printf("%s\n", STRINGIFY(__VA_ARGS__)); printf(F,        __VA_ARGS__)
#define _CODESTR_NL1_CODERES_NL1(F, ...) printf("%s\n", STRINGIFY(__VA_ARGS__)); printf(F "\n",   __VA_ARGS__)
#define _CODESTR_NL1_CODERES_NL2(F, ...) printf("%s\n", STRINGIFY(__VA_ARGS__)); printf(F "\n\n", __VA_ARGS__)

#define _____________CODERES_NL0(F, ...) printf(F,        __VA_ARGS__);
#define _____________CODERES_NL1(F, ...) printf(F "\n",   __VA_ARGS__);
#define _____________CODERES_NL2(F, ...) printf(F "\n\n", __VA_ARGS__);


#endif
