strange cppunit test bug - result that is compared changes when modifying the expected value

Miklos Vajna vmiklos at collabora.co.uk
Thu Oct 10 12:13:20 CEST 2013


Hi,

On Thu, Oct 10, 2013 at 11:04:44AM +0200, Stephan Bergmann <sbergman at redhat.com> wrote:
> On 10/10/2013 02:06 AM, Christian Lohmaier wrote:
> >make CppunitTest_sw_ooxmlexport
> >
> >fails on the CentOS 5.9 release-build system because of a weired bug I
> >cannot quite explain:
> >
> >fdo66929.docx,ooxmlexport.cxx:1067:Assertion
> >Test name: Test::run
> >equality assertion failed
> >- Expected: 127
> >- Actual  : 254
> >
> >line 1067 is:
> >     CPPUNIT_ASSERT_EQUAL( sal_Int32( 127 ), getProperty< sal_Int32 >(
> >xFrame, "BottomBorderDistance" ) );
> >
> >So the test tells that BottomBorderDistance value was not the expected
> >value, HOWEVER:
> >
> >I change that line from 127 to 128:
> >     CPPUNIT_ASSERT_EQUAL( sal_Int32( 128 ), getProperty< sal_Int32 >(
> >xFrame, "BottomBorderDistance" ) );
> >
> >and run the test again, and now I get:
> >fdo66929.docx,ooxmlexport.cxx:1067:Assertion
> >Test name: Test::run
> >equality assertion failed
> >- Expected: 128
> >- Actual  : 127
> >
> >So mysteriously now the actual value is the correct/the initially expected one?!

Note that these tests are run twice:

http://opengrok.libreoffice.org/xref/core/sw/qa/extras/ooxmlexport/ooxmlexport.cxx#256

Isn't it possible that in the first case the "import" fails, and in the
second case the "import-export-import" fails? (Or the other way around.)

Would it help your situation if SAL_INFO messages would be emitted when
a test is started, when the first check is done and when the second
check is done?

Though, still strange that this happens only on CentOS5, and not on more
recent systems.

Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20131010/8e8053d2/attachment.pgp>


More information about the LibreOffice mailing list