Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Foundation/NSObject2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ namespace Foundation {
[SupportedOSPlatform ("tvos")]
public enum NSObjectFlag {
/// <summary>Sentinel instance.</summary>
/// <remarks>To be added.</remarks>
Empty,
}

Expand Down
1 change: 0 additions & 1 deletion src/avfoundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ enum AVFileTypes {
QuickTimeMovie = 0,

/// <summary>Indicates the MPEG-4 format.</summary>
/// <remarks>Typically files using format has an .mp4 extension.</remarks>
[Field ("AVFileTypeMPEG4")]
Mpeg4 = 1,

Expand Down
29 changes: 29 additions & 0 deletions tests/cecil-tests/Documentation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,35 @@ public void VerifyEveryVisibleMemberIsDocumented ()
}
}

[Test]
public void NoRemarksOnEnumFields ()
{
var xmlEnumFieldsWithRemarks = new Dictionary<string, string> ();
foreach (var info in Helper.NetPlatformAssemblyDefinitions) {
// create a dictionary lookup of all types in the assembly
var allTypes = info.Assembly.EnumerateTypes ().ToDictionary (k => k.FullName.Replace ('/', '.'), v => v);
// load the xml documentation, filtering to fields with a <remarks> section
var xmlPath = Path.ChangeExtension (info.Path, ".xml");
var doc = new XmlDocument ();
doc.LoadWithoutNetworkAccess (xmlPath);
foreach (XmlNode node in doc.SelectNodes ("/doc/members/member[starts-with(@name,'F:') and ./remarks]")!) {
var name = node.Attributes! ["name"]!.Value;

// extract the type name from the member name, and use it to check if the field's type is an enum
var typename = name [2..name.LastIndexOf ('.')];
var type = allTypes [typename];
if (!type.IsEnum)
continue;

// the field has a <remarks> section, and it's an enum field - record it as a failure
var remarks = node.SelectSingleNode ("remarks")?.InnerText ?? "";
xmlEnumFieldsWithRemarks [name] = remarks;
}
}

Assert.That (xmlEnumFieldsWithRemarks, Is.Empty, "No enum fields with <remarks> documentation.");
}

static HashSet<AssemblyApi> GetDocumentedMembers (string xml)
{
var rv = new HashSet<AssemblyApi> ();
Expand Down
Loading