xamarin-macios/tests/cecil-tests
monojenkins 3b36acecba
[tests][cecil] Check that error-based enum values don't have availability attributes (#9780)
and fixes the ones that have some.

From https://github.com/xamarin/xamarin-macios/issues/9724

We do not _normally_ add availability attributes on enums **members** that represent error codes. In part because it's a lot of metadata and, foremost, because it's not really helpful to write code. E.g.

```csharp
var err = Call.Api (1);
switch (err) {
case NSError.Bad:
case NSError.Wrong:
   Console.WriteLine ($"API failed: {err});
   break;
case NSError.Ok:
   break;
default:
   Console.WriteLine ($"Unknown error code {err}");
   break;
}
```

Adding version checks inside this would be complicated (source wise) and not really helpful since
* API can return undefined error code (and the error logic should work);
* Availability information is not 100% accurate;

As such we default to not add them - but we some time forgot about it. An intro rule could easily ensure we don't add them needlessly.
2020-10-05 10:37:54 -04:00
..
EnumTest.cs [tests][cecil] Check that error-based enum values don't have availability attributes (#9780) 2020-10-05 10:37:54 -04:00
Helper.cs [generator] Add missing `EnsureUIThread` for generated `init` and `initWithCoder` (#8250) 2020-03-31 17:20:44 -04:00
Makefile [tests] Add cecil-based unit tests (#7825) 2020-02-10 17:23:12 -05:00
README.md [tests] Add cecil-based unit tests (#7825) 2020-02-10 17:23:12 -05:00
Test.cs [xcode12.2][tests][cecil] Check for absence of `[NoX]` (Unavailable) in platform assemblies. Fix #4835 (#9771) 2020-10-02 10:33:59 -04:00
cecil-tests.csproj [generator] Add C#8 nullability into generated code (#7570) (#8333) 2020-04-10 12:38:14 -04:00
packages.config [Cecil] Try to fix tests by stating the version in the console runner. (#9655) 2020-09-17 09:03:20 -04:00

README.md

Cecil-based Tests

Even with the huge variety of tests that we have there's still a few things that are hard to test properly. Some of them can be tested by analyzing the assemblies (IL or metadata). So here we are...