Re: CppunitTest_sw_ooxmlexport4 failing with --disable-pch on Windows

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

 



On 12/07/2020 18:45, Mike Kaganski wrote:
On 11.07.2020 2:35, Mike Kaganski wrote:
In current master (at least a week, and still the same after pull just
now) I see 100% reproducible failure of make CppunitTest_sw_ooxmlexport4:

$ /opt/lo/bin/make CppunitTest_sw_ooxmlexport4
...
test_Tdf115030::Load_Reload_Verify finished in: 1500ms
C:/lo/src/core/test/source/xmltesttools.cxx(194) : error : Assertion
Test name: testComboBoxControl::Load_Reload_Verify
equality assertion failed
- Expected: manolo
- Actual  : Manolo
- In <file:///C:/cygwin64/tmp/lu23416a8g0y3.tmp>, XPath contents of child does not match

Failures !!!
Run: 85   Failure total: 1   Failures: 1   Errors: 0

This test succeeds normally though, when run individually:

$ /opt/lo/bin/make CppunitTest_sw_ooxmlexport4 CPPUNIT_TEST_NAME=testComboBoxControl

I was able to narrow down the problem to --disable-pch in my config.

I had played with the includes from PCH, and could find out that
including <boost/iterator/iterator_concepts.hpp> in the beginning of
sw/qa/extras/ooxmlexport/ooxmlexport4.cxx allows the test to pass. I
couldn't limit the includes further: only including what's included
inside that boost header does not allow the test to pass. But I don't
understand what does that mean (some ODR violation? some missing virtual
overridden function?...), and don't see where to look next. Does someone
have any ideas?

I think the issue is in what relative order the three individual tests

DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testComboBoxControl, "combobox-control.docx")
{
    // check XML
    xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
    assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]", "value", "manolo");
    assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[2]", "value", "pepito");
    assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", "manolo");

    // check imported control
    verifyComboBoxExport(getShapes() == 0);
}

CPPUNIT_TEST_FIXTURE(Test, tdf134043_ImportComboBoxAsDropDown_true)
{
    std::shared_ptr< comphelper::ConfigurationChanges > batch(comphelper::ConfigurationChanges::create());
    officecfg::Office::Writer::Filter::Import::DOCX::ImportComboBoxAsDropDown::set(true, batch);
    batch->commit();

    load(mpTestDocumentPath, "combobox-control.docx");
    verifyComboBoxExport(true);
}

CPPUNIT_TEST_FIXTURE(Test, tdf134043_ImportComboBoxAsDropDown_false)
{
    std::shared_ptr< comphelper::ConfigurationChanges > batch(comphelper::ConfigurationChanges::create());
    officecfg::Office::Writer::Filter::Import::DOCX::ImportComboBoxAsDropDown::set(false, batch);
    batch->commit();

    load(mpTestDocumentPath, "combobox-control.docx");
    verifyComboBoxExport(false);
}

(that were added to sw/qa/extras/ooxmlexport/ooxmlexport4.cxx with <https://git.libreoffice.org/core/+/7b00fbddfb1cd55a68ed7481ebd4a5d5f60c6128%5E!/> "tdf#134043 DOCX import: new unit tests: ComboBox to DropDown") are executed:

With just --disable-pch, the order for me happens to be 2, 3, 1; while with an additional

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 7fe92c72eede..5fad8bd08bdf 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
+#include <boost/iterator/iterator_concepts.hpp>
 #include <swmodeltestbase.hxx>
#include <com/sun/star/awt/XBitmap.hpp>

the order happens to change to 2, 1, 3. Note how tests 2 and 3 modify global state, which presumably makes a different for the (failing) test 1.

Serge, can you see to get that fixed?

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



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

  Powered by Linux