Files
Il2CppInspectorRedux/Il2CppTests/TestCppTypes.cs
Katy Coe 8a85acb242 C++: Various tweaks
Indent output
Handle bool fields
Skip comments and methods
Check that every line that matters is parsed
Update test to check every Unity version
2020-07-04 02:30:50 +02:00

41 lines
1.2 KiB
C#

/*
Copyright 2020 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
All rights reserved.
*/
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using Il2CppInspector.CppUtils;
using Il2CppInspector.CppUtils.UnityHeaders;
using Il2CppInspector.Reflection;
using NUnit.Framework;
namespace Il2CppInspector
{
[TestFixture]
public partial class FixedTests
{
[Test]
public void TestCppTypes() {
// NOTE: This test doesn't check for correct results, only that parsing doesn't fail!
var unityAllHeaders = UnityHeader.GetAllHeaders();
// Ensure we have read the embedded assembly resources
Assert.IsTrue(unityAllHeaders.Any());
// Ensure we can interpret every header from every version of Unity without errors
// This will throw InvalidOperationException if there is a problem
foreach (var unityHeader in unityAllHeaders) {
var cppTypes = CppTypes.FromUnityHeaders(unityHeader);
foreach (var cppType in cppTypes.Types)
Debug.WriteLine("// " + cppType.Key + "\n" + cppType.Value + "\n");
}
}
}
}