Skip to content

Commit ef7b652

Browse files
[#53] Rename view_managed_reference_types to managed_reference_stats_view; fix test whitespace
1 parent 75e82cb commit ef7b652

8 files changed

Lines changed: 21 additions & 21 deletions

File tree

‎Analyzer.Tests/FileDetectionTests.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,10 @@ public void TryParseMetadata_V22PrefabWithSerializedReference_ReturnsExpectedObj
512512
for (int i = 0; i < expected.Length; i++)
513513
{
514514
var obj = metadata.ObjectList[i];
515-
Assert.That(obj.Id, Is.EqualTo(expected[i].Id), $"ObjectList[{i}].Id");
515+
Assert.That(obj.Id, Is.EqualTo(expected[i].Id), $"ObjectList[{i}].Id");
516516
Assert.That(obj.TypeId, Is.EqualTo(expected[i].TypeId), $"ObjectList[{i}].TypeId");
517517
Assert.That(obj.Offset, Is.EqualTo(expected[i].Offset), $"ObjectList[{i}].Offset");
518-
Assert.That(obj.Size, Is.EqualTo(expected[i].Size), $"ObjectList[{i}].Size");
518+
Assert.That(obj.Size, Is.EqualTo(expected[i].Size), $"ObjectList[{i}].Size");
519519
}
520520
}
521521

‎Analyzer/Resources/Init.sql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ SELECT
143143
FROM managed_references m
144144
INNER JOIN object_view o ON m.object = o.id;
145145

146-
CREATE VIEW view_managed_reference_types AS
146+
CREATE VIEW managed_reference_stats_view AS
147147
-- Each distinct [SerializeReference] type: instance count, holding objects and total size.
148148
SELECT
149149
class_name,

‎Documentation/analyze-examples.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ the outer class name.
178178
To see every type used, how often, and how many bytes its instances take:
179179

180180
```
181-
SELECT * FROM view_managed_reference_types;
181+
SELECT * FROM managed_reference_stats_view;
182182
```
183183

184184
`managed_reference_view` shows the name of the holding object, but not its own C# class. The C#

