Failing unit test in Mac OS X Yosemite 10.10.1

classic Classic list List threaded Threaded
11 messages Options
Renato Ferreira Renato Ferreira
Reply | Threaded
Open this post in threaded view
|

Failing unit test in Mac OS X Yosemite 10.10.1

Hi everybody,

As I had mentioned in another thread, a unit test has been failing in my machine for some time. This is not a fatal error, but I think it would be beneficial to understand where the problem comes from.

The test is CppunitTest_sw_ooxmlexport (ooxmlimport failed for some time, but apparently got fixed). It fails on the following condition:

Test name: testCropPixel::Import_Export_Import
assertion failed
- Expression: getXPath(pXmlDoc, "//a:srcRect", "l").toInt32() <= 21856

Failures !!!
Run: 106   Failure total: 1   Failures: 1   Errors: 0
warn:fwk:98596:1:framework/source/services/desktop.cxx:1020: Desktop disposed before terminating it
2014-12-12 17:37:13.640 cppunittester[98596:7597699] *** -[NSAutoreleasePool release]: This pool has already been released, do not drain it (double release).
warn:legacy.osl:98596:1:unotools/source/config/configmgr.cxx:167: OSL_ASSERT: items_.empty()

Error: a unit test failed, please do one of:

export DEBUGCPPUNIT=TRUE            # for exception catching
export CPPUNITTRACE="lldb --" # for interactive debugging on OSX
export VALGRIND=memcheck            # for memory checking

and retry using: make CppunitTest_sw_ooxmlexport

The following commit may be relevant:

commit b1b29ae795ff86097b21907f814d94bd5488929d
Author: Stephan Bergmann <[hidden email]>
Date:   Thu Nov 20 12:06:11 2014 +0100

    ...at least, that's the value for me on Mac with retina
    
    Change-Id: I041b497bab9415b2b33d6b4b91f3c58ea9dbc05f

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 519ad65..96b0d0ee 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -484,9 +484,7 @@ DECLARE_OOXMLEXPORT_TEST(testCropPixel, "crop-pixel.docx")
         // This is 17667 in the original document, was 504666 (so the image
         // become invisible), now is around 19072.
         (void) pXmlDoc;
-#ifndef MACOSX
-        CPPUNIT_ASSERT(getXPath(pXmlDoc, "//a:srcRect", "l").toInt32() < 20000);
-#endif
+        CPPUNIT_ASSERT(getXPath(pXmlDoc, "//a:srcRect", "l").toInt32() <= 21856);
     }
 }

