Skip to content

Commit fd7077a

Browse files
committed
Improved ExpectedDataGenerators
1 parent 43a821a commit fd7077a

10 files changed

Lines changed: 6851 additions & 20264 deletions

File tree

Analyzer.Tests/ExpectedData/2022.1.20f1/ExpectedValues.json

Lines changed: 88 additions & 88 deletions
Large diffs are not rendered by default.

Analyzer.Tests/SerializedObjectsTests.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ public class SerializedObjectsTests : TestForAllVersions
1515
private SerializedFile m_SerializedFile;
1616
private UnityFileReader m_FileReader;
1717

18-
static SerializedObjectsTests()
18+
public SerializedObjectsTests(Context context) : base(context)
1919
{
20-
//ExpectedDataGenerator.GenerateAll();
2120
}
22-
23-
public SerializedObjectsTests(Context context) : base(context)
21+
22+
protected override void OnCreate()
2423
{
24+
// Uncomment to regenerate expected data.
25+
//ExpectedDataGenerator.GenerateAll();
2526
}
2627

2728
[OneTimeSetUp]

TestCommon/TestForAllVersions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ public TestForAllVersions(Context context)
1212
Context = context;
1313
}
1414

15+
protected virtual void OnCreate()
16+
{
17+
}
18+
1519
[OneTimeSetUp]
1620
public void LoadExpectedData()
1721
{

UnityDataTool.Tests/ExpectedData/2022.1.20f1/ExpectedValues.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"$type": "System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.Object, System.Private.CoreLib]], System.Private.CoreLib",
33
"NodeCount": 3,
4-
"CAB-5d40f7cad7c871cf2ad2af19ac542994-Size": 956211,
4+
"CAB-5d40f7cad7c871cf2ad2af19ac542994-Size": 960179,
55
"CAB-5d40f7cad7c871cf2ad2af19ac542994-Flags": 4,
6-
"CAB-5d40f7cad7c871cf2ad2af19ac542994.resS-Size": 2833848,
6+
"CAB-5d40f7cad7c871cf2ad2af19ac542994.resS-Size": 2833056,
77
"CAB-5d40f7cad7c871cf2ad2af19ac542994.resS-Flags": 0,
88
"CAB-5d40f7cad7c871cf2ad2af19ac542994.resource-Size": 5248,
99
"CAB-5d40f7cad7c871cf2ad2af19ac542994.resource-Flags": 0,

UnityDataTool.Tests/ExpectedData/2022.1.20f1/dump-s/CAB-5d40f7cad7c871cf2ad2af19ac542994.txt

Lines changed: 3366 additions & 10079 deletions
Large diffs are not rendered by default.

UnityDataTool.Tests/ExpectedData/2022.1.20f1/dump/CAB-5d40f7cad7c871cf2ad2af19ac542994.txt

Lines changed: 3369 additions & 10082 deletions
Large diffs are not rendered by default.

UnityDataTool.Tests/UnityDataToolTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ public class UnityDataToolTests : TestForAllVersions
1818
public UnityDataToolTests(Context context) : base(context)
1919
{
2020
}
21-
22-
static UnityDataToolTests()
21+
22+
protected override void OnCreate()
2323
{
24+
// Uncomment to regenerate expected data.
2425
//ExpectedDataGenerator.GenerateAll();
2526
}
2627

UnityFileSystem.Tests/ExpectedData/2022.1.20f1/ExpectedValues.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"$type": "System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.Object, System.Private.CoreLib]], System.Private.CoreLib",
33
"NodeCount": 3,
4-
"CAB-5d40f7cad7c871cf2ad2af19ac542994-Size": 956211,
4+
"CAB-5d40f7cad7c871cf2ad2af19ac542994-Size": 960179,
55
"CAB-5d40f7cad7c871cf2ad2af19ac542994-Flags": 4,
66
"CAB-5d40f7cad7c871cf2ad2af19ac542994-Data": {
77
"$type": "System.Byte[], System.Private.CoreLib",
8-
"$value": "AAAAAAAAAAAAAAAWAAAAAAAAAAAAAhE9AAAAAAAOlzMAAAAAAAIRcAAAAAAAAAAAMjAyMS4zLjBmMQACAAAAAREAAABzAAAAAP//9G6OMOzCk0k/GKsnE0IQ7iMAAADfAAAABQ=="
8+
"$value": "AAAAAAAAAAAAAAAWAAAAAAAAAAAAAiQhAAAAAAAOprMAAAAAAAIkYAAAAAAAAAAAMjAyMi4xLjIwZjEAAgAAAAERAAAAcwAAAAD///RujjDswpNJPxirJxNCEO4jAAAA3wAAAA=="
99
},
1010
"CAB-5d40f7cad7c871cf2ad2af19ac542994-ObjCount": 138,
1111
"CAB-5d40f7cad7c871cf2ad2af19ac542994-ExtRefCount": 3,
@@ -19,18 +19,18 @@
1919
"CAB-5d40f7cad7c871cf2ad2af19ac542994-ExtRef2-Path": "archive:/CAB-35fce856128a6714740898681ea54bbe/CAB-35fce856128a6714740898681ea54bbe",
2020
"CAB-5d40f7cad7c871cf2ad2af19ac542994-ExtRef2-Type": 0,
2121
"CAB-5d40f7cad7c871cf2ad2af19ac542994-FirstObj-Id": -9180874206900030759,
22-
"CAB-5d40f7cad7c871cf2ad2af19ac542994-FirstObj-Offset": 135672,
22+
"CAB-5d40f7cad7c871cf2ad2af19ac542994-FirstObj-Offset": 140520,
2323
"CAB-5d40f7cad7c871cf2ad2af19ac542994-FirstObj-Size": 39,
2424
"CAB-5d40f7cad7c871cf2ad2af19ac542994-FirstObj-TypeId": 1,
2525
"CAB-5d40f7cad7c871cf2ad2af19ac542994-LastObj-Id": 9073582682380749191,
26-
"CAB-5d40f7cad7c871cf2ad2af19ac542994-LastObj-Offset": 956168,
26+
"CAB-5d40f7cad7c871cf2ad2af19ac542994-LastObj-Offset": 960136,
2727
"CAB-5d40f7cad7c871cf2ad2af19ac542994-LastObj-Size": 43,
2828
"CAB-5d40f7cad7c871cf2ad2af19ac542994-LastObj-TypeId": 1,
29-
"CAB-5d40f7cad7c871cf2ad2af19ac542994.resS-Size": 2833848,
29+
"CAB-5d40f7cad7c871cf2ad2af19ac542994.resS-Size": 2833056,
3030
"CAB-5d40f7cad7c871cf2ad2af19ac542994.resS-Flags": 0,
3131
"CAB-5d40f7cad7c871cf2ad2af19ac542994.resS-Data": {
3232
"$type": "System.Byte[], System.Private.CoreLib",
33-
"$value": "1EbOvGzg570AAAAAp7usNAAAAACIMTss7JkWvQK1+r0AAAAAo7vENAAAAACvMfQlpl6zvAK1+r1FLwc6qK7cIPU7AAC0MOoqNa51vGzg571Snc86XLFgIOM7AADaMJgtm+CgvA=="
33+
"$value": "SZNGaqjqeviLk0ZqCy8lteyjh3J6+Pr/apNnci0tCwJqk8h6eHz+rgmDZ2pa+L4qCYNnan17/qiIagZa7vr84KhyR2IirdWrqHInYmvy+jwJg0dqDS++vmmTx4K+Ljc1qqMmag=="
3434
},
3535
"CAB-5d40f7cad7c871cf2ad2af19ac542994.resource-Size": 5248,
3636
"CAB-5d40f7cad7c871cf2ad2af19ac542994.resource-Flags": 0,

UnityFileSystem.Tests/UnityFileSystemTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4+
using System.IO.Compression;
45
using System.Linq;
56
using System.Text;
67
using NUnit.Framework;
@@ -16,6 +17,12 @@ public ArchiveTests(Context context) : base(context)
1617
{
1718
}
1819

20+
protected override void OnCreate()
21+
{
22+
// Uncomment to regenerate expected data.
23+
//ExpectedDataGenerator.GenerateAll();
24+
}
25+
1926
[OneTimeSetUp]
2027
public void Setup()
2128
{

UnityFileSystem/TypeTreeReaders/RandomAccessReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace UnityDataTools.FileSystem.TypeTreeReaders;
1111
// used instead (see the TextDumper library).
1212
//
1313
// Typical usage: randomAccessReader["prop"]["subProp"].GetValue<int>()
14-
// See the Processors in the Analyzer library for more examples.
14+
// See the SerializedObjects in the Analyzer library for more examples.
1515
//
1616
// This class is optimized to read the least amount of data from the file when accessing properties of a serialized
1717
// object. It is required because the TypeTree doesn't provide the size of the serialized data when it is

0 commit comments

Comments
 (0)