Add common unit test macros

This commit is contained in:
Rodrigo Arias 2023-02-20 14:40:47 +01:00 committed by Rodrigo Arias Mallo
parent 2f3dcbed1f
commit 7bbd74cb17

12
test/unit/unittest.h Normal file
View File

@ -0,0 +1,12 @@
/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#ifndef UNITTEST_H
#define UNITTEST_H
#include "common.h"
#define OK(x) do { if ((x) != 0) { die(#x " failed"); } } while (0)
#define ERR(x) do { if ((x) == 0) { die(#x " didn't fail"); } } while (0)
#endif /* UNITTEST_H */