Resolve WES-100 "Natml integration"

This commit is contained in:
Jelle De Geest
2023-04-03 14:14:49 +00:00
parent edf1805a92
commit f95e34c6fe
425 changed files with 525 additions and 96655 deletions

View File

@@ -1,5 +1,5 @@
using NatML;
using NUnit.Framework;
using Unity.Barracuda;
using UnityEngine;
/// <summary>
/// Test the ModelList class
@@ -45,7 +45,11 @@ public class ModelListTest
ModelIndex value = (ModelIndex)random.Next(modelList.models.Count);
modelList.SetCurrentModel(value);
Assert.AreEqual(modelList.models[modelList.currentModelIndex].model, modelList.GetCurrentModel());
#if (UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
Assert.AreEqual(modelList.models[modelList.currentModelIndex].modelWINDOWS, modelList.GetCurrentModel());
#elif (UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX)
Assert.AreEqual(modelList.models[modelList.currentModelIndex].modelMAC, modelList.GetCurrentModel());
#endif
// Check if empty model fails gracefully (returns null)
Assert.IsNull(ScriptableObject.CreateInstance<ModelList>().GetCurrentModel());
@@ -69,7 +73,11 @@ public class ModelListTest
ModelList.ModelTuple m = modelList.models[modelList.currentModelIndex];
Assert.AreEqual(m.index, value);
Assert.IsTrue(m.model is NNModel || m.model is null);
#if (UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
Assert.IsTrue(m.modelWINDOWS is MLModelData || m.modelWINDOWS is null);
#elif (UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX)
Assert.IsTrue(m.modelMAC is MLModelData || m.modelMAC is null);
#endif
}
}
ModelList emptyList = ScriptableObject.CreateInstance<ModelList>();