help in writing tests

Shivam Kumar Singh shivamhere247 at gmail.com
Sun Jan 26 17:24:24 UTC 2020


Hi Regina ,Miklos, all,

Thanks for the great help and the code pointers .
I tried to modify the code from SdImportTest::testTdf97808() in
sd/qa/unit/import-tests.cxx.
In the code for tdf97808 a line is inspected and using the property
getPropertyValue("Style") it was checked if it is equal to the
property "objectwithoutfill" .
Observing a few more tests I replaced XLine with Xshape  and compared for
"Style"

    uno::Reference<beans::XPropertySet> xLine(
          xPage->getByIndex(0), uno::UNO_QUERY_THROW);
    uno::Reference<beans::XPropertySet> xParent;
    CPPUNIT_ASSERT(xLine->getPropertyValue("Style") >>= xParent);
    CPPUNIT_ASSERT_EQUAL(xStyle, xParent);

to

    uno::Reference< drawing::XShape > xShape(
        xPage->getByIndex(0), uno::UNO_QUERY_THROW );
    uno::Reference<beans::XPropertySet> xParent;
    CPPUNIT_ASSERT(xShape->getPropertyValue("Style") >>= xParent);
    CPPUNIT_ASSERT_EQUAL(xStyle, xParent);

but xShape does not have getPropertyValue("") method hence the build failed
.
Can we do some modification to xShape ?
Maybe changing the method or something

Also ,  tdf123684 is very similar to tdf123841 , Check for an object and
inspect
its style to be FillStyle_NONE, I used the code and have submitted a patch
https://gerrit.libreoffice.org/c/core/+/87440
and here is the build
 https://ci.libreoffice.org/job/gerrit_master/48393/
I may be wrong in both the approaches.
Please have a look , and suggest me furthur steps.

SIncerely ,
Shivam

On Thu, 23 Jan 2020 at 16:23, Regina Henschel <rb.henschel at t-online.de>
wrote:

>
> > I had some private mails with Shivam. I have suggested to create a new
> > document and verify, that the default style has filling NONE.
>
> default style --> style, which is "Object without fill" in the UI
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20200126/6d48aa11/attachment.htm>


More information about the LibreOffice mailing list