[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Review Request: Layout, first paragraph bottom position fix
From:       zander () kde ! org
Date:       2010-09-14 9:16:36
Message-ID: 201009141116.37080.zander () kde ! org
[Download RAW message or body]

In KWord we have a test that uses KWTestDocumentLayout and a mock Layout. See 
kword/part/tests/TestDocumentLayout.cpp
As I'm not 100% what the bug is I am not sure what it is you are testing. I'm 
guessing you are testing the KWTestDocumentLayout::layout() to be called twice 
with a certain amount of text. You can do that using the same concepts as 
available in that test.

The point of writing the test is to determine exactly what the problem is and 
where the core of the problem is located.  It is in a way the result of your 
investigation towards the actual bug. It shows the assumption we make about 
the interaction and a test-failure indicates the code has a bug.
And when we fix the code it tests then a regression will never happen since we 
keep the unit tests passing.

Please take a look at the MockLayoutState in the above mentioned file and I 
think you can use that.

On Tuesday 14. September 2010 10.19.16 Korinek Pavol wrote:
> Hello Thomas,
> 
> I have tried to create unit test for that and I have met this problems:
> 
> I need test where KWTestDocumentLayout and also Layout is used.
> We have two tests created:
> 1. kword/part/tests/TestDocumentLayout
> here is KWTextDocumentLayout used, but here is not used Layout to work with
> more shapes and is problem to include: Layout, TextShape, TableLayout, ..
> 
> 2. plugins/textshape/tests/TestDocumentLayout
> here is problem that KoTextDocumentLayout is used in mock object and it's
> not possible to include KWTextDocumentLayout
> 
> Could you consider that. It can be seen in code, that actually we compare
> endpos counted of shape A and is compared to baseline when another B shape
> is processed.
> 
> If we really want unit test, could you please provide some hint how to
> create this unit test ?
> 
> Thank you
> 
> Pavol
> 
> -----Original Message-----
> From: Thomas Zander [mailto:zander@kde.org]
> Sent: Monday, September 13, 2010 10:45 AM
> To: Uzak Matus; Thomas Zander; KOffice; Korinek Pavol
> Subject: Re: Review Request: Layout, first paragraph bottom position fix
> 
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5305/
> 
> 
> 	On September 10th, 2010, 3:41 p.m., Thomas Zander wrote:
> 
> 		Please provide a unit test to show the problem.
> 
> Thanks for explaining how to load a document and see it fail; this is black
> box testing and useless for regression testing or showing the actual bug
> in the code. Please provide a unit test to show the problem.
> 
> 
> - Thomas
> 
> 
> On September 13th, 2010, 7:19 a.m., Pavol Korinek wrote:
> 
> Review request for KOffice.
> By Pavol Korinek.
> 
> Updated 2010-09-13 07:19:03
> 
> 
> Description
> 
> We use shape (m_state->shape) height to set 'end bottom position' when
> first paragraph occurs. When m_state->shape is new one, then we should set
> new 'end bottom position'. It can be done by set firstParagraph to true on
> new shape. This was investigated to solve:
> https://bugs.kde.org/show_bug.cgi?id=239703
> 
> Diffs
> 
> 
> *	/trunk/koffice/kword/part/frames/KWTextDocumentLayout.cpp (1172979)
> 
> View Diff <http://svn.reviewboard.kde.org/r/5305/diff/>

-- 
Thomas Zander
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic