Add unit test for ModelTool::DetectLodIndex and improve LOD index detection further
#765
This commit is contained in:
24
Source/Engine/Tests/TestModelTool.cpp
Normal file
24
Source/Engine/Tests/TestModelTool.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
|
||||
|
||||
#include "Engine/Tools/ModelTool/ModelTool.h"
|
||||
#include <ThirdParty/catch2/catch.hpp>
|
||||
|
||||
TEST_CASE("ModelTool")
|
||||
{
|
||||
SECTION("Test DetectLodIndex")
|
||||
{
|
||||
CHECK(ModelTool::DetectLodIndex(TEXT("mesh")) == 0);
|
||||
CHECK(ModelTool::DetectLodIndex(TEXT("mesh LOD")) == 0);
|
||||
CHECK(ModelTool::DetectLodIndex(TEXT("mesh LOD0")) == 0);
|
||||
CHECK(ModelTool::DetectLodIndex(TEXT("mesh LOD1")) == 1);
|
||||
CHECK(ModelTool::DetectLodIndex(TEXT("mesh_LOD1")) == 1);
|
||||
CHECK(ModelTool::DetectLodIndex(TEXT("mesh_lod1")) == 1);
|
||||
CHECK(ModelTool::DetectLodIndex(TEXT("mesh_lod2")) == 2);
|
||||
CHECK(ModelTool::DetectLodIndex(TEXT("lod0")) == 0);
|
||||
CHECK(ModelTool::DetectLodIndex(TEXT("lod1")) == 1);
|
||||
CHECK(ModelTool::DetectLodIndex(TEXT("lod_2")) == 2);
|
||||
CHECK(ModelTool::DetectLodIndex(TEXT("mesh_lod_0")) == 0);
|
||||
CHECK(ModelTool::DetectLodIndex(TEXT("mesh_lod_1")) == 1);
|
||||
CHECK(ModelTool::DetectLodIndex(TEXT("mesh lod_2")) == 2);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Flax.Build;
|
||||
using Flax.Build.NativeCpp;
|
||||
|
||||
/// <summary>
|
||||
/// Engine tests module.
|
||||
@@ -14,6 +15,14 @@ public class Tests : EngineModule
|
||||
Deploy = false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Setup(BuildOptions options)
|
||||
{
|
||||
base.Setup(options);
|
||||
|
||||
options.PrivateDependencies.Add("ModelTool");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void GetFilesToDeploy(List<string> files)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user