Skip to content

Commit

Permalink
test for private classes (xamarin#15292)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-hawley authored Jun 16, 2022
1 parent 771478a commit 357adfd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tools/nnyeah/integration/API/IntegrationAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,23 @@ public class NFloatArgs
public delegate void EventWithNUInt(object sender, NUIntArgs e);
public delegate void EventWithNFloat(object sender, NFloatArgs e);


public interface INum
{
NSNumber Zero ();
}

public class NIntAPI
{
class MyNum : INum
{
public MyNum () { }
public NSNumber Zero () {
nint x = 0;
return new NSNumber (x);
}
}

public NIntAPI ()
{
}
Expand All @@ -53,6 +68,7 @@ public NIntAPI ()
public nint ToNint (char a) => a;
public nint ToNint (int a) => a;
public nint PlusOne (nint a) => a++;
public nint NumberZero () => new MyNum ().Zero ().NIntValue;
}

public class NUIntAPI
Expand Down
3 changes: 3 additions & 0 deletions tools/nnyeah/integration/Consumer/Consumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ static void NIntTest (StringBuilder output)
if (n.PlusOne (7) != (nint)8) {
output.AppendLine ("nint ++ failure");
}
if (n.NumberZero () != (nint)0) {
output.AppendLine ("nested usage failure");
}
}

static void NUIntTest (StringBuilder output)
Expand Down

0 comments on commit 357adfd

Please sign in to comment.