Re: How to make a unit test which involves a dialog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Regina,

On Tue, Oct 13, 2020 at 03:02:33PM +0200, Regina Henschel <rb.henschel@xxxxxxxxxxx> wrote:
> the patch for which I want to make a unit test is in
> https://gerrit.libreoffice.org/c/core/+/104234
> 
> The error is produced, when you set a new width or height for a horizontal
> or vertical line in the Position&Size dialog in Calc. So how can I use the
> Position&Size dialog in a unit test? Is it possible with C++?

Note that your patch modifies SdrEditView::ResizeMultMarkedObj(), so
calling that member function directly from a cppunit test without a
dialog is also an option.

One technique is putting a breakpoint on the function, then seeing the
backtrace of it, so you can see what internal API the dialog uses (it
may or may not call ResizeMultMarkedObj() directly) and then perform the
same API calls from cppunit, without a dialog.

See e.g. testTdf111522() in sd/qa/unit/uiimpress.cxx, you can get the
sd::ViewShell of a loaded document, and its GetView() will give you an
SdrView, which may make it possible to invoke various SdrEditView member
functions.

Regards,

Miklos
_______________________________________________
LibreOffice mailing list
LibreOffice@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/libreoffice



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux