Skip to content

Commit 1134987

Browse files
ar3emiText-CI
authored andcommitted
Add test on infinite loop during table creating in layout
DEVSIX-3356 Autoported commit. Original commit hash: [d8aa793d2]
1 parent 2720f42 commit 1134987

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

itext.tests/itext.layout.tests/itext/layout/TableTest.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2421,6 +2421,32 @@ public virtual void SkipLastFooterOnShortPageTest01() {
24212421
, testName + "_diff"));
24222422
}
24232423

2424+
[NUnit.Framework.Test]
2425+
[NUnit.Framework.Ignore("Ignored because the test enters an infinite loop when closing a document. Remove ignore after fixing DEVSIX-3356"
2426+
)]
2427+
public virtual void InfiniteLoopOnUnfitCellAndBigRowspanTest() {
2428+
// TODO remove ignore after fixing DEVSIX-3356
2429+
String testName = "infiniteLoopOnUnfitCellAndBigRowspanTest.pdf";
2430+
String outFileName = destinationFolder + testName;
2431+
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(outFileName));
2432+
Document doc = new Document(pdfDoc, PageSize.A4.Rotate());
2433+
Table table = new Table(38);
2434+
table.UseAllAvailableWidth();
2435+
table.SetFixedLayout();
2436+
Cell cellNum1 = new Cell(1, 1);
2437+
table.AddCell(cellNum1);
2438+
Cell cellNum2 = new Cell(2, 2);
2439+
iText.Layout.Element.Image img = new iText.Layout.Element.Image(ImageDataFactory.Create(sourceFolder + "itext.png"
2440+
));
2441+
cellNum2.Add(img);
2442+
table.AddCell(cellNum2);
2443+
Cell cellNum3 = new Cell(2, 36);
2444+
cellNum3.Add(new Paragraph("text"));
2445+
table.AddCell(cellNum3);
2446+
doc.Add(table);
2447+
doc.Close();
2448+
}
2449+
24242450
private class RotatedDocumentRenderer : DocumentRenderer {
24252451
private readonly PdfDocument pdfDoc;
24262452

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d15bd79f5c48767058a500f3557d2a46a6d94a0f
1+
d8aa793d22d62c8cf4e67de652d259328c792c29

0 commit comments

Comments
 (0)