Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/api-doc-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Chen <59190910+JeffInChrist@users.noreply.github.com>2021-04-15 16:31:41 +0300
committerGitHub <noreply@github.com>2021-04-15 16:31:41 +0300
commitb65966eace83a9ffa5ba5bb5dc2a12754084bd29 (patch)
treeb68592dfebc6c5c6377551c5322e6f0f85bf0ce9
parent11feb86f91652dab03d170a9bd8fd9c1d4ce6849 (diff)
Enabling Guid type projection for C++/WinRT and C++/CX. (#546)
https://dev.azure.com/ceapex/Engineering/_workitems/edit/344653
-rw-r--r--mdoc/Makefile11
-rw-r--r--mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppCxFullMemberFormatter.cs6
-rw-r--r--mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppFullMemberFormatter.cs5
-rw-r--r--mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppWinRtFullMemberFormatter.cs3
-rw-r--r--mdoc/Test/en.expected-cppcx2/Mono.DocTest.Generic/MyList`1.xml2
-rw-r--r--mdoc/Test/en.expected-cppcx2/Mono.DocTest/Widget.xml1
-rw-r--r--mdoc/Test/en.expected-cppcx2/System/Array.xml2
-rw-r--r--mdoc/Test/en.expected-guid/index.xml22
-rw-r--r--mdoc/Test/en.expected-guid/mdoc.Test.SampleClasses/GuidClass.xml102
-rw-r--r--mdoc/Test/en.expected-guid/ns-mdoc.Test.SampleClasses.xml6
-rw-r--r--mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml2
-rw-r--r--mdoc/Test/en.expected/Mono.DocTest/Widget.xml1
-rw-r--r--mdoc/Test/en.expected/System/Array.xml2
-rw-r--r--mdoc/mdoc.Test/CppCxFormatterMembersTests.cs29
-rw-r--r--mdoc/mdoc.Test/CppWinRtMembersTests.cs19
-rw-r--r--mdoc/mdoc.Test/FormatterTests.cs17
-rw-r--r--mdoc/mdoc.Test/SampleClasses/GuidClass.cs17
-rw-r--r--mdoc/mdoc.Test/UwpTestWinRtComponentCpp/Class1.cpp2
-rw-r--r--mdoc/mdoc.Test/mdoc.Test.csproj1
19 files changed, 238 insertions, 12 deletions
diff --git a/mdoc/Makefile b/mdoc/Makefile
index 4393b0d7..69403d6a 100644
--- a/mdoc/Makefile
+++ b/mdoc/Makefile
@@ -726,6 +726,9 @@ check-monodocer-attached-entities:
Test/TestClass.dll:
$(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -debug -optimize -target:library -out:$@ mdoc.Test/SampleClasses/Test*.cs
+Test/GuidClass.dll:
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -debug -optimize -target:library -out:$@ mdoc.Test/SampleClasses/GuidClass.cs
+
.PHONY: check-monodocer-operators-work
check-monodocer-operators-work: Test/TestClass.dll
rm -Rf Test/en.actual
@@ -742,6 +745,11 @@ check-monodocer-operators-update: check-monodocer-operators-work
rm -Rf Test/en.expected-operators
mv Test/en.actual Test/en.expected-operators
+check-monodocer-guid: Test/GuidClass.dll
+ rm -Rf Test/en.actual
+ $(MONO) $(PROGRAM) update -o Test/en.actual Test/GuidClass.dll -lang c++/cx -lang c++/winrt
+ $(DIFF) Test/en.expected-guid Test/en.actual
+
check-mdoc-export-html-update:
find Test/html.expected -name \*.html -exec rm "{}" \;
$(MONO) $(PROGRAM) export-html -o Test/html.expected \
@@ -856,6 +864,7 @@ check-doc-tools: \
check-monodocer-frameworks-inheritance \
check-monodocer-docid \
check-monodocer-operators \
+ check-monodocer-guid \
check-monodocer-fx-statistics-remove \
check-overwrite-attribute \
check-monodocer-vbnet \
@@ -887,5 +896,5 @@ check-doc-tools-update: check-monodocer-since-update \
check-mdoc-export-msxdoc-update \
check-mdoc-validate-update
-check: nunit check-doc-tools
+check: nunit check-doc-tools
@echo "mdoc Tests Complete!"
diff --git a/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppCxFullMemberFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppCxFullMemberFormatter.cs
index efba11be..0c158189 100644
--- a/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppCxFullMemberFormatter.cs
+++ b/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppCxFullMemberFormatter.cs
@@ -62,6 +62,7 @@ namespace Mono.Documentation.Updater.Formatters.CppFormatters
"System.String",
"System.ValueType",
"System.Enum",
+ "System.Guid",
};
protected virtual IList<string> GetAllowedTypes()
@@ -106,7 +107,7 @@ namespace Mono.Documentation.Updater.Formatters.CppFormatters
if (t.Contains(' '))
{
splitType = t.Split(' ');
- typeToCompare = splitType[0];
+ typeToCompare = splitType[0].Trim('&');
}
switch (typeToCompare)
@@ -125,6 +126,7 @@ namespace Mono.Documentation.Updater.Formatters.CppFormatters
case "System.Boolean": typeToCompare = "bool"; break;
case "System.Char": typeToCompare = "char16"; break;
case "System.Void": typeToCompare = "void"; break;
+ case "System.Guid": typeToCompare = "Platform::Guid"; break;
case "System.String": typeToCompare = "Platform::String"; break;
case "System.Object": typeToCompare = "Platform::Object"; break;
case "System.Type": typeToCompare = "Platform::Type"; break;
@@ -330,7 +332,7 @@ namespace Mono.Documentation.Updater.Formatters.CppFormatters
}
}
- if (allowedTypes.Contains(tref.FullName.Split(' ')[0]) || CppCxSpecificNamespases.Contains(tref.Namespace))
+ if (allowedTypes.Contains(tref.FullName.Split(' ')[0].Trim('&')) || CppCxSpecificNamespases.Contains(tref.Namespace))
{
return true;
}
diff --git a/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppFullMemberFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppFullMemberFormatter.cs
index 1ae7b91a..171ca144 100644
--- a/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppFullMemberFormatter.cs
+++ b/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppFullMemberFormatter.cs
@@ -733,7 +733,10 @@ namespace Mono.Documentation.Updater.Formatters.CppFormatters
if (IsParamsParameter(parameter))
buf.AppendFormat ("... ");
- buf.Append(GetTypeNameWithOptions(parameter.ParameterType, AppendHatOnReturn)).Append(" ");
+ buf.Append(GetTypeNameWithOptions(parameter.ParameterType, AppendHatOnReturn));
+ if (!buf.ToString().EndsWith(" "))
+ buf.Append(" ");
+
buf.Append(parameter.Name);
return buf;
diff --git a/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppWinRtFullMemberFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppWinRtFullMemberFormatter.cs
index e2031b90..f4a2a199 100644
--- a/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppWinRtFullMemberFormatter.cs
+++ b/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppWinRtFullMemberFormatter.cs
@@ -41,7 +41,7 @@ namespace Mono.Documentation.Updater.Formatters.CppFormatters
if (t.Contains(' '))
{
splitType = t.Split(' ');
- typeToCompare = splitType[0];
+ typeToCompare = splitType[0].Trim('&');
foreach (var str in splitType)
{
@@ -71,6 +71,7 @@ namespace Mono.Documentation.Updater.Formatters.CppFormatters
case "System.Void": typeToCompare = "void"; break;
//API specific type is "winrt::hstring"; but c++ in built type is better variant
case "System.String": typeToCompare = "winrt::hstring"; break;
+ case "System.Guid": typeToCompare = "winrt::guid"; break;
case "System.Object": typeToCompare = "winrt::Windows::Foundation::IInspectable"; break;
}
diff --git a/mdoc/Test/en.expected-cppcx2/Mono.DocTest.Generic/MyList`1.xml b/mdoc/Test/en.expected-cppcx2/Mono.DocTest.Generic/MyList`1.xml
index 3a95c108..d7282c63 100644
--- a/mdoc/Test/en.expected-cppcx2/Mono.DocTest.Generic/MyList`1.xml
+++ b/mdoc/Test/en.expected-cppcx2/Mono.DocTest.Generic/MyList`1.xml
@@ -120,7 +120,7 @@
<Member MemberName="RefMethod&lt;U&gt;">
<MemberSignature Language="C#" Value="public void RefMethod&lt;U&gt; (ref T t, ref U u);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RefMethod&lt;U&gt;(!T&amp; t, !!U&amp; u) cil managed" />
- <MemberSignature Language="C++ CX" Value="public:&#xA;generic &lt;typename U&gt;&#xA; void RefMethod(T &amp; t, U &amp; u);" />
+ <MemberSignature Language="C++ CX" Value="public:&#xA;generic &lt;typename U&gt;&#xA; void RefMethod(T &amp; t, U &amp; u);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
diff --git a/mdoc/Test/en.expected-cppcx2/Mono.DocTest/Widget.xml b/mdoc/Test/en.expected-cppcx2/Mono.DocTest/Widget.xml
index ab7b139b..ddad4349 100644
--- a/mdoc/Test/en.expected-cppcx2/Mono.DocTest/Widget.xml
+++ b/mdoc/Test/en.expected-cppcx2/Mono.DocTest/Widget.xml
@@ -452,6 +452,7 @@
<Member MemberName="M1">
<MemberSignature Language="C#" Value="public void M1 (char c, out float f, ref Mono.DocTest.DocValueType v);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void M1(char c, [out] float32&amp; f, valuetype Mono.DocTest.DocValueType&amp; v) cil managed" />
+ <MemberSignature Language="C++ CX" Value="public:&#xA; void M1(char16 c, [Runtime::InteropServices::Out] float &amp; f, Mono::DocTest::DocValueType &amp; v);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
diff --git a/mdoc/Test/en.expected-cppcx2/System/Array.xml b/mdoc/Test/en.expected-cppcx2/System/Array.xml
index 964b5fc6..550201f1 100644
--- a/mdoc/Test/en.expected-cppcx2/System/Array.xml
+++ b/mdoc/Test/en.expected-cppcx2/System/Array.xml
@@ -83,7 +83,7 @@
<Member MemberName="Resize&lt;T&gt;">
<MemberSignature Language="C#" Value="public static void Resize&lt;T&gt; (ref T[] array, int newSize);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Resize&lt;T&gt;(!!T[]&amp; array, int32 newSize) cil managed" />
- <MemberSignature Language="C++ CX" Value="public:&#xA;generic &lt;typename T&gt;&#xA; static void Resize(Platform::Array &lt;T&gt; ^ &amp; array, int newSize);" />
+ <MemberSignature Language="C++ CX" Value="public:&#xA;generic &lt;typename T&gt;&#xA; static void Resize(Platform::Array &lt;T&gt; ^ &amp; array, int newSize);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
diff --git a/mdoc/Test/en.expected-guid/index.xml b/mdoc/Test/en.expected-guid/index.xml
new file mode 100644
index 00000000..9e662045
--- /dev/null
+++ b/mdoc/Test/en.expected-guid/index.xml
@@ -0,0 +1,22 @@
+<Overview>
+ <Assemblies>
+ <Assembly Name="GuidClass" Version="0.0.0.0">
+ <Attributes>
+ <Attribute>
+ <AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
+ </Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
+ </Attribute>
+ </Attributes>
+ </Assembly>
+ </Assemblies>
+ <Remarks>To be added.</Remarks>
+ <Copyright>To be added.</Copyright>
+ <Types>
+ <Namespace Name="mdoc.Test.SampleClasses">
+ <Type Name="GuidClass" Kind="Class" />
+ </Namespace>
+ </Types>
+ <Title>GuidClass</Title>
+</Overview>
diff --git a/mdoc/Test/en.expected-guid/mdoc.Test.SampleClasses/GuidClass.xml b/mdoc/Test/en.expected-guid/mdoc.Test.SampleClasses/GuidClass.xml
new file mode 100644
index 00000000..a6451db2
--- /dev/null
+++ b/mdoc/Test/en.expected-guid/mdoc.Test.SampleClasses/GuidClass.xml
@@ -0,0 +1,102 @@
+<Type Name="GuidClass" FullName="mdoc.Test.SampleClasses.GuidClass">
+ <TypeSignature Language="C#" Value="public class GuidClass" />
+ <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit GuidClass extends System.Object" />
+ <TypeSignature Language="C++ WINRT" Value="[Windows::Foundation::Metadata::WebHostHidden]&#xA;class GuidClass" />
+ <AssemblyInfo>
+ <AssemblyName>GuidClass</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Base>
+ <BaseTypeName>System.Object</BaseTypeName>
+ </Base>
+ <Interfaces />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ <Members>
+ <Member MemberName=".ctor">
+ <MemberSignature Language="C#" Value="public GuidClass (Guid guid);" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.Guid guid) cil managed" />
+ <MemberSignature Language="C++ CX" Value="public:&#xA; GuidClass(Platform::Guid guid);" />
+ <MemberSignature Language="C++ WINRT" Value=" GuidClass(winrt::guid const&amp; guid);" />
+ <MemberType>Constructor</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Parameters>
+ <Parameter Name="guid" Type="System.Guid" />
+ </Parameters>
+ <Docs>
+ <param name="guid">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="CreateNewGuid">
+ <MemberSignature Language="C#" Value="public static Guid CreateNewGuid ();" />
+ <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Guid CreateNewGuid() cil managed" />
+ <MemberSignature Language="C++ CX" Value="public:&#xA; static Platform::Guid CreateNewGuid();" />
+ <MemberSignature Language="C++ WINRT" Value=" static winrt::guid CreateNewGuid();" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Guid</ReturnType>
+ </ReturnValue>
+ <Parameters />
+ <Docs>
+ <summary>To be added.</summary>
+ <returns>To be added.</returns>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="IsUnique">
+ <MemberSignature Language="C#" Value="public bool IsUnique (Guid guid);" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool IsUnique(valuetype System.Guid guid) cil managed" />
+ <MemberSignature Language="C++ CX" Value="public:&#xA; bool IsUnique(Platform::Guid guid);" />
+ <MemberSignature Language="C++ WINRT" Value="bool IsUnique(winrt::guid const&amp; guid);" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Boolean</ReturnType>
+ </ReturnValue>
+ <Parameters>
+ <Parameter Name="guid" Type="System.Guid" />
+ </Parameters>
+ <Docs>
+ <param name="guid">To be added.</param>
+ <summary>To be added.</summary>
+ <returns>To be added.</returns>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="ObjectIndentical">
+ <MemberSignature Language="C#" Value="public bool ObjectIndentical (Guid objGuid1, Guid objGuid2);" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool ObjectIndentical(valuetype System.Guid objGuid1, valuetype System.Guid objGuid2) cil managed" />
+ <MemberSignature Language="C++ CX" Value="public:&#xA; bool ObjectIndentical(Platform::Guid objGuid1, Platform::Guid objGuid2);" />
+ <MemberSignature Language="C++ WINRT" Value="bool ObjectIndentical(winrt::guid const&amp; objGuid1, winrt::guid const&amp; objGuid2);" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Boolean</ReturnType>
+ </ReturnValue>
+ <Parameters>
+ <Parameter Name="objGuid1" Type="System.Guid" />
+ <Parameter Name="objGuid2" Type="System.Guid" />
+ </Parameters>
+ <Docs>
+ <param name="objGuid1">To be added.</param>
+ <param name="objGuid2">To be added.</param>
+ <summary>To be added.</summary>
+ <returns>To be added.</returns>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ </Members>
+</Type>
diff --git a/mdoc/Test/en.expected-guid/ns-mdoc.Test.SampleClasses.xml b/mdoc/Test/en.expected-guid/ns-mdoc.Test.SampleClasses.xml
new file mode 100644
index 00000000..80a5e984
--- /dev/null
+++ b/mdoc/Test/en.expected-guid/ns-mdoc.Test.SampleClasses.xml
@@ -0,0 +1,6 @@
+<Namespace Name="mdoc.Test.SampleClasses">
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+</Namespace>
diff --git a/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml b/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml
index a6e5e8db..877bd5fc 100644
--- a/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml
+++ b/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml
@@ -148,7 +148,7 @@
<MemberSignature Language="VB.NET" Value="Public Sub RefMethod(Of U) (ByRef t As T, ByRef u As U)" />
<MemberSignature Language="F#" Value="member this.RefMethod : 'T * 'U -&gt; unit" Usage="myList.RefMethod (t, u)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename U&gt;&#xA; void RefMethod(T % t, U % u);" />
- <MemberSignature Language="C++ CX" Value="public:&#xA;generic &lt;typename U&gt;&#xA; void RefMethod(T &amp; t, U &amp; u);" />
+ <MemberSignature Language="C++ CX" Value="public:&#xA;generic &lt;typename U&gt;&#xA; void RefMethod(T &amp; t, U &amp; u);" />
<MemberSignature Language="C++ WINRT" Value="template &lt;typename U&gt;&#xA; void RefMethod(T &amp; t, U &amp; u);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
diff --git a/mdoc/Test/en.expected/Mono.DocTest/Widget.xml b/mdoc/Test/en.expected/Mono.DocTest/Widget.xml
index 3acb20b6..75d5a02a 100644
--- a/mdoc/Test/en.expected/Mono.DocTest/Widget.xml
+++ b/mdoc/Test/en.expected/Mono.DocTest/Widget.xml
@@ -596,6 +596,7 @@
<MemberSignature Language="VB.NET" Value="Public Sub M1 (c As Char, ByRef f As Single, ByRef v As DocValueType)" />
<MemberSignature Language="F#" Value="member this.M1 : char * single * DocValueType -&gt; unit" Usage="widget.M1 (c, f, v)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void M1(char c, [Runtime::InteropServices::Out] float % f, Mono::DocTest::DocValueType % v);" />
+ <MemberSignature Language="C++ CX" Value="public:&#xA; void M1(char16 c, [Runtime::InteropServices::Out] float &amp; f, Mono::DocTest::DocValueType &amp; v);" />
<MemberSignature Language="C++ WINRT" Value="void M1(char const&amp; c, [Runtime::InteropServices::Out] float &amp; f, Mono::DocTest::DocValueType &amp; v);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
diff --git a/mdoc/Test/en.expected/System/Array.xml b/mdoc/Test/en.expected/System/Array.xml
index 6a0a209a..6980a7d2 100644
--- a/mdoc/Test/en.expected/System/Array.xml
+++ b/mdoc/Test/en.expected/System/Array.xml
@@ -105,7 +105,7 @@
<MemberSignature Language="VB.NET" Value="Public Shared Sub Resize(Of T) (ByRef array As T(), newSize As Integer)" />
<MemberSignature Language="F#" Value="static member Resize : T[] * int -&gt; unit" Usage="System.Array.Resize (array, newSize)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename T&gt;&#xA; static void Resize(cli::array &lt;T&gt; ^ % array, int newSize);" />
- <MemberSignature Language="C++ CX" Value="public:&#xA;generic &lt;typename T&gt;&#xA; static void Resize(Platform::Array &lt;T&gt; ^ &amp; array, int newSize);" />
+ <MemberSignature Language="C++ CX" Value="public:&#xA;generic &lt;typename T&gt;&#xA; static void Resize(Platform::Array &lt;T&gt; ^ &amp; array, int newSize);" />
<MemberSignature Language="C++ WINRT" Value="template &lt;typename T&gt;&#xA; static void Resize(std::Array &lt;T&gt; const&amp; &amp; array, int const&amp; newSize);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
diff --git a/mdoc/mdoc.Test/CppCxFormatterMembersTests.cs b/mdoc/mdoc.Test/CppCxFormatterMembersTests.cs
index 14500934..10b0378f 100644
--- a/mdoc/mdoc.Test/CppCxFormatterMembersTests.cs
+++ b/mdoc/mdoc.Test/CppCxFormatterMembersTests.cs
@@ -1,4 +1,5 @@
-using Mono.Documentation.Updater.Formatters.CppFormatters;
+using mdoc.Test.SampleClasses;
+using Mono.Documentation.Updater.Formatters.CppFormatters;
using Mono_DocTest;
using NUnit.Framework;
using Cpp = Mono_DocTest_Generic;
@@ -42,6 +43,32 @@ namespace mdoc.Test
Windows::Foundation::IAsyncActionWithProgress<double> ^ GetPrimesUnordered(int first, int last);");
}
+ //[Test]
+ //[Category("Method")]
+ //public void Method_CreateNewGuid()
+ //{
+ // TestMethodSignature(CppCxTestLibName, "UwpTestWinRtComponentCpp.Class1", "CreateNewGuid",
+ // @"public: Platform::Guid ^ CreateNewGuid();");
+ //}
+
+ [Test]
+ public void CreateNewGuid()
+ {
+ var member = GetMethod(typeof(GuidClass), m => m.Name == "CreateNewGuid");
+ var sig = formatter.GetDeclaration(member);
+ Assert.AreEqual(@"public:
+ static Platform::Guid CreateNewGuid();", sig);
+ }
+
+ [Test]
+ public void ObjectIndentical()
+ {
+ var member = GetMethod(typeof(GuidClass), m => m.Name == "ObjectIndentical");
+ var sig = formatter.GetDeclaration(member);
+ Assert.AreEqual(@"public:
+ bool ObjectIndentical(Platform::Guid objGuid1, Platform::Guid objGuid2);", sig);
+ }
+
[Test]
[Category("Method")]
public void Method_WinRtTypeInterfaceImplementation()
diff --git a/mdoc/mdoc.Test/CppWinRtMembersTests.cs b/mdoc/mdoc.Test/CppWinRtMembersTests.cs
index d40e4d29..3a33e69a 100644
--- a/mdoc/mdoc.Test/CppWinRtMembersTests.cs
+++ b/mdoc/mdoc.Test/CppWinRtMembersTests.cs
@@ -1,4 +1,5 @@
-using Mono.Documentation.Updater.Formatters.CppFormatters;
+using mdoc.Test.SampleClasses;
+using Mono.Documentation.Updater.Formatters.CppFormatters;
using Mono_DocTest;
using NUnit.Framework;
using Cpp = Mono_DocTest_Generic;
@@ -40,6 +41,22 @@ namespace mdoc.Test
}
[Test]
+ public void CreateNewGuid()
+ {
+ var member = GetMethod(typeof(GuidClass), m => m.Name == "CreateNewGuid");
+ var sig = formatter.GetDeclaration(member);
+ Assert.AreEqual(@" static winrt::guid CreateNewGuid();", sig);
+ }
+
+ [Test]
+ public void ObjectIndentical()
+ {
+ var member = GetMethod(typeof(GuidClass), m => m.Name == "ObjectIndentical");
+ var sig = formatter.GetDeclaration(member);
+ Assert.AreEqual(@"bool ObjectIndentical(winrt::guid const& objGuid1, winrt::guid const& objGuid2);", sig);
+ }
+
+ [Test]
[Category("Method")]
public void Method_DefaultParameters()
{
diff --git a/mdoc/mdoc.Test/FormatterTests.cs b/mdoc/mdoc.Test/FormatterTests.cs
index 439d9767..f7b60e4e 100644
--- a/mdoc/mdoc.Test/FormatterTests.cs
+++ b/mdoc/mdoc.Test/FormatterTests.cs
@@ -226,6 +226,23 @@ namespace mdoc.Test
var sig = formatter.GetDeclaration (member);
Assert.AreEqual (".method public hidebysig instance void RefAndOut(int32& a, [out] int32& b) cil managed", sig);
}
+
+ [Test]
+ public void CreateNewGuid()
+ {
+ var member = GetMethod(typeof(GuidClass), m => m.Name == "CreateNewGuid");
+ var sig = formatter.GetDeclaration(member);
+ Assert.AreEqual("public static Guid CreateNewGuid ();", sig);
+ }
+
+ [Test]
+ public void ObjectIndentical()
+ {
+ var member = GetMethod(typeof(GuidClass), m => m.Name == "ObjectIndentical");
+ var sig = formatter.GetDeclaration(member);
+ Assert.AreEqual("public bool ObjectIndentical (Guid objGuid1, Guid objGuid2);", sig);
+ }
+
[Test]
public void MethodSignature_Finalize() =>
TestMethodSignature(typeof(SomeGenericClass<>),
diff --git a/mdoc/mdoc.Test/SampleClasses/GuidClass.cs b/mdoc/mdoc.Test/SampleClasses/GuidClass.cs
new file mode 100644
index 00000000..9e355b19
--- /dev/null
+++ b/mdoc/mdoc.Test/SampleClasses/GuidClass.cs
@@ -0,0 +1,17 @@
+using System;
+
+namespace mdoc.Test.SampleClasses
+{
+ public class GuidClass
+ {
+ private readonly Guid _guid = Guid.Empty;
+
+ private GuidClass() { this._guid = Guid.NewGuid(); }
+
+ public GuidClass (Guid guid) { this._guid = guid; }
+
+ public static Guid CreateNewGuid() { return new Guid(); }
+ public bool ObjectIndentical(Guid objGuid1, Guid objGuid2) { return objGuid1 == objGuid2; }
+ public bool IsUnique(Guid guid) { return guid == _guid; }
+ }
+}
diff --git a/mdoc/mdoc.Test/UwpTestWinRtComponentCpp/Class1.cpp b/mdoc/mdoc.Test/UwpTestWinRtComponentCpp/Class1.cpp
index 44d5f4cf..bf2bd782 100644
--- a/mdoc/mdoc.Test/UwpTestWinRtComponentCpp/Class1.cpp
+++ b/mdoc/mdoc.Test/UwpTestWinRtComponentCpp/Class1.cpp
@@ -163,4 +163,4 @@ IAsyncActionWithProgress<double>^ Class1::GetPrimesUnordered(int first, int last
});
reporter.report(100.0);
});
-}
+} \ No newline at end of file
diff --git a/mdoc/mdoc.Test/mdoc.Test.csproj b/mdoc/mdoc.Test/mdoc.Test.csproj
index 11960802..6f33aeb6 100644
--- a/mdoc/mdoc.Test/mdoc.Test.csproj
+++ b/mdoc/mdoc.Test/mdoc.Test.csproj
@@ -97,6 +97,7 @@
<Compile Include="NullableReferenceTypesTests.cs" />
<Compile Include="SampleClasses\ApplePlatformEnum.cs" />
<Compile Include="SampleClasses\EiiImplementclass.cs" />
+ <Compile Include="SampleClasses\GuidClass.cs" />
<Compile Include="SampleClasses\Interface_A.cs" />
<Compile Include="SampleClasses\Interface_B.cs" />
<Compile Include="SampleClasses\InternalEIICalss.cs" />