Добавлено несколько модульных тестов для Vector2, Vector3, Versor
This commit is contained in:
parent
ab4a589e21
commit
86426c9bd5
30 changed files with 1148 additions and 3 deletions
|
|
@ -155,8 +155,18 @@
|
|||
<ClCompile Include="tests\utilities\is_unit.c" />
|
||||
<ClCompile Include="tests\utilities\is_zero.c" />
|
||||
<ClCompile Include="tests\vector2.c" />
|
||||
<ClCompile Include="tests\vector2\vector2_copy.c" />
|
||||
<ClCompile Include="tests\vector2\vector2_reset.c" />
|
||||
<ClCompile Include="tests\vector2\vector2_set_values.c" />
|
||||
<ClCompile Include="tests\vector2\vector2_swap.c" />
|
||||
<ClCompile Include="tests\vector3.c" />
|
||||
<ClCompile Include="tests\vector3\vector3_copy.c" />
|
||||
<ClCompile Include="tests\vector3\vector3_swap.c" />
|
||||
<ClCompile Include="tests\vector3\vector3_reset.c" />
|
||||
<ClCompile Include="tests\vector3\vector3_set_values.c" />
|
||||
<ClCompile Include="tests\versor.c" />
|
||||
<ClCompile Include="tests\versor\versor_copy.c" />
|
||||
<ClCompile Include="tests\versor\versor_swap.c" />
|
||||
<ClCompile Include="tests\versor\versor_combine.c" />
|
||||
<ClCompile Include="tests\versor\versor_reset.c" />
|
||||
<ClCompile Include="tests\versor\versor_set_values.c" />
|
||||
|
|
@ -169,8 +179,18 @@
|
|||
<ClInclude Include="tests\utilities\is_unit.h" />
|
||||
<ClInclude Include="tests\utilities\is_zero.h" />
|
||||
<ClInclude Include="tests\vector2.h" />
|
||||
<ClInclude Include="tests\vector2\vector2_copy.h" />
|
||||
<ClInclude Include="tests\vector2\vector2_reset.h" />
|
||||
<ClInclude Include="tests\vector2\vector2_set_values.h" />
|
||||
<ClInclude Include="tests\vector2\vector2_swap.h" />
|
||||
<ClInclude Include="tests\vector3.h" />
|
||||
<ClInclude Include="tests\vector3\vector3_copy.h" />
|
||||
<ClInclude Include="tests\vector3\vector3_swap.h" />
|
||||
<ClInclude Include="tests\vector3\vector3_reset.h" />
|
||||
<ClInclude Include="tests\vector3\vector3_set_values.h" />
|
||||
<ClInclude Include="tests\versor.h" />
|
||||
<ClInclude Include="tests\versor\versor_copy.h" />
|
||||
<ClInclude Include="tests\versor\versor_swap.h" />
|
||||
<ClInclude Include="tests\versor\versor_combine.h" />
|
||||
<ClInclude Include="tests\versor\versor_reset.h" />
|
||||
<ClInclude Include="tests\versor\versor_set_values.h" />
|
||||
|
|
|
|||
|
|
@ -36,6 +36,36 @@
|
|||
<ClCompile Include="tests\versor\versor_reset.c">
|
||||
<Filter>tests\versor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tests\vector2\vector2_reset.c">
|
||||
<Filter>tests\vector2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tests\vector2\vector2_set_values.c">
|
||||
<Filter>tests\vector2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tests\vector3\vector3_reset.c">
|
||||
<Filter>tests\vector3</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tests\vector3\vector3_set_values.c">
|
||||
<Filter>tests\vector3</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tests\vector2\vector2_copy.c">
|
||||
<Filter>tests\vector2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tests\vector2\vector2_swap.c">
|
||||
<Filter>tests\vector2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tests\vector3\vector3_copy.c">
|
||||
<Filter>tests\vector3</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tests\vector3\vector3_swap.c">
|
||||
<Filter>tests\vector3</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tests\versor\versor_copy.c">
|
||||
<Filter>tests\versor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tests\versor\versor_swap.c">
|
||||
<Filter>tests\versor</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="helpers.h" />
|
||||
|
|
@ -72,6 +102,36 @@
|
|||
<ClInclude Include="tests\versor\versor_reset.h">
|
||||
<Filter>tests\versor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tests\vector2\vector2_reset.h">
|
||||
<Filter>tests\vector2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tests\vector2\vector2_set_values.h">
|
||||
<Filter>tests\vector2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tests\vector3\vector3_reset.h">
|
||||
<Filter>tests\vector3</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tests\vector3\vector3_set_values.h">
|
||||
<Filter>tests\vector3</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tests\vector2\vector2_copy.h">
|
||||
<Filter>tests\vector2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tests\vector2\vector2_swap.h">
|
||||
<Filter>tests\vector2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tests\vector3\vector3_copy.h">
|
||||
<Filter>tests\vector3</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tests\vector3\vector3_swap.h">
|
||||
<Filter>tests\vector3</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tests\versor\versor_copy.h">
|
||||
<Filter>tests\versor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tests\versor\versor_swap.h">
|
||||
<Filter>tests\versor</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="tests">
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
#include "helpers.h"
|
||||
|
||||
#include "tests/utilities.h"
|
||||
#include "tests/vector2.h"
|
||||
#include "tests/vector3.h"
|
||||
#include "tests/versor.h"
|
||||
|
||||
#define PROGRAM_SUCCESS 0
|
||||
|
|
@ -15,6 +17,14 @@ int main()
|
|||
return PROGRAM_FAILED;
|
||||
}
|
||||
|
||||
if (test_vector2() == TEST_FAILED) {
|
||||
return PROGRAM_FAILED;
|
||||
}
|
||||
|
||||
if (test_vector3() == TEST_FAILED) {
|
||||
return PROGRAM_FAILED;
|
||||
}
|
||||
|
||||
if (test_versor() == TEST_FAILED) {
|
||||
return PROGRAM_FAILED;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,81 @@
|
|||
#include "vector2.h"
|
||||
|
||||
int test_bgc_vector2_reset()
|
||||
{
|
||||
if (test_bgc_vector2_reset_fp32() != TEST_SUCCES) {
|
||||
return TEST_FAILED;
|
||||