Skip to content

Commit 3bea0de

Browse files
Updating the Windows metadata files with the latest version and fixed a minor issue in the cpp formatter (#551)
Co-authored-by: @anmeng10101 <[email protected]>
1 parent 1ad91bf commit 3bea0de

5 files changed

Lines changed: 46 additions & 5 deletions

File tree

512 Bytes
Binary file not shown.
1.15 MB
Binary file not shown.

mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppFullMemberFormatter.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ protected override StringBuilder AppendTypeName (StringBuilder buf, TypeReferenc
112112
string typeFullName = type.FullName;
113113
if (string.IsNullOrWhiteSpace (typeFullName))
114114
return buf;
115-
116-
if (!typeFullName.StartsWith ("System."))
117-
{
118-
return base.AppendTypeName(buf, type, context);
119-
}
120115

121116
string cppType = GetCppType(typeFullName);
122117
if (cppType != null)

mdoc/mdoc.Test/CppCxFormatterMembersTests.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class CppCxFormatterMembersTests : BasicFormatterTests<CppCxFullMemberFor
1212
{
1313
protected override CppCxFullMemberFormatter formatter { get; } = new CppCxFullMemberFormatter();
1414

15+
private string _cppWinRtTestLibName = "../../../../external/Windows/Windows.Foundation.UniversalApiContract.winmd";
1516
private const string CppCxTestLibName = "../../../../external/Test/UwpTestWinRtComponentCpp.winmd";
1617
private const string CSharpTestLib = "../../../../external/Test/CSharpExample.dll";
1718

@@ -92,6 +93,13 @@ public void Field_EnumField()
9293
TestFieldSignature(CppCxTestLibName, "UwpTestWinRtComponentCpp.Color1", "Red", "Red");
9394
}
9495

96+
[Test]
97+
[Category("Field")]
98+
public void Field_WinRtNumericsPlaneNormal()
99+
{
100+
TestFieldSignature(_cppWinRtTestLibName, "Windows.Foundation.Numerics.Plane", "Normal", "public: float3 Normal;");
101+
}
102+
95103
[Test]
96104
[Category("Field")]
97105
public void Field_ValueType_String()
@@ -107,6 +115,21 @@ public void Event_Class1_primeFoundEvent()
107115
event UwpTestWinRtComponentCpp::PrimeFoundHandler ^ primeFoundEvent;");
108116
}
109117

118+
[Test]
119+
[Category("Properties")]
120+
public void Property_WinRtNumericsActualSize()
121+
{
122+
TestPropertySignature(_cppWinRtTestLibName, "Windows.UI.Xaml.UIElement", "ActualSize", "public:\n property float2 ActualSize { float2 get(); };");
123+
}
124+
125+
[Test]
126+
[Category("Properties")]
127+
public void Property_WinRtNumericsTransformMatrix()
128+
{
129+
TestPropertySignature(_cppWinRtTestLibName, "Windows.UI.Xaml.UIElement", "TransformMatrix",
130+
"public:\n property float4x4 TransformMatrix { float4x4 get(); void set(float4x4 value); };");
131+
}
132+
110133
[Test]
111134
[Category("Properties")]
112135
public void Property_FundamentalType()

mdoc/mdoc.Test/CppWinRtMembersTests.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class CppWinRtMembersTests: BasicFormatterTests<CppWinRtFullMemberFormatt
1212
private static readonly CppWinRtFullMemberFormatter CppWinRtFullMemberFormatter = new CppWinRtFullMemberFormatter();
1313
protected override CppWinRtFullMemberFormatter formatter => CppWinRtFullMemberFormatter;
1414

15+
private string _cppWinRtTestLibName = "../../../../external/Windows/Windows.Foundation.UniversalApiContract.winmd";
1516
private string CppCxTestLibName = "../../../../external/Test/UwpTestWinRtComponentCpp.winmd";
1617
private const string CSharpTestLib = "../../../../external/Test/CSharpExample.dll";
1718

@@ -80,6 +81,28 @@ public void Method_WinRtTypeInterfaceImplementation()
8081
@"void SetWindow(winrt::Windows::UI::Core::CoreWindow const& window);");
8182
}
8283

84+
[Test]
85+
[Category("Properties")]
86+
public void Property_WinRtNumericsActualSize()
87+
{
88+
TestPropertySignature(_cppWinRtTestLibName, "Windows.UI.Xaml.UIElement", "ActualSize", "float2 ActualSize();");
89+
}
90+
91+
[Test]
92+
[Category("Properties")]
93+
public void Property_WinRtNumericsTransformMatrix()
94+
{
95+
TestPropertySignature(_cppWinRtTestLibName, "Windows.UI.Xaml.UIElement", "TransformMatrix",
96+
"float4x4 TransformMatrix();\n\nvoid TransformMatrix(float4x4 value);");
97+
}
98+
99+
[Test]
100+
[Category("Fields")]
101+
public void Field_WinRtNumericsPlaneNormal()
102+
{
103+
TestFieldSignature(_cppWinRtTestLibName, "Windows.Foundation.Numerics.Plane", "Normal", "float3 Normal;");
104+
}
105+
83106
[Test]
84107
[Category("Fields")]
85108
public void FieldSignature_ConstLong() =>

0 commit comments

Comments
 (0)