sw/qa/extras/layout/layout.cxx |   34 +++++++++++++---------------------
 1 file changed, 13 insertions(+), 21 deletions(-)

New commits:
commit b98994620994fedcc31602e60be07a72fb9e83e1
Author:     Mike Kaganski <[email protected]>
AuthorDate: Tue Mar 1 10:12:15 2022 +0300
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Mar 1 14:30:55 2022 +0100

    Fix flaky test on Win64
    
    Obviously the left values are unstable; they were excluded on macOS,
    and they fail exactly on the same lines for me locally on Win64 build.
    So just test that the values are restored after delete and undo.
    
    Change-Id: I63dc50d223edb052a0ada200189cef94c2e0f8e5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130738
    Tested-by: Mike Kaganski <[email protected]>
    Reviewed-by: Mike Kaganski <[email protected]>
    (cherry picked from commit da77aec27e3121c895a6c6c287225216489cc8bc)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130769
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 79e06e3e3c17..0c7a4dc13ff0 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -1278,29 +1278,27 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf143239)
     SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf143239-1-min.odt");
     SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
 
+    // These are unstable on macOS and Win64 builds,
+    // so only test that they restore original values for now
+    OUString p2txt1Left, p2txt2Left, p3txt1Left;
+
     {
         xmlDocUniquePtr pXmlDoc = parseLayoutDump();
         assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1);
         assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
                     "18540");
-#ifndef MACOSX
-        assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-                    "3559");
-#endif
+        p2txt1Left
+            = getXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left");
         assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly", 1);
         assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "top",
                     "23894");
-#ifndef MACOSX
-        assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left",
-                    "1964");
-#endif
+        p2txt2Left
+            = getXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left");
         assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly", 1);
         assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
                     "35662");
-#ifndef MACOSX
-        assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-                    "3129");
-#endif
+        p3txt1Left
+            = getXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left");
         assertXPath(pXmlDoc, "/root/page", 3);
         discardDumpedLayout();
     }
@@ -1316,24 +1314,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf143239)
         assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1);
         assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
                     "18540");
-#ifndef MACOSX
         assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-                    "3559");
-#endif
+                    p2txt1Left);
         assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly", 1);
         assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "top",
                     "23894");
-#ifndef MACOSX
         assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left",
-                    "1964");
-#endif
+                    p2txt2Left);
         assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly", 1);
         assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
                     "35662");
-#ifndef MACOSX
         assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-                    "3129");
-#endif
+                    p3txt1Left);
         assertXPath(pXmlDoc, "/root/page", 3);
         discardDumpedLayout();
     }

Reply via email to