Tests: Fix compile error

Former-commit-id: b677c9073998d1449c7aa955e100b53f6931e7f0
This commit is contained in:
Lynix
2016-03-01 13:58:45 +01:00
parent e9bb81e851
commit 790275da8f
4 changed files with 16 additions and 259 deletions

View File

@@ -15,7 +15,7 @@ SCENARIO("AbstractHash", "[CORE][ABSTRACTHASH]")
WHEN("We introduce data")
{
std::array<Nz::UInt8, 4> array{ 0, 1, 2, 3 };
SHA512->Append(array.begin(), array.size());
SHA512->Append(array.data(), array.size());
THEN("We ask for the bytearray")
{

View File

@@ -15,17 +15,30 @@ SCENARIO("PrimitiveList", "[CORE][PRIMITIVELIST]")
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() == 2);
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);
}
}
}
}

View File

@@ -8,7 +8,7 @@ SCENARIO("SparsePtr", "[CORE][SPARSEPTR]")
GIVEN("A sparse pointer pointing to an array with a stride of 2")
{
std::array<int, 5> arrays{0, 1, 2, 3, 4};
Nz::SparsePtr<int> sparsePtr(arrays.begin(), 2 * sizeof(int));
Nz::SparsePtr<int> sparsePtr(arrays.data(), 2 * sizeof(int));
WHEN("We use operators")
{