Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreign typed records: Implement IDisposable #1112

Merged
merged 1 commit into from
Aug 18, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace {Namespace.GetPublicName(record.Namespace)};
// AUTOGENERATED FILE - DO NOT MODIFY

{PlatformSupportAttribute.Render(record as GirModel.PlatformDependent)}
public partial class {name} : GLib.BoxedRecord
public partial class {name} : GLib.BoxedRecord, IDisposable
{{
public {internalHandleName} Handle {{ get; }}

Expand All @@ -49,6 +49,11 @@ System.IntPtr GLib.BoxedRecord.GetHandle()
}}

{FunctionRenderer.Render(record.TypeFunction)}

public void Dispose()
{{
Handle.Dispose();
}}
}}";
}
}
9 changes: 8 additions & 1 deletion src/Tests/Libs/Cairo-1.0.Tests/ContextTest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
using FluentAssertions;
using System;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Cairo.Tests;

[TestClass, TestCategory("UnitTest")]
public class ContextTest : Test
{
[TestMethod]
public void ImplementsIDisposable()
{
typeof(Context).Should().Implement<IDisposable>();
}

[TestMethod]
public void BindingsShouldSucceed()
{
Expand Down
9 changes: 8 additions & 1 deletion src/Tests/Libs/Cairo-1.0.Tests/FontFaceTest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
using FluentAssertions;
using System;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Cairo.Tests;

[TestClass, TestCategory("UnitTest")]
public class FontFaceTest : Test
{
[TestMethod]
public void ImplementsIDisposable()
{
typeof(FontFace).Should().Implement<IDisposable>();
}

[TestMethod]
public void BindingsShouldSucceed()
{
Expand Down
9 changes: 8 additions & 1 deletion src/Tests/Libs/Cairo-1.0.Tests/PatternTest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
using FluentAssertions;
using System;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Cairo.Tests;

[TestClass, TestCategory("UnitTest")]
public class PatternTest : Test
{
[TestMethod]
public void ImplementsIDisposable()
{
typeof(Pattern).Should().Implement<IDisposable>();
}

[TestMethod]
public void BindingsShouldSucceed()
{
Expand Down
9 changes: 8 additions & 1 deletion src/Tests/Libs/Cairo-1.0.Tests/ScaledFontTest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
using FluentAssertions;
using System;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Cairo.Tests;

[TestClass, TestCategory("UnitTest")]
public class ScaledFontTest : Test
{
[TestMethod]
public void ImplementsIDisposable()
{
typeof(ScaledFont).Should().Implement<IDisposable>();
}

[TestMethod]
public void BindingsShouldSucceed()
{
Expand Down
Loading