Skip to content

Commit 78a18ba

Browse files
committed
fixed TestRuntime not building in Release mode
1 parent cacd453 commit 78a18ba

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

src/embed_tests/TestRuntime.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ public static void RefCountTest()
5555
Assert.AreEqual(1, Runtime.Runtime.Refcount32(p));
5656

5757
// XIncref/XDecref increase and decrease RefCount
58+
#pragma warning disable CS0618 // Type or member is obsolete. We are testing corresponding members
5859
Runtime.Runtime.XIncref(p);
5960
Assert.AreEqual(2, Runtime.Runtime.Refcount32(p));
60-
Runtime.Runtime.XDecref(p);
61+
Runtime.Runtime.XDecref(op.Steal());
6162
Assert.AreEqual(1, Runtime.Runtime.Refcount32(p));
63+
#pragma warning restore CS0618 // Type or member is obsolete
6264

6365
op.Dispose();
6466

src/runtime/runtime.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -664,16 +664,6 @@ internal static unsafe void XIncref(BorrowedReference op)
664664
#endif
665665
}
666666

667-
668-
#if DEBUG
669-
[Obsolete("Do not use")]
670-
#else
671-
[Obsolete("Do not use", error: true)]
672-
#endif
673-
internal static unsafe void XDecref(BorrowedReference op)
674-
{
675-
XDecref(StolenReference.DangerousFromPointer(op.DangerousGetAddress()));
676-
}
677667
internal static unsafe void XDecref(StolenReference op)
678668
{
679669
#if DEBUG

0 commit comments

Comments
 (0)