/**
* @file ut.h
* @brief Unittest For C
* @copyright 2023 Nomura Kei
*/
#ifndef UT_H
#define UT_H
////////////////////////////////////////////////////////////////////////////////
//
// C/C++ Version チェック
//
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
// C11 以降
#include <stddef.h>
#include <stdbool.h>
#elif defined(__cplusplus) && (__cplusplus >= 201703L)
// C++17 以降対応
#include <cstddef>
#else
// 非対応
#error "suuports C11, C++17 or later"
#endif
#include <kc_windows.h>
////////////////////////////////////////////////////////////////////////////////
//
// UT
//
/**
* Ut 用構造体
*/
typedef struct
{
/**
* テストケースを追加します。
*
* @param func_name テストメッセージ
* @param test_func 追加するテストケース
*/
void (*add)(const char* msg, void (*test_func)(void));
/**
* テストケースを実行します。
*/
void (*run)(void);
} Ut;
/**
* Ut を構築します。
*
* @return Ut
*/
Ut* Ut_new(void);
/**
* Ut を破棄します。
*
* @param ut 破棄する Ut
*/
void Ut_delete(Ut* ut);
#endif // UT_H