My Mac (Retina 13") gives the value 22452, but I'm not able to tell which value is "valid", or on which Mac with retina the other value was produced. Does anybody else use OS X Yosemite here?

Thanks,
Renato.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Kohei Yoshida-7 Kohei Yoshida-7
Reply | Threaded
Open this post in threaded view
|

Re: Failing unit test in Mac OS X Yosemite 10.10.1

On Fri, 2014-12-12 at 23:44 +0000, Renato Ferreira wrote:

>
> Test name: testCropPixel::Import_Export_Import
> assertion failed
> - Expression: getXPath(pXmlDoc, "//a:srcRect", "l").toInt32() <= 21856
...
>
> My Mac (Retina 13") gives the value 22452, but I'm not able to tell
> which value is "valid", or on which Mac with retina the other value
> was produced. Does anybody else use OS X Yosemite here?

I do, and I'm getting exactly the same thing.  Every time.

And I've been meaning to take a closer look but, so far no action (been
lazy lately). :-P  I'm not a Writer developer so I don't immediately
know what the error is about.

Usually, each import export test has an associated file you can open,
then by comparing the content of the file and the code in the test, one
can perhaps make a best effort guess of what the test expects, and what
expectation is incorrect and/or whether there is a real bug in it...

Kohei



_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Alex Thurgood Alex Thurgood
Reply | Threaded
Open this post in threaded view
|

Re: Failing unit test in Mac OS X Yosemite 10.10.1

In reply to this post by Renato Ferreira
Le 13/12/2014 00:44, Renato Ferreira a écrit :
> Hi everybody,
>
> As I had mentioned in another thread, a unit test has been failing in my
> machine for some time. This is not a fatal error, but I think it would
> be beneficial to understand where the problem comes from.
>
> The test is CppunitTest_sw_ooxmlexport (ooxmlimport failed for some
> time, but apparently got fixed). It fails on the following condition:
>


Yep, I see it too.

Alex


_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Renato Ferreira Renato Ferreira
Reply | Threaded
Open this post in threaded view
|

Re: Failing unit test in Mac OS X Yosemite 10.10.1

In reply to this post by Kohei Yoshida-7

Usually, each import export test has an associated file you can open,
then by comparing the content of the file and the code in the test, one
can perhaps make a best effort guess of what the test expects, and what
expectation is incorrect and/or whether there is a real bug in it...


Yes, I actually found this file and was able to open it. I also found the generated export in /tmp by breaking the execution, however I was not able to manually export the same file in order to test the behaviour.

What should OOXML export correspond to, and is it directly available through the UI? It seems to me to be related to MS formats, but I tried all the options (I think) and none of them seem to generate the same thing as the automated test did.

Maybe it's possible to check whether the value makes sense anyway without actually exporting it, I'll try to investigate it.

 Renato.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Miklos Vajna-4 Miklos Vajna-4
Reply | Threaded
Open this post in threaded view
|

Re: Failing unit test in Mac OS X Yosemite 10.10.1

In reply to this post by Kohei Yoshida-7
Hi,

On Fri, Dec 12, 2014 at 06:52:03PM -0500, Kohei Yoshida <[hidden email]> wrote:

> > Test name: testCropPixel::Import_Export_Import
> > assertion failed
> > - Expression: getXPath(pXmlDoc, "//a:srcRect", "l").toInt32() <= 21856
> ...
> >
> > My Mac (Retina 13") gives the value 22452, but I'm not able to tell
> > which value is "valid", or on which Mac with retina the other value
> > was produced. Does anybody else use OS X Yosemite here?
>
> I do, and I'm getting exactly the same thing.  Every time.
Strange, as on tinderbox complains. Anyway, the problem is not specific
to Writer, it affects Calc and Impress as well, see commit
e16b01a9e4e111b1267c4eec1f5d168e5c2b8e53 (it's the shared drawingML
export code).

> Usually, each import export test has an associated file you can open,
> then by comparing the content of the file and the code in the test, one
> can perhaps make a best effort guess of what the test expects, and what
> expectation is incorrect and/or whether there is a real bug in it...

Each time I write such an assertion, I add a comment about what was the
old/wrong value, so in case you get 1999 instead of 2000, you have a
chance to judge if the old rounding error is back or in fact the 1999 vs
2000 is not a big difference in this case. In this case, it says "the
image become invisible", so hopefully you can easily just manually load
and save the document and verify if on your machine the image becomes
invisible in Word or not. :-)

Thanks,

Miklos

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

signature.asc (188 bytes) Download Attachment
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: Failing unit test in Mac OS X Yosemite 10.10.1

In reply to this post by Renato Ferreira
On 12/13/2014 12:44 AM, Renato Ferreira wrote:

> commit b1b29ae795ff86097b21907f814d94bd5488929d
> Author: Stephan Bergmann <[hidden email] <mailto:[hidden email]>>
> Date:   Thu Nov 20 12:06:11 2014 +0100
>
>      ...at least, that's the value for me on Mac with retina
>      Change-Id: I041b497bab9415b2b33d6b4b91f3c58ea9dbc05f
>
> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
> b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
> index 519ad65..96b0d0ee 100644
> --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
> +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
> @@ -484,9 +484,7 @@ DECLARE_OOXMLEXPORT_TEST(testCropPixel,
> "crop-pixel.docx")
>           // This is 17667 in the original document, was 504666 (so the
> image
>           // become invisible), now is around 19072.
>           (void) pXmlDoc;
> -#ifndef MACOSX
> -        CPPUNIT_ASSERT(getXPath(pXmlDoc, "//a:srcRect", "l").toInt32()
> < 20000);
> -#endif
> +        CPPUNIT_ASSERT(getXPath(pXmlDoc, "//a:srcRect", "l").toInt32()
> <= 21856);
>       }
>   }
>
> My Mac (Retina 13") gives the value 22452, but I'm not able to tell
> which value is "valid", or on which Mac with retina the other value was
> produced. Does anybody else use OS X Yosemite here?

21856 is what I consistently get on a 15" retina Mac, building against
10.10 SDK.

And as 21856 appears be be reasonably close still to 17667, at least in
comparison to 504666, I thought I give that commit a try as an
improvement over the blunt
<http://cgit.freedesktop.org/libreoffice/core/commit/?id=f5296655650e75fee259acf1959c15eb2cea3a1e>
"disable specific oox_export unit for macosx," without further insight
into why values actually differ though.
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: Failing unit test in Mac OS X Yosemite 10.10.1

On 12/15/2014 09:53 AM, Stephan Bergmann wrote:
> 21856 is what I consistently get on a 15" retina Mac, building against
> 10.10 SDK.

...and running on 10.10.1
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Renato Ferreira Renato Ferreira
Reply | Threaded
Open this post in threaded view
|

Re: Failing unit test in Mac OS X Yosemite 10.10.1

In reply to this post by Miklos Vajna-4

Each time I write such an assertion, I add a comment about what was the
old/wrong value, so in case you get 1999 instead of 2000, you have a
chance to judge if the old rounding error is back or in fact the 1999 vs
2000 is not a big difference in this case. In this case, it says "the
image become invisible", so hopefully you can easily just manually load
and save the document and verify if on your machine the image becomes
invisible in Word or not. :-)



