-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a few complicated tests with interface sweeping and abstract classes involved. These tests are green on master. These tests are setup to come close to triggering a new feature I'm working on `lazy body marking`. I'm also tired of seeing the `Inheritance.Complex` tests showing up in the Solution Explorer as missing. Adding these tests provides something to run for that set of tests.
- Loading branch information
1 parent
9bfeb66
commit 13d864e
Showing
3 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
...nheritance.Complex/NoKeptCtor/OverrideOfAbstractAndInterfaceMethodWhenInterfaceRemoved.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
|
||
namespace Mono.Linker.Tests.Cases.Inheritance.Complex.NoKeptCtor { | ||
public class OverrideOfAbstractAndInterfaceMethodWhenInterfaceRemoved { | ||
public static void Main () | ||
{ | ||
Foo b = HelperToMarkFooAndRequireBase (); | ||
// Use IBar in another method so that IBar can be removed from Foo | ||
HelperToMarkIBar (); | ||
} | ||
|
||
[Kept] | ||
static Foo HelperToMarkFooAndRequireBase () | ||
{ | ||
return null; | ||
} | ||
|
||
[Kept] | ||
static void HelperToMarkIBar() | ||
{ | ||
GetAnIBar().Method(); | ||
} | ||
|
||
[Kept] | ||
static IBar GetAnIBar() | ||
{ | ||
return null; | ||
} | ||
|
||
[Kept] | ||
abstract class Base { | ||
public abstract void Method (); | ||
} | ||
|
||
[Kept] | ||
[KeptBaseType (typeof (Base))] | ||
class Foo : Base, IBar { | ||
public override void Method () | ||
{ | ||
UsedByOverride (); | ||
} | ||
|
||
void UsedByOverride () | ||
{ | ||
} | ||
} | ||
|
||
[Kept] | ||
interface IBar { | ||
[Kept] | ||
void Method (); | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...heritance.Complex/NoKeptCtor/OverrideOfAbstractAndInterfaceMethodWhenInterfaceRemoved2.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
|
||
namespace Mono.Linker.Tests.Cases.Inheritance.Complex.NoKeptCtor { | ||
public class OverrideOfAbstractAndInterfaceMethodWhenInterfaceRemoved2 { | ||
public static void Main () | ||
{ | ||
Foo b = null; | ||
HelperToKeepLocalAtCompileTime (b); | ||
// Use IBar in another method so that IBar can be removed from Foo | ||
HelperToMarkIBar (); | ||
} | ||
|
||
[Kept] | ||
static void HelperToKeepLocalAtCompileTime (Foo f) | ||
{ | ||
} | ||
|
||
[Kept] | ||
static void HelperToMarkIBar() | ||
{ | ||
GetAnIBar().Method(); | ||
} | ||
|
||
[Kept] | ||
static IBar GetAnIBar() | ||
{ | ||
return null; | ||
} | ||
|
||
[Kept] | ||
abstract class Base { | ||
public abstract void Method (); | ||
} | ||
|
||
[Kept] | ||
[KeptBaseType (typeof (Base))] | ||
class Foo : Base, IBar { | ||
public override void Method () | ||
{ | ||
UsedByOverride (); | ||
} | ||
|
||
void UsedByOverride () | ||
{ | ||
} | ||
} | ||
|
||
[Kept] | ||
interface IBar { | ||
[Kept] | ||
void Method (); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters