Added PlayerData test · unitycoder/UnityDataTools@3b5408b · GitHub
Skip to content

Commit 3b5408b

Browse files
committed
Added PlayerData test
1 parent fd7077a commit 3b5408b

22 files changed

Lines changed: 201 additions & 129 deletions

File tree

Analyzer.Tests/ExpectedDataGenerator.cs

Lines changed: 4 additions & 12 deletions

Analyzer.Tests/SerializedObjectsTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace UnityDataTools.Analyzer.Tests;
99

1010
#pragma warning disable NUnit2005, NUnit2006
1111

12-
public class SerializedObjectsTests : TestForAllVersions
12+
public class SerializedObjectsTests : AssetBundleTestFixture
1313
{
1414
private UnityArchive m_Archive;
1515
private SerializedFile m_SerializedFile;
@@ -19,18 +19,18 @@ public SerializedObjectsTests(Context context) : base(context)
1919
{
2020
}
2121

22-
protected override void OnCreate()
22+
protected override void OnLoadExpectedData(Context context)
2323
{
2424
// Uncomment to regenerate expected data.
25-
//ExpectedDataGenerator.GenerateAll();
25+
//ExpectedDataGenerator.Generate(context);
2626
}
2727

2828
[OneTimeSetUp]
2929
public void OneTimeSetup()
3030
{
3131
UnityFileSystem.Init();
3232

33-
var path = Path.Combine(Context.UnityDataFolder, "AssetBundles", "assetbundle");
33+
var path = Path.Combine(Context.UnityDataFolder, "assetbundle");
3434
m_Archive = UnityFileSystem.MountArchive(path, "archive:/");
3535
m_SerializedFile = UnityFileSystem.OpenSerializedFile("archive:/CAB-5d40f7cad7c871cf2ad2af19ac542994");
3636
m_FileReader = new UnityFileReader("archive:/CAB-5d40f7cad7c871cf2ad2af19ac542994", 1024*1024);

Analyzer/AnalyzerTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public int Analyze(string path, string databaseName, string searchPattern, bool
6161
Console.Write(new string(' ', Console.BufferWidth));
6262
Console.Write($"\rProcessing {i * 100 / files.Length}% ({i}/{files.Length}) {file}");
6363

64-
writer.WriteSerializedFile(serializedFileName, path);
64+
writer.WriteSerializedFile(serializedFileName, file);
6565
}
6666
}
6767
catch (Exception e)

TestCommon/Context.cs

Lines changed: 13 additions & 22 deletions
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)