Skip to content

Commit 6c30f6a

Browse files
committed
C#: Add some test cases and update (incorrect) expected output.
1 parent 30c67ba commit 6c30f6a

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

csharp/ql/test/library-tests/parameters/Parameters.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class Parameters
2929
public void M21([Optional, DefaultParameterValue("mystring")] MyStruct arg10) => throw null;
3030
public void M22(nuint arg11 = 0) => throw null;
3131
public void M23(nint arg12 = 0) => throw null;
32+
public void M24([Optional, DefaultParameterValue(7)] object arg13) => throw null;
3233

3334
public struct MyStruct
3435
{

csharp/ql/test/library-tests/parameters/Parameters.cs_

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class ParametersDll
2929
public void M21([Optional, DefaultParameterValue("mystring")] MyStruct arg10) => throw null;
3030
public void M22(nuint arg11 = 0) => throw null;
3131
public void M23(nint arg12 = 0) => throw null;
32+
public void M24([Optional, DefaultParameterValue(7)] object arg13) => throw null;
3233

3334
public struct MyStruct
3435
{
Binary file not shown.

csharp/ql/test/library-tests/parameters/Parameters.expected

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ noDefaultValue
55
| Parameters.cs:8:17:8:18 | M2 | Parameters.cs:8:24:8:24 | a | 0 |
66
| Parameters.cs:12:17:12:18 | M6 | Parameters.cs:12:29:12:30 | s1 | 0 |
77
| Parameters.cs:13:17:13:18 | M7 | Parameters.cs:13:27:13:28 | e1 | 0 |
8-
| Parameters.cs:35:32:35:39 | implicit conversion | Parameters.cs:35:54:35:54 | i | 0 |
9-
| Parameters.cs:36:32:36:39 | implicit conversion | Parameters.cs:36:57:36:57 | s | 0 |
8+
| Parameters.cs:36:32:36:39 | implicit conversion | Parameters.cs:36:54:36:54 | i | 0 |
9+
| Parameters.cs:37:32:37:39 | implicit conversion | Parameters.cs:37:57:37:57 | s | 0 |
1010
| Parameters.dll:0:0:0:0 | M1 | Parameters.dll:0:0:0:0 | a | 0 |
1111
| Parameters.dll:0:0:0:0 | M1 | Parameters.dll:0:0:0:0 | b | 1 |
1212
| Parameters.dll:0:0:0:0 | M1 | Parameters.dll:0:0:0:0 | c | 2 |
@@ -47,6 +47,7 @@ withDefaultValue
4747
| Parameters.cs:29:17:29:19 | M21 | Parameters.cs:29:76:29:80 | arg10 | 0 | Parameters.cs:29:21:29:80 | call to operator implicit conversion | - |
4848
| Parameters.cs:30:17:30:19 | M22 | Parameters.cs:30:27:30:31 | arg11 | 0 | Parameters.cs:30:35:30:35 | (...) ... | 0 |
4949
| Parameters.cs:31:17:31:19 | M23 | Parameters.cs:31:26:31:30 | arg12 | 0 | Parameters.cs:31:34:31:34 | (...) ... | 0 |
50+
| Parameters.cs:32:17:32:19 | M24 | Parameters.cs:32:65:32:69 | arg13 | 0 | Parameters.cs:32:21:32:69 | default | null |
5051
| Parameters.dll:0:0:0:0 | M2 | Parameters.dll:0:0:0:0 | b | 1 | Parameters.dll:0:0:0:0 | default | null |
5152
| Parameters.dll:0:0:0:0 | M2 | Parameters.dll:0:0:0:0 | c | 2 | Parameters.dll:0:0:0:0 | "default string" | default string |
5253
| Parameters.dll:0:0:0:0 | M3 | Parameters.dll:0:0:0:0 | a | 0 | Parameters.dll:0:0:0:0 | 1 | 1 |
@@ -78,6 +79,7 @@ withDefaultValue
7879
| Parameters.dll:0:0:0:0 | M21 | Parameters.dll:0:0:0:0 | arg10 | 0 | Parameters.dll:0:0:0:0 | call to operator implicit conversion | - |
7980
| Parameters.dll:0:0:0:0 | M22 | Parameters.dll:0:0:0:0 | arg11 | 0 | Parameters.dll:0:0:0:0 | (...) ... | 0 |
8081
| Parameters.dll:0:0:0:0 | M23 | Parameters.dll:0:0:0:0 | arg12 | 0 | Parameters.dll:0:0:0:0 | (...) ... | 0 |
82+
| Parameters.dll:0:0:0:0 | M24 | Parameters.dll:0:0:0:0 | arg13 | 0 | Parameters.dll:0:0:0:0 | default | null |
8183
dateTimeDefaults
8284
| Parameters.cs:22:17:22:19 | M14 | Parameters.cs:22:64:22:67 | arg4 | Parameters.cs:22:21:22:67 | object creation of type DateTime | DateTime(long) | 14 |
8385
| Parameters.cs:23:17:23:19 | M15 | Parameters.cs:23:68:23:71 | arg5 | Parameters.cs:23:21:23:71 | object creation of type DateTime | DateTime(long) | 10001 |

0 commit comments

Comments
 (0)