Skip to content

Commit 1eebde2

Browse files
committed
adapt unit tests for windows
1 parent b14f614 commit 1eebde2

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

Tests/Runtime/TestLLM.cs

+21-10
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ static TestRunListener()
2424

2525
public class TestRunCallbacks : ICallbacks
2626
{
27-
public void RunStarted(ITestAdaptor testsToRun){}
27+
public void RunStarted(ITestAdaptor testsToRun) { }
2828

2929
public void RunFinished(ITestResultAdaptor result)
3030
{
3131
LLMUnitySetup.FullLlamaLib = false;
3232
}
3333

34-
public void TestStarted(ITestAdaptor test) {
34+
public void TestStarted(ITestAdaptor test)
35+
{
3536
LLMUnitySetup.FullLlamaLib = test.FullName.Contains("CUDA_full");
3637
}
3738

@@ -262,7 +263,7 @@ public async Task RunTestsTask()
262263
await Tests();
263264
llm.OnDestroy();
264265
}
265-
catch (Exception e)
266+
catch (Exception e)
266267
{
267268
error = e;
268269
}
@@ -299,7 +300,7 @@ public void TestInitParameters(int nkeep, int chats)
299300

300301
public void TestTokens(List<int> tokens)
301302
{
302-
Assert.AreEqual(tokens, new List<int> {40});
303+
Assert.AreEqual(tokens, new List<int> { 40 });
303304
}
304305

305306
public void TestWarmup()
@@ -323,7 +324,7 @@ public void TestEmbeddings(List<float> embeddings)
323324
Assert.That(embeddings.Count == 896);
324325
}
325326

326-
public virtual void OnDestroy() {}
327+
public virtual void OnDestroy() { }
327328
}
328329

329330
public class TestLLM_LLMManager_Load : TestLLM
@@ -543,12 +544,20 @@ public class TestLLM_CUDA_full : TestLLM_CUDA
543544
public override void SetParameters()
544545
{
545546
base.SetParameters();
546-
reply1 = "To increase your meme production output, you might consider using more advanced tools and techniques to generate memes faster";
547-
reply2 = "To increase your meme production output, you might consider using more advanced tools and techniques to generate memes faster";
547+
if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.WindowsPlayer)
548+
{
549+
reply1 = "To increase your meme production output, you might consider using more modern tools and techniques to generate memes.";
550+
reply2 = "To increase your meme production output, you can try using various tools and techniques to generate more content quickly";
551+
}
552+
else
553+
{
554+
reply1 = "To increase your meme production output, you might consider using more advanced tools and techniques to generate memes faster";
555+
reply2 = "To increase your meme production output, you might consider using more advanced tools and techniques to generate memes faster";
556+
}
548557
}
549558
}
550559

551-
public class TestLLM_CUDA_full_attention : TestLLM_CUDA
560+
public class TestLLM_CUDA_full_attention : TestLLM_CUDA_full
552561
{
553562
public override LLM CreateLLM()
554563
{
@@ -560,8 +569,10 @@ public override LLM CreateLLM()
560569
public override void SetParameters()
561570
{
562571
base.SetParameters();
563-
reply1 = "To increase your meme production output, you might consider using more advanced tools and techniques to generate memes faster";
564-
reply2 = "To increase your meme production output, you can try using various tools and techniques to generate more memes.";
572+
if (Application.platform == RuntimePlatform.LinuxEditor || Application.platform == RuntimePlatform.LinuxPlayer)
573+
{
574+
reply2 = "To increase your meme production output, you can try using various tools and techniques to generate more memes.";
575+
}
565576
}
566577
}
567578
}

0 commit comments

Comments
 (0)