Add line, plane, ray and segments, split math unit test
Added some basic geometric primitives such as planes, rays, segments and lines (plus some extra functions like xProject, xBarycentric, Lerpf), as well as some intersection tests between them. Additionally, I split massive math test into smaller ones and tweaked unit test library (testing no longer stops after first failure).
This commit is contained in:
@@ -55,6 +55,7 @@ void BH_UnitAdd(const char *name, BH_UnitCallback cb)
|
||||
int BH_UnitRun(void)
|
||||
{
|
||||
BH_Unit *current;
|
||||
int result = 0;
|
||||
printf("Running tests...\n");
|
||||
|
||||
current = root;
|
||||
@@ -64,15 +65,16 @@ int BH_UnitRun(void)
|
||||
if (current->cb())
|
||||
{
|
||||
printf("\tFAIL\n");
|
||||
BH_UnitCleanup();
|
||||
return -1;
|
||||
result = -1;
|
||||
}
|
||||
printf("\tPASS\n");
|
||||
else
|
||||
printf("\tPASS\n");
|
||||
|
||||
fflush(stdout);
|
||||
current = current->next;
|
||||
}
|
||||
|
||||
BH_UnitCleanup();
|
||||
return 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user