Skip to content

Commit

Permalink
Merge pull request #2 from adrg/dev-lazyload-improvements
Browse files Browse the repository at this point in the history
Adapt appender test cases for lazy reader usage
  • Loading branch information
gunnsth authored Jul 24, 2019
2 parents 7027e65 + cb8f9b4 commit 2e29ec2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions model/appender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"github.com/stretchr/testify/require"
"golang.org/x/crypto/pkcs12"

"github.com/unidoc/unipdf/v3/common"
"github.com/unidoc/unipdf/v3/annotator"
"github.com/unidoc/unipdf/v3/common"
"github.com/unidoc/unipdf/v3/core"
"github.com/unidoc/unipdf/v3/model"
"github.com/unidoc/unipdf/v3/model/sighandler"
Expand Down Expand Up @@ -1072,8 +1072,9 @@ func TestAppenderSignMultiple(t *testing.T) {
t.Fatalf("page annotations != %d (got %d)", i, len(annotations))
}
for j, annot := range annotations {
t.Logf("i=%d Annots page object equal? %v == %v?", j, pdfReader.PageList[0].GetContainingPdfObject(), annot.P)
require.Equal(t, pdfReader.PageList[0].GetContainingPdfObject(), annot.P)
annotPage := core.ResolveReference(annot.P)
t.Logf("i=%d Annots page object equal? %v == %v?", j, pdfReader.PageList[0].GetContainingPdfObject(), annotPage)
require.Equal(t, pdfReader.PageList[0].GetContainingPdfObject(), annotPage)
}

appender, err := model.NewPdfAppender(pdfReader)
Expand Down Expand Up @@ -1314,8 +1315,9 @@ func TestAppenderSignMultipleAppearances(t *testing.T) {
t.Fatalf("page annotations != %d (got %d)", i, len(annotations))
}
for j, annot := range annotations {
t.Logf("i=%d Annots page object equal? %v == %v?", j, pdfReader.PageList[0].GetContainingPdfObject(), annot.P)
require.Equal(t, pdfReader.PageList[0].GetContainingPdfObject(), annot.P)
annotPage := core.ResolveReference(annot.P)
t.Logf("i=%d Annots page object equal? %v == %v?", j, pdfReader.PageList[0].GetContainingPdfObject(), annotPage)
require.Equal(t, pdfReader.PageList[0].GetContainingPdfObject(), annotPage)
}

appender, err := model.NewPdfAppender(pdfReader)
Expand Down

0 comments on commit 2e29ec2

Please sign in to comment.