|
117 | 117 | doc = pdDocOpen(joinpath(@__DIR__, pdftest_dir, "DigSig", file))
|
118 | 118 | @test pdDocHasSignature(doc)
|
119 | 119 | r = pdDocValidateSignatures(doc)
|
120 |
| - @test all([r[i][:passed] for i = 1:length(r)]) |
| 120 | + @test all([r[i][:passed] for i = eachindex(r)]) |
121 | 121 | pdDocClose(doc)
|
122 | 122 | end
|
123 | 123 | end
|
|
128 | 128 | doc = pdDocOpen(joinpath(@__DIR__, pdftest_dir, "DigSig", file))
|
129 | 129 | @test pdDocHasSignature(doc)
|
130 | 130 | r = pdDocValidateSignatures(doc)
|
131 |
| - @test all([r[i][:passed] for i = 1:length(r)]) |
| 131 | + @test all([r[i][:passed] for i = eachindex(r)]) |
132 | 132 | pdDocClose(doc)
|
133 | 133 | end
|
134 | 134 | end
|
|
140 | 140 | doc = pdDocOpen(joinpath(@__DIR__, pdftest_dir, "DigSig", file))
|
141 | 141 | @test pdDocHasSignature(doc)
|
142 | 142 | r = pdDocValidateSignatures(doc)
|
143 |
| - @test all([r[i][:passed] for i = 1:length(r)]) |
| 143 | + @test all([r[i][:passed] for i = eachindex(r)]) |
144 | 144 | pdDocClose(doc)
|
145 | 145 | end
|
146 | 146 | end
|
|
160 | 160 | pws = Vector{UInt8}[b"user", b"user", b"user", b"user", b"user", b"", b"test", b"", b"password", b""]
|
161 | 161 | infos = []
|
162 | 162 | encrypted = []
|
163 |
| - for i = 1:length(files) |
| 163 | + for i = eachindex(files) |
164 | 164 | file = files[i]
|
165 | 165 | resname, template, filename = local_testfiles(file)
|
166 | 166 | doc = pdDocOpen(joinpath(@__DIR__, pdftest_dir, "encrypt", file), access=()->Base.SecretBuffer!(pws[i]))
|
|
188 | 188 | @testset "PDF owner password documents" begin
|
189 | 189 | files = ["dt.pdf", "dt-own-pass-same.pdf", "upw-password-opw-sample.pdf"]
|
190 | 190 | opws = Vector{UInt8}[b"owner", b"user", b"sample"]
|
191 |
| - for i = 1:length(files) |
| 191 | + for i = eachindex(files) |
192 | 192 | file = files[i]
|
193 | 193 | resname, template, filename = local_testfiles(file)
|
194 | 194 | doc = pdDocOpen(joinpath(@__DIR__, pdftest_dir, "encrypt", file), access=()->Base.SecretBuffer!(opws[i]))
|
|
208 | 208 | @testset "PDF Crypt filter" begin
|
209 | 209 | files = ["dt-att-protected.pdf"]
|
210 | 210 | opws = Vector{UInt8}[b"user1234"]
|
211 |
| - for i = 1:length(files) |
| 211 | + for i = eachindex(files) |
212 | 212 | file = files[i]
|
213 | 213 | doc = pdDocOpen(joinpath(@__DIR__, pdftest_dir, "encrypt", file), access=()->Base.SecretBuffer!(opws[i]))
|
214 | 214 | obj = cosDocGetObject(doc.cosDoc, CosIndirectObjectRef(43, 0))
|
|
227 | 227 | pw = Base.SecretBuffer("password")
|
228 | 228 | p12path = joinpath(@__DIR__, pdftest_dir, "certs", "doc-crypt.p12")
|
229 | 229 | Base.shred!(pw) do pw
|
230 |
| - for i = 1:length(files) |
| 230 | + for i = eachindex(files) |
231 | 231 | file = files[i]
|
232 | 232 | resname, template, filename = local_testfiles(file)
|
233 | 233 | path = joinpath(@__DIR__, pdftest_dir, "encrypt", file)
|
|
0 commit comments