I tried doing this, however I'm still having trouble simulating the test. I figured out that the export is a Word export, and if I unzip it word/document.xml contains what I want.

However, how does the export/import/export thing works? I tried loading the .docx, saving it as .odt and exporting again, but unless I did something wrong, I think I ended up with the same file...

Thanks,
Renato.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Miklos Vajna-4 Miklos Vajna-4
Reply | Threaded
Open this post in threaded view
|

Re: Failing unit test in Mac OS X Yosemite 10.10.1

Hi Renato,

On Mon, Dec 15, 2014 at 12:28:20PM +0000, Renato Ferreira <[hidden email]> wrote:
> However, how does the export/import/export thing works? I tried loading the
> .docx, saving it as .odt and exporting again, but unless I did something
> wrong, I think I ended up with the same file...

http://opengrok.libreoffice.org/xref/core/sw/qa/extras/README describes
how the sw export tests work. So, to manually reproduce: open the docx
file, save it as docx, then open both the original and the saved file in
Word, and make sure that the asserted aspect does not differ (here: one
of the images became invisible).

Regards,

Miklos

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

signature.asc (188 bytes) Download Attachment
Renato Ferreira Renato Ferreira
Reply | Threaded
Open this post in threaded view
|

Re: Failing unit test in Mac OS X Yosemite 10.10.1

Hi Miklos,
 
http://opengrok.libreoffice.org/xref/core/sw/qa/extras/README describes
how the sw export tests work. So, to manually reproduce: open the docx
file, save it as docx, then open both the original and the saved file in
Word, and make sure that the asserted aspect does not differ (here: one
of the images became invisible).



Thanks! I had tried that initially, but now I think I understand the source of my confusion: the "wrong" value arises not from the export, but from the subsequent import. Thus it is only visible in the temporary file that the unit test uses after importing the exported version.

More specifically, when I export manually, the XML shows the exact value of the original document, which would pass the test, of course. It is only when that is imported that a different value appears. A diff between the exported version and the temporary file that the unit test generates (which is used in the unit test to check the value) shows:

$ diff saved/word/formatted.xml unit/word/formatted.xml 
35c35
<                         <a:srcRect l="17662" t="0" r="17662" b="0"/>
---
>                         <a:srcRect l="22452" t="0" r="22452" b="0"/>

This probably has to do with the fact that the exporter changes a few tags, so that might be interpreted somewhat differently later on. I'm actually not sure if the temporary file that I am talking about is actually an imported version, but it is the only thing that makes sense to me.

More to the point, I opened both documents on Word and they are identical, no invisible images at all. So maybe it is OK?

Thanks for the help.

Regards,
Renato.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Miklos Vajna-4 Miklos Vajna-4
Reply | Threaded
Open this post in threaded view
|

Re: Failing unit test in Mac OS X Yosemite 10.10.1

Hi Renato,

On Tue, Dec 16, 2014 at 01:18:34PM +0000, Renato Ferreira <[hidden email]> wrote:
> More to the point, I opened both documents on Word and they are identical,
> no invisible images at all. So maybe it is OK?

Thanks for checking. So please change the limit to suit your needs.
On my machine, the old value was 504666, the new is 19072, so as long as
your new limit is around the new value, it should be OK. Just push to
gerrit and it'll get the usual review.

Thanks,

Miklos

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

signature.asc (188 bytes) Download Attachment