Skip to content

Fix obsolete warnings in generated test code, fixes #337 #341

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

Merged
merged 1 commit into from
Dec 12, 2017

Conversation

dutts
Copy link
Contributor

@dutts dutts commented Dec 11, 2017

No description provided.

@angularsen angularsen merged commit c00ba1c into angularsen:master Dec 12, 2017
@angularsen
Copy link
Owner

Awesome, thanks. I noticed there are still tons of warnings in the build log though, if you want to take a stab at more of them:

Build log: https://ci.appveyor.com/project/angularsen/unitsnet/build/414

Mute this one with a #pragma, since this is by design:

GeneratedCode\Quantities\PressureChangeRate.g.cs(495,30): warning CS0809: Obsolete member 'PressureChangeRate.Equals(object)' overrides non-obsolete member 'object.Equals(object)' [C:\projects\unitsnet\UnitsNet\UnitsNet.NetStandard10.csproj]

Mute this one with a #pragma until we remove these != and == operator overloads in next major release:

GeneratedCode\ElectricResistanceTestsBase.g.cs(170,26): warning CS0618: 'ElectricResistance.operator ==(ElectricResistance, ElectricResistance)' is obsolete: 'It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.' [C:\projects\unitsnet\UnitsNet.Tests\UnitsNet.Tests.NetCore.csproj]

GeneratedCode\EnergyTestsBase.g.cs(279,26): warning CS0618: 'Energy.operator !=(Energy, Energy)' is obsolete: 'It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.' [C:\projects\unitsnet\UnitsNet.Tests\UnitsNet.Tests.NetCore.csproj]

Mute warnings with #pragma on tests of obsolete units until they are removed, such as:

GeneratedCode\Quantities\TemperatureDelta.g.cs(893,22): warning CS0618: 'TemperatureDeltaUnit.DegreeNewtonDelta' is obsolete: 'Deprecated due to github issue #180, please use DegreeNewton instead' [C:\projects\unitsnet\UnitsNet\UnitsNet.NetStandard10.Signed.csproj]

Next major release TODO list:
#180

@dutts
Copy link
Contributor Author

dutts commented Dec 12, 2017

Sure, will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants