Moved tests + Added more tests + Added memory testing to actions
Run tests / Run tests (push) Failing after 6s

This commit is contained in:
2026-05-03 20:07:16 +03:00
parent b992f8c223
commit a4fa298d95
26 changed files with 386 additions and 143 deletions
+8
View File
@@ -0,0 +1,8 @@
tests = [
'tostr',
]
foreach t : tests
exec = executable(t, t+'.c', include_directories: headers_include, c_args: evh_c_args)
test(t, exec, suite: 'types')
endforeach
+40
View File
@@ -0,0 +1,40 @@
#include <stdio.h>
#include "ev_types.h"
#include "ev_numeric.h"
typedef struct {
char *name;
int age;
char *desc;
} Person;
DEFINE_TOSTR_FUNCTION(Person, PERSON_PRINT)
{
sprintf(out, "%s:\n\tage: %d\n\tdesc: %s", self->name, self->age, self->desc);
}
TYPEDATA_GEN(Person,
TOSTR(PERSON_PRINT),
DEFAULT(
.name = "sisyphus",
.age = 9999,
.desc = "One can only imagine him happy"
),
INVALID(
.name = NULL,
.age = -1,
.desc = NULL
)
);
int main()
{
puts("");
char out[256] = {};
Person sisyphue = EV_DEFAULT(Person);
EV_TOSTR(Person)(&sisyphue, out);
puts(out);
return 0;
}