C#: Update tests and test expected output.

This commit is contained in:
Michael Nebel
2025-03-13 13:38:13 +01:00
parent 4b02198652
commit 36a524929f
2 changed files with 8 additions and 11 deletions

View File

@@ -3,16 +3,16 @@ class IntGetHashCode
void Test()
{
// These are all bad:
default(uint).GetHashCode(); // $ Alert
default(int).GetHashCode(); // $ Alert
default(long).GetHashCode(); // $ Alert
default(ulong).GetHashCode(); // $ Alert
default(short).GetHashCode(); // $ Alert
default(ushort).GetHashCode(); // $ Alert
default(byte).GetHashCode(); // $ Alert
default(sbyte).GetHashCode(); // $ Alert
// These are all good:
default(uint).GetHashCode();
default(long).GetHashCode();
default(ulong).GetHashCode();
default(double).GetHashCode();
default(float).GetHashCode();
default(char).GetHashCode();

View File

@@ -1,8 +1,5 @@
| IntGetHashCode.cs:6:9:6:35 | call to method GetHashCode | Calling GetHashCode() on type uint is redundant. |
| IntGetHashCode.cs:7:9:7:34 | call to method GetHashCode | Calling GetHashCode() on type int is redundant. |
| IntGetHashCode.cs:8:9:8:35 | call to method GetHashCode | Calling GetHashCode() on type long is redundant. |
| IntGetHashCode.cs:9:9:9:36 | call to method GetHashCode | Calling GetHashCode() on type ulong is redundant. |
| IntGetHashCode.cs:10:9:10:36 | call to method GetHashCode | Calling GetHashCode() on type short is redundant. |
| IntGetHashCode.cs:11:9:11:37 | call to method GetHashCode | Calling GetHashCode() on type ushort is redundant. |
| IntGetHashCode.cs:12:9:12:35 | call to method GetHashCode | Calling GetHashCode() on type byte is redundant. |
| IntGetHashCode.cs:13:9:13:36 | call to method GetHashCode | Calling GetHashCode() on type sbyte is redundant. |
| IntGetHashCode.cs:6:9:6:34 | call to method GetHashCode | Calling GetHashCode() on type int is redundant. |
| IntGetHashCode.cs:7:9:7:36 | call to method GetHashCode | Calling GetHashCode() on type short is redundant. |
| IntGetHashCode.cs:8:9:8:37 | call to method GetHashCode | Calling GetHashCode() on type ushort is redundant. |
| IntGetHashCode.cs:9:9:9:35 | call to method GetHashCode | Calling GetHashCode() on type byte is redundant. |
| IntGetHashCode.cs:10:9:10:36 | call to method GetHashCode | Calling GetHashCode() on type sbyte is redundant. |