‎Documentation/analyzer-schema.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ AssetBundle and scripting:
6969
| [`script_object_view`](#script_object_view) | MonoBehaviours and ScriptableObjects with their C# type |
7070
| [`managed_references`](#managed_references) | `[SerializeReference]` instance held by a MonoBehaviour / ScriptableObject |
7171
| [`managed_reference_view`](#managed_reference_view) | those instances with the object that holds them |
72-
| [`view_managed_reference_types`](#view_managed_reference_types) | instance count and total size per `[SerializeReference]` type |
72+
| [`managed_reference_stats_view`](#managed_reference_stats_view) | instance count and total size per `[SerializeReference]` type |
7373

7474
Type-specific views, each `object_view` plus extra columns:
7575

@@ -457,7 +457,7 @@ instance has one row. Null references have no row.
457457
`managed_references` with the holding MonoBehaviour's `id`, `object_id`, `name`, `archive` and
458458
`serialized_file` from [`object_view`](#object_view).
459459

460-
## view_managed_reference_types
460+
## managed_reference_stats_view
461461

462462
One row per distinct `[SerializeReference]` type, with `instances` (row count), `objects` (distinct
463463
holding MonoBehaviours) and `total_size`, most used first.
@@ -596,7 +596,7 @@ Any schema change - a new or changed table, view or column - must bump the pragm
596596
| 7 | Unity 6.6 `build_reports` columns and `build_report_content_*` tables ([#107](https://github.com/Unity-Technologies/UnityDataTools/issues/107)); `asset_name` / `asset_extension` columns on `build_report_source_assets` ([#110](https://github.com/Unity-Technologies/UnityDataTools/issues/110)) |
597597
| 8 | `archives.name` is the path relative to the scanned directory, not the bare file name ([#149](https://github.com/Unity-Technologies/UnityDataTools/issues/149)) |
598598
| 9 | `content_layout*` tables track the version 3 layout schema of Unity 6.7: loadables keyed by `loadable_index`, `stable_id` / `artifact_index` columns replace `cfid` / `content_hash`, `is_root_asset` records the root position, and the v2-only columns (`asset_path`, `source_lfid`) exist only in databases imported from a version 2 layout ([#131](https://github.com/Unity-Technologies/UnityDataTools/issues/131)) |
599-
| 10 | Added the `managed_references` table, `managed_reference_view` and `view_managed_reference_types` ([#53](https://github.com/Unity-Technologies/UnityDataTools/issues/53)) |
599+
| 10 | Added the `managed_references` table, `managed_reference_view` and `managed_reference_stats_view` ([#53](https://github.com/Unity-Technologies/UnityDataTools/issues/53)) |
600600

601601
## Related documentation
602602

‎UnityDataTool.Tests/AnalyzeV26Tests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public async Task Analyze_Version26_RecordsEveryManagedReference()
6565
SQLTestHelper.AssertQueryInt(db, "SELECT COUNT(DISTINCT rid) FROM managed_references", 9, "distinct rids");
6666

6767
SQLTestHelper.AssertQueryInt(db,
68-
"SELECT instances FROM view_managed_reference_types WHERE class_name = 'ManagedReferenceTestBehaviour/Shape'",
68+
"SELECT instances FROM managed_reference_stats_view WHERE class_name = 'ManagedReferenceTestBehaviour/Shape'",
6969
4, "Shape instances");
7070
SQLTestHelper.AssertQueryInt(db,
7171
"SELECT size FROM managed_references WHERE class_name = 'ManagedReferenceTestBehaviour/TexturedShape'",

‎UnityDataTool.Tests/BuildReportTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public async Task Analyze_BuildReport_ContainsExpected_ObjectInfo(
8080
// There can be other more obscure objects present, depending on the build,
8181
// e.g. PluginBuildInfo, AudioBuildInfo, VideoBuildInfo etc.
8282
var ttlObjCount = SQLTestHelper.QueryInt(db, "SELECT COUNT(*) FROM objects");
83-
Assert.That(ttlObjCount, Is.GreaterThanOrEqualTo(1+ packedAssetCount + 1),
83+
Assert.That(ttlObjCount, Is.GreaterThanOrEqualTo(1 + packedAssetCount + 1),
8484
"Unexpected number of objects in BuildReport analysis");
8585

8686
SQLTestHelper.AssertQueryInt(db, "SELECT COUNT(*) FROM archives", 0,

‎UnityDataTool.Tests/SerializedFileCommandTests.cs‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -311,24 +311,24 @@ public async Task ObjectList_NoTypeTree_JsonFormat_OutputsExpectedValues()
311311

312312
// Spot-check a few entries by index
313313
var first = jsonArray[0];
314-
Assert.AreEqual(1, first.GetProperty("id").GetInt64());
315-
Assert.AreEqual(1, first.GetProperty("typeId").GetInt32());
314+
Assert.AreEqual(1, first.GetProperty("id").GetInt64());
315+
Assert.AreEqual(1, first.GetProperty("typeId").GetInt32());
316316
Assert.AreEqual("GameObject", first.GetProperty("typeName").GetString());
317-
Assert.AreEqual(576, first.GetProperty("offset").GetInt64());
318-
Assert.AreEqual(63, first.GetProperty("size").GetInt64());
317+
Assert.AreEqual(576, first.GetProperty("offset").GetInt64());
318+
Assert.AreEqual(63, first.GetProperty("size").GetInt64());
319319

320320
var third = jsonArray[2];
321-
Assert.AreEqual(3, third.GetProperty("id").GetInt64());
322-
Assert.AreEqual(104, third.GetProperty("typeId").GetInt32());
321+
Assert.AreEqual(3, third.GetProperty("id").GetInt64());
322+
Assert.AreEqual(104, third.GetProperty("typeId").GetInt32());
323323
Assert.AreEqual("RenderSettings", third.GetProperty("typeName").GetString());
324-
Assert.AreEqual(720, third.GetProperty("offset").GetInt64());
324+
Assert.AreEqual(720, third.GetProperty("offset").GetInt64());
325325

326326
var last = jsonArray[6];
327-
Assert.AreEqual(7, last.GetProperty("id").GetInt64());
328-
Assert.AreEqual(114, last.GetProperty("typeId").GetInt32());
327+
Assert.AreEqual(7, last.GetProperty("id").GetInt64());
328+
Assert.AreEqual(114, last.GetProperty("typeId").GetInt32());
329329
Assert.AreEqual("MonoBehaviour", last.GetProperty("typeName").GetString());
330-
Assert.AreEqual(1200, last.GetProperty("offset").GetInt64());
331-
Assert.AreEqual(44, last.GetProperty("size").GetInt64());
330+
Assert.AreEqual(1200, last.GetProperty("offset").GetInt64());
331+
Assert.AreEqual(44, last.GetProperty("size").GetInt64());
332332
}
333333
finally
334334
{

‎UnityDataTool.Tests/UnityDataToolAssetBundleTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ public async Task Analyze_ManagedReferences_DatabaseContainsExpectedContent(
361361
"AND assembly_name LIKE 'Assembly-CSharp%' AND size = 8",
362362
1, "Orange instance");
363363
SQLTestHelper.AssertQueryInt(db,
364-
"SELECT COUNT(*) FROM view_managed_reference_types WHERE instances = 1 AND objects = 1", 2,
364+
"SELECT COUNT(*) FROM managed_reference_stats_view WHERE instances = 1 AND objects = 1", 2,
365365
"one row per SerializeReference type");
366366
}
367367

0 commit comments

Comments
 (0)