Skip to content

Commit 303ba3b

Browse files
authored
Simplify null deref check test (dlang#22549)
1 parent 9e57074 commit 303ba3b

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

compiler/test/runnable/nullderefcheck.d

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,13 @@ void main()
2626

2727
void wrap(alias test)(int expectedLine)
2828
{
29-
gotFile = null;
30-
gotLine = 0;
3129
try
3230
{
3331
test();
32+
assert(0);
3433
}
35-
catch (Error)
34+
catch (Error e)
3635
{
36+
assert(e.line == expectedLine);
3737
}
38-
assert(gotFile == __FILE__);
39-
assert(gotLine == expectedLine);
40-
}
41-
42-
string gotFile;
43-
uint gotLine;
44-
45-
extern (C) void _d_nullpointerp(immutable(char*) file, uint line)
46-
{
47-
import core.stdc.string : strlen;
48-
49-
gotFile = file[0 .. strlen(file)];
50-
gotLine = line;
51-
throw new Error("");
5238
}

0 commit comments

Comments
 (0)