UnitTests: Rename .cpp (it was confusing the debugger)
This commit is contained in:
44
tests/Engine/Core/PrimitiveListTest.cpp
Normal file
44
tests/Engine/Core/PrimitiveListTest.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#include <Nazara/Core/PrimitiveList.hpp>
|
||||
#include <Catch/catch.hpp>
|
||||
|
||||
SCENARIO("PrimitiveList", "[CORE][PRIMITIVELIST]")
|
||||
{
|
||||
GIVEN("An empty PrimitiveList")
|
||||
{
|
||||
Nz::PrimitiveList primitiveList;
|
||||
|
||||
WHEN("We add two primitives")
|
||||
{
|
||||
float size = 1.f;
|
||||
unsigned int subdivision = 1;
|
||||
unsigned int recursionLevel = 1;
|
||||
Nz::Matrix4f identity = Nz::Matrix4f::Identity();
|
||||
|
||||
primitiveList.AddCubicSphere(size, subdivision, identity);
|
||||
primitiveList.AddBox(Nz::Vector3f(size), Nz::Vector3ui(subdivision), identity);
|
||||
primitiveList.AddIcoSphere(size, subdivision, identity);
|
||||
|
||||
THEN("There must be two items")
|
||||
{
|
||||
REQUIRE(primitiveList.GetSize() == 3);
|
||||
}
|
||||
|
||||
THEN("The first one is the cubic sphere")
|
||||
{
|
||||
REQUIRE(primitiveList(0).type == Nz::PrimitiveType::Sphere);
|
||||
REQUIRE(primitiveList(0).sphere.type == Nz::SphereType::Cubic);
|
||||
}
|
||||
|
||||
THEN("The second one is the box")
|
||||
{
|
||||
REQUIRE(primitiveList(1).type == Nz::PrimitiveType::Box);
|
||||
}
|
||||
|
||||
THEN("The third one is the ico sphere")
|
||||
{
|
||||
REQUIRE(primitiveList(2).type == Nz::PrimitiveType::Sphere);
|
||||
REQUIRE(primitiveList(2).sphere.type == Nz::SphereType::Ico);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user