diff options
Diffstat (limited to 'anim/test/recordings.zig')
| -rw-r--r-- | anim/test/recordings.zig | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/anim/test/recordings.zig b/anim/test/recordings.zig index ce5a9db..e3af983 100644 --- a/anim/test/recordings.zig +++ b/anim/test/recordings.zig @@ -210,3 +210,21 @@ test "libc's open at its syscall: the blocks never reached folded, no loop made const here = g.nodes[g.here.?]; try expect(here.y >= off and here.y + here.h <= off + room and g.w <= 1792); } + +test "the source follows the pc into musl's own files and back to main's line" { + // musl is built from Zig's sources with the program: its files are always the build's to give. + const rec = canim.open(recordings.musl); + const main = rec.call("main", 0); + try std.testing.expectEqualStrings("hello.c", rec.sources[rec.shown[main.enter].src].name()); + var files: [3]bool = @splat(false); + var back = false; + for (rec.shown[main.enter..], main.enter..) |s, i| { + const name = rec.sources[s.src].name(); + for ([_][]const u8{ "open.c", "__syscall_cp.c", "syscall_arch.h" }, &files) |want, *seen| seen.* = seen.* or (s.here and std.mem.eql(u8, name, want)); + // Where it is on a line of musl's, the panel shows it: never main's held over. + if (s.here) try expect(rec.sourced(i)); + back = back or (files[0] and s.here and std.mem.eql(u8, name, "hello.c") and s.line == 6); + } + for (files) |seen| try expect(seen); + try expect(back); +} |
