diff options
Diffstat (limited to 'test/pdf.zig')
| -rw-r--r-- | test/pdf.zig | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/pdf.zig b/test/pdf.zig index 1bbfa59c..9e183224 100644 --- a/test/pdf.zig +++ b/test/pdf.zig @@ -36,7 +36,7 @@ const PdfLinkTests = struct { const Cell = struct { col: u16, row: u16 }; fn init(tmp: std.testing.TmpDir) !*Pardes { - const bytes = try pdf_impl.makeLinksTestPdf(std.testing.allocator); + const bytes = try pdf_impl.testFixture(std.testing.allocator, "links.pdf"); defer std.testing.allocator.free(bytes); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "links.pdf", .data = bytes }); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "target.txt", .data = "chosen file\n" }); @@ -228,9 +228,9 @@ test "explicit OS PDF opens and reloads keep their namespace path" { const gpa = std.testing.allocator; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); - const original = try pdf_impl.makeOutlineTestPdf(gpa); + const original = try pdf_impl.testFixture(gpa, "outline.pdf"); defer gpa.free(original); - const replacement = try pdf_impl.makeNoOutlineTestPdf(gpa); + const replacement = try pdf_impl.testFixture(gpa, "offset-rotated.pdf"); defer gpa.free(replacement); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "live.pdf", .data = original }); var directory_buffer: [4096]u8 = undefined; @@ -283,7 +283,7 @@ test "PdfSections Look follows the exact owning PDF, not an equal path" { const gpa = std.testing.allocator; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); - const fixture = try pdf_impl.makeOutlineTestPdf(gpa); + const fixture = try pdf_impl.testFixture(gpa, "outline.pdf"); defer gpa.free(fixture); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "outline.pdf", .data = fixture }); var path_buf: [256]u8 = undefined; @@ -345,9 +345,9 @@ test "watched PDF reload replaces MuPDF state and preserves the reading view" { const gpa = std.testing.allocator; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); - const original = try pdf_impl.makeOutlineTestPdf(gpa); + const original = try pdf_impl.testFixture(gpa, "outline.pdf"); defer gpa.free(original); - const replacement = try pdf_impl.makeNoOutlineTestPdf(gpa); + const replacement = try pdf_impl.testFixture(gpa, "offset-rotated.pdf"); defer gpa.free(replacement); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "live.pdf", .data = original }); var path_buf: [256]u8 = undefined; @@ -986,7 +986,7 @@ test "a tall page is drawn at the display's resolution, in bands that are the wh const gpa = std.testing.allocator; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); - const bytes = try pdf_impl.makeTallTestPdf(gpa); + const bytes = try pdf_impl.testFixture(gpa, "tall.pdf"); defer gpa.free(bytes); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "tall.pdf", .data = bytes }); var dir_buf: [4096]u8 = undefined; @@ -2005,7 +2005,7 @@ test "Esc back into a PDF keeps the offset within its page" { const gpa = std.testing.allocator; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); - const fixture = try pdf_impl.makeOutlineTestPdf(gpa); + const fixture = try pdf_impl.testFixture(gpa, "outline.pdf"); defer gpa.free(fixture); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "outline.pdf", .data = fixture }); var path_buf: [256]u8 = undefined; @@ -2074,7 +2074,7 @@ test "a PDF's fit and tint, and Collapse, read in its ctl and come back from a D const gpa = std.testing.allocator; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); - const fixture = try pdf_impl.makeOutlineTestPdf(gpa); + const fixture = try pdf_impl.testFixture(gpa, "outline.pdf"); defer gpa.free(fixture); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "outline.pdf", .data = fixture }); var path_buf: [256]u8 = undefined; |
