Fix file and directory permissions

This commit is contained in:
2025-02-02 22:51:28 +03:00
parent 586a9ace21
commit d917eaa479
12 changed files with 58 additions and 0 deletions

0
unit/CMakeLists.txt Executable file → Normal file
View File

0
unit/include/BH/Unit.h Executable file → Normal file
View File

17
unit/src/Unit.c Executable file → Normal file
View File

@@ -12,6 +12,21 @@ typedef struct BH_Unit
static BH_Unit *root = NULL;
static void BH_UnitCleanup(void)
{
BH_Unit *current;
current = root;
while (current)
{
BH_Unit *next = current->next;
free(current);
current = next;
}
}
void BH_UnitAdd(const char *name, BH_UnitCallback cb)
{
BH_Unit *unit, *current;
@@ -49,6 +64,7 @@ int BH_UnitRun(void)
if (current->cb())
{
printf("\tFAIL\n");
BH_UnitCleanup();
return -1;
}
printf("\tPASS\n");
@@ -56,6 +72,7 @@ int BH_UnitRun(void)
current = current->next;
}
BH_UnitCleanup();
return 0;
}