From 36a524929fe4c80b8b904b8dc75298b722ff8944 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Thu, 13 Mar 2025 13:38:13 +0100 Subject: [PATCH] C#: Update tests and test expected output. --- .../Useless Code/IntGetHashCode/IntGetHashCode.cs | 6 +++--- .../IntGetHashCode/IntGetHashCode.expected | 13 +++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/csharp/ql/test/query-tests/Useless Code/IntGetHashCode/IntGetHashCode.cs b/csharp/ql/test/query-tests/Useless Code/IntGetHashCode/IntGetHashCode.cs index ae8d93ef468..22a24013b08 100644 --- a/csharp/ql/test/query-tests/Useless Code/IntGetHashCode/IntGetHashCode.cs +++ b/csharp/ql/test/query-tests/Useless Code/IntGetHashCode/IntGetHashCode.cs @@ -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(); diff --git a/csharp/ql/test/query-tests/Useless Code/IntGetHashCode/IntGetHashCode.expected b/csharp/ql/test/query-tests/Useless Code/IntGetHashCode/IntGetHashCode.expected index 6f126779321..da253cc80b2 100644 --- a/csharp/ql/test/query-tests/Useless Code/IntGetHashCode/IntGetHashCode.expected +++ b/csharp/ql/test/query-tests/Useless Code/IntGetHashCode/IntGetHashCode.expected @@ -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. |