diff options
Diffstat (limited to 'sw/qa')
-rwxr-xr-x | sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx | bin | 0 -> 89419 bytes | |||
-rwxr-xr-x | sw/qa/extras/layout/data/LIBREOFFICE-N4LA0OHZ.rtf | 347 | ||||
-rw-r--r-- | sw/qa/extras/layout/data/LIBREOFFICE-UXTSOREL.rtf | bin | 0 -> 109018 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 13 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 1 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 1 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 1 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 1 | ||||
-rw-r--r-- | sw/qa/uitest/librelogo/compile.py | 132 | ||||
-rw-r--r-- | sw/qa/uitest/librelogo/run.py | 103 | ||||
-rw-r--r-- | sw/qa/unit/sw-dialogs-test.cxx | 1 | ||||
-rw-r--r-- | sw/qa/unit/sw-dialogs-test_2.cxx | 1 |
13 files changed, 363 insertions, 240 deletions
diff --git a/sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx b/sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx Binary files differnew file mode 100755 index 000000000000..add554ae9596 --- /dev/null +++ b/sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx diff --git a/sw/qa/extras/layout/data/LIBREOFFICE-N4LA0OHZ.rtf b/sw/qa/extras/layout/data/LIBREOFFICE-N4LA0OHZ.rtf new file mode 100755 index 000000000000..47d284aa5753 --- /dev/null +++ b/sw/qa/extras/layout/data/LIBREOFFICE-N4LA0OHZ.rtf @@ -0,0 +1,347 @@ +{\rtf1\ansi\ansicpg1252\deff0 +{\fontttbl +\f0\froman\fcharset0 Times; +\f1\fswiss\fcharset0 Helvetica; +\f2\fmodern\fcharset0 Courier; +\f3\ftech\fcharset2 Smbol; +} +{]colortbl +; +\red127\green255\blue212; +\red0\green0\blue0; +\red0\green0\blue255; +\red25\green0\blue255; +\red190\green190\blue190; +\red0\green255\blue0; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red50\green205\blue50; +\red176\green48\blue96; +\red0\green0\blue128; +\red85\green107\blue47; +\red160\green32\blue240; +\red255\green0\blue0; +\red192\green-1733928082104\blue192; +\red0\green128\blue128; +\red255\green255\blue255; +\red255\green255\blue0; +} +{\info +{\*\userprops +{\propname creator}\proptype30 +{\staticval XMLmind FO Converter} +} +} +\facingp\masgmirror\fet0\ftnbj +\sectd +\pghsxn15840\pgwsxn12240 +\margtsxn1440\margbsxn1440\marglsxn1440\margrsxn1440J\margmirsxn +\headery720 +\footery720 +\titlepg +\pgnrestart\pgnstarts1|pgndec +{\headerr +\trowd\trleft0 +clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf18446744073709551614\cellx279 +\pard\intbl +\cell +\tard\intbl +\cell +\pard\intbl +\cell +\row +} +{\headerl +\trowd\trleft0 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\ellx186 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\cellx279 +\pard\intbl +\cell +\pard\intbl +\cell +\pard\intbl +\cell +\row +} +{\headerf +} +{\footerr +\trowd\trleft0 +\clvertalb +\clbrdrT\brdrs\brdrw10\brdrcf2\cellx93 +\clvertalb +\clbrdrt\brdrs\brdrw10Lbrdrcf2\cellx186 +\clvertalb +\clbrdrt\brdvs\brdrw10\brdrcf2\cellx279 +\pard\intbl +\cell +\pard\intbl +\cell +\pard\intbl +\cell +\row +} +{footerl +\trowd\trleft0 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93 +\clvertalb +\clbrdrt\brdrs\brdrw10\brd2cf2\cellx186 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279 +\pard\intbl +\cell +\row +\pard\intbl +\cell +\pard\intbl +\cell +\row +} +{\footerf +} +{\*\bkmkstart id2754642} +{\*\bkmkend i`2754642} +\pard\qect +\sectd +\pghsxn1\pgwsxn12240 +\margtsxn1440\margbsxn1440\marglsxn1440\margrsxn1440 +\margmirsxn +\headery720\footery720 +\titlepg +\pgncont\pgnlcrm +{\headerr +\trowd\trleft0 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186 +\clvertalt +^clbrdrb\brdrs\brdrw10\brdrcf2\cellx279 +\pard\intbl +\cell +\pard\intbl +\cell +\pard\intbl +\cell +\row +} +{\headerl +\trowd\trleft0 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\cellx279 +\pard\intbl +\cell +\pard\intbl +\cell +\pard\intbl +\cell +\row +} +{\headerf +\trkwd\trleft0 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186 +\clvertalt +\clbrdrb\brdrs\brdrw10\bdrcf8\cellx279 +\pard\intbl +\cell +\pard\intbl +\cell +\pard\intbl +\cell +\row +} +{\footerr +\trowd\trleft0 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx186 +\cdrertalVQbdqomA +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279 +\pard\intbl +\cell +\pard\intbl\qc +{\plain\f0\fs20\cf2 +\chpgn +} +\cell +\pard\intbl +\cell +\row +} +{\footerl +\trowd\trleft0 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf3\cellx186 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279 +\pard\intbl +\cell +\pard\intbl\qc +{\plain\f0\fs20|cf2 +\chpgn +} +\cell +\pard\intbl +\cell +\row +} +{\footerf +\trowd\trleft0 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx186 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279 +\pard\intbl +\cell +\pard\intbl\qc +{\plain\f0\fs20\cf2 +\chpgn +} +\cell +\pard\intbl +\cell +\row +} +{\*\bkmkstart toc_2e__2e__2e_id2754642} +\pard\sb518\qj +{\plain\f000000000000000000000000000000000000000000000000000000128\fs35\b\cf2 +Table of %nntentsmpUMjkI +} +\par +{\*\bkmkend toc_2e__2e__2e_id2754642} +\pard\sb291\li960\ri480\tldot\tx4920 +{\field{\*|fldinst HYPERLINK \\l id2884528}{\fldrslt +{\plai~\f0\fs20cf2 +1. +} +}} +{\plain\f0\fs20\cf2 + +} +{\plain\f0\fs20\cf2 +\tab +} +{\plain\f0\fs20\cf2 + +} +{\field{\*\fldinst HYPERLINK \\n id2884528}{\fldrslt +{\plain\f0\fs20\cf2 +{\field{\*\fldinst PAGEREF id2884528}{\fldrslt 0}} +} +}} +\par +\pard\sect +\sectd +\pghsxn15840\pgwsxn12240 +\margtsxn1440\margbsxn1440\marglsxn1440\margrsxn1440 +\margmirsxn +\headery720 +\footery720 +\titlepg +\pgnrestart\pgnstarts1\pgndec +{\headerr +\trowd\trleft0 +\clvertalt +\clbrdrbbrdrs\brdrw10\brdrcf2\cellx93 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186 +\clvertalt +\clbrdrb\brdrs\brdrw10\brdrcf2\cellx279 +\pard\intbl +\cell +\pard\intbl +\cell +\pard\intbl +\cell +\rou +} +{\footarl +\trowd\trleft0 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx186 +mkend toc_2e__2e__2e_id2754642} +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279 +\pard\intbl +\cell +\pard\intbl\qc +{\%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain\f0\fs20\cf2 +\chpgn +} +Xcell +\pard\intbl +\cell +\row +} +{\footerf +\trowd\trleft0 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx186 +\clvertalb +\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279 +\pard\intbl +\cell +\pard\intbl\qc +{\plain\f0\fs20\cf2 +\chpgn +} +\cell +\pard\intbl +\cell +\row +} +\par} +\par} +\row +kbkmkend id2884--188884712918700} +\par}
\ No newline at end of file diff --git a/sw/qa/extras/layout/data/LIBREOFFICE-UXTSOREL.rtf b/sw/qa/extras/layout/data/LIBREOFFICE-UXTSOREL.rtf Binary files differnew file mode 100644 index 000000000000..d37de51622ef --- /dev/null +++ b/sw/qa/extras/layout/data/LIBREOFFICE-UXTSOREL.rtf diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index ec568d69f767..4e2e285ff020 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -56,7 +56,9 @@ public: void testUserFieldTypeLanguage(); void testTdf109137(); void testForcepoint72(); + void testUXTSOREL(); void testForcepoint76(); + void testN4LA0OHZ(); void testTdf118058(); void testTdf117188(); void testTdf117187(); @@ -96,7 +98,9 @@ public: CPPUNIT_TEST(testUserFieldTypeLanguage); CPPUNIT_TEST(testTdf109137); CPPUNIT_TEST(testForcepoint72); + CPPUNIT_TEST(testUXTSOREL); CPPUNIT_TEST(testForcepoint76); + CPPUNIT_TEST(testN4LA0OHZ); CPPUNIT_TEST(testTdf118058); CPPUNIT_TEST(testTdf117188); CPPUNIT_TEST(testTdf117187); @@ -2577,9 +2581,18 @@ void SwLayoutWriter::testTdf109137() //just care it doesn't crash void SwLayoutWriter::testForcepoint72() { createDoc("forcepoint72-1.rtf"); } +// FIXME: apparently infinite loop on Mac +#ifndef MACOSX +//just care it doesn't crash/assert +void SwLayoutWriter::testUXTSOREL() { createDoc("LIBREOFFICE-UXTSOREL.rtf"); } +#endif + //just care it doesn't crash/assert void SwLayoutWriter::testForcepoint76() { createDoc("forcepoint76-1.rtf"); } +//just care it doesn't crash/assert +void SwLayoutWriter::testN4LA0OHZ() { createDoc("LIBREOFFICE-N4LA0OHZ.rtf"); } + void SwLayoutWriter::testTdf118058() { SwDoc* pDoc = createDoc("tdf118058.fodt"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index ebc8da1bb79c..3c84ed37e97e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -19,7 +19,6 @@ #include <com/sun/star/text/XTextRangeCompare.hpp> #include <com/sun/star/text/WritingMode2.hpp> #include <com/sun/star/text/TableColumnSeparator.hpp> -#include <o3tl/cppunittraitshelper.hxx> #include <oox/drawingml/drawingmltypes.hxx> #include <config_features.h> #include <string> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 09bc82a493ce..64b9adc07ff9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -48,7 +48,6 @@ #include <com/sun/star/drawing/Hatch.hpp> #include <com/sun/star/rdf/URI.hpp> #include <com/sun/star/rdf/Statement.hpp> -#include <o3tl/cppunittraitshelper.hxx> #include <string> #include <config_features.h> diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 20d769bf77e3..e05d7490519a 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -53,7 +53,6 @@ #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/document/XImporter.hpp> #include <vcl/bitmapaccess.hxx> -#include <o3tl/cppunittraitshelper.hxx> #include <unotools/fltrcfg.hxx> #include <comphelper/sequenceashashmap.hxx> #include <com/sun/star/text/GraphicCrop.hpp> diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index df71b2359cea..263b9aef0e5d 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -39,7 +39,7 @@ #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp> #include <com/sun/star/text/XFormField.hpp> -#include <o3tl/cppunittraitshelper.hxx> + #include <rtl/ustring.hxx> #include <vcl/settings.hxx> #include <comphelper/sequenceashashmap.hxx> diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index b007d50ff4a1..ed742104e1c9 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -92,7 +92,6 @@ #include <com/sun/star/document/XEmbeddedObjectSupplier2.hpp> #include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/linguistic2/XLinguProperties.hpp> -#include <o3tl/cppunittraitshelper.hxx> #include <o3tl/deleter.hxx> #include <o3tl/make_unique.hxx> #include <osl/file.hxx> diff --git a/sw/qa/uitest/librelogo/compile.py b/sw/qa/uitest/librelogo/compile.py deleted file mode 100644 index 89e538b8c926..000000000000 --- a/sw/qa/uitest/librelogo/compile.py +++ /dev/null @@ -1,132 +0,0 @@ -# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from uitest.framework import UITestCase -from libreoffice.uno.propertyvalue import mkPropertyValues -from uitest.uihelper.common import get_state_as_dict, type_text - -import time, re -from uitest.debug import sleep -from libreoffice.uno.propertyvalue import mkPropertyValues -from uitest.uihelper.common import select_pos - -class LibreLogoCompileTest(UITestCase): - LIBRELOGO_PATH = "vnd.sun.star.script:LibreLogo|LibreLogo.py$%s?language=Python&location=share" - LS = "#_@L_i_N_e@_#" # LibreLogo line separator for debug feature "jump to the bad LibreLogo program line" - - def createMasterScriptProviderFactory(self): - xServiceManager = self.xContext.ServiceManager - return xServiceManager.createInstanceWithContext( - "com.sun.star.script.provider.MasterScriptProviderFactory", - self.xContext) - - def getScript(self, command): - xMasterScriptProviderFactory = self.createMasterScriptProviderFactory() - document = self.ui_test.get_component() - xScriptProvider = xMasterScriptProviderFactory.createScriptProvider(document) - xScript = xScriptProvider.getScript(self.LIBRELOGO_PATH %command) - self.assertIsNotNone(xScript, "xScript was not loaded") - return xScript - - def test_compile_librelogo(self): - # XScript interface to LibreLogo Python compiler - xCompile = self.getScript("__compil__") - - for test in ( - # BASE COMMANDS - ("FORWARD 1 forward 1 fd 1", "forward(1)\nforward(1)\nforward(1)"), - ("BACK 1 back 1 bk 1", "backward(1)\nbackward(1)\nbackward(1)"), - ("RIGHT 1 right 1 rt 1", "turnright(1)\nturnright(1)\nturnright(1)"), - ("LEFT 1 left 1 lt 1", "turnleft(1)\nturnleft(1)\nturnleft(1)"), - # COMMENTS - ("fd 1; comment\n; full-line comment", "forward(1)\n" + self.LS), - # MULTI-LINE COMMAND - ("LABEL ~\n10 + 10", "label(10 + 10)\n" + self.LS), - # UNIT SPECIFIERS - # check specifier "pt" (point) - ("fd 1pt", "forward(1)"), - # check specifier "pt" (point) - ("fd 0.5pt", "forward(0.5)"), - # check "in" (inch) - ("fd 1in", "forward(72.0)"), - # check "cm" (centimeter) - ("fd 1cm", "forward(%s)" % (1/(2.54/72))), - # check "mm" (millimeter) - ("fd 10mm", "forward(%s)" % (1/(2.54/72))), - # angle - ("rt 90°", "turnright(90)"), - # clock-position - ("rt 3h", "turnright(90.0)"), - # CONDITION - ("if a = 1 [ ]", "if a == 1 :\n __checkhalt__()"), - # with else - ("if a == 1 [ ] [ ]", "if a == 1 :\n __checkhalt__()\nelse:\n __checkhalt__()"), - # LOOPS - ("repeat 10 [ ]", "for REPCOUNT in range(1, 1+int(10 )):\n __checkhalt__()"), - # endless loop - ("repeat [ ]", "REPCOUNT0 = 1\nwhile True:\n __checkhalt__()\n REPCOUNT = REPCOUNT0\n REPCOUNT0 += 1"), - # loop in loop - ("repeat 10 [ repeat REPCOUNT [ a=1 ] ]", "for REPCOUNT in range(1, 1+int(10 )):\n __checkhalt__()\n for REPCOUNT in range(1, 1+int(REPCOUNT )):\n __checkhalt__()\n a=1"), - # while - ("WHILE REPCOUNT < 10 [ ]", "REPCOUNT2 = 1\nwhile REPCOUNT2 < 10 :\n __checkhalt__()\n REPCOUNT = REPCOUNT2\n REPCOUNT2 += 1"), - # for - ("FOR i in [1, 2, 3] [ ]", "REPCOUNT4 = 1\nfor i in [1, 2, 3] :\n __checkhalt__()\n REPCOUNT = REPCOUNT4\n REPCOUNT4 += 1"), - ("FOR i IN RANGE COUNT 'letters' [ ]", "REPCOUNT6 = 1\nfor i in range(len(u'letters'),) :\n __checkhalt__()\n REPCOUNT = REPCOUNT6\n REPCOUNT6 += 1"), - # PROCEDURE - ("TO x\nLABEL 2\nEND", "global x\ndef x():\n __checkhalt__()\n %s\n label(2)\n %s" % (((self.LS),)*2)), - # FUNCTION - ("TO x\nOUTPUT 3\nEND", "global x\ndef x():\n __checkhalt__()\n %s\n return 3\n %s" % (((self.LS),)*2)), - # PROCEDURE WITH ARGUMENTS - ("TO x y\nLABEL y\nEND\nx 25", "global x\ndef x(y):\n __checkhalt__()\n %s\n label(y)\n %s\n%s\nx(25)" % (((self.LS),)*3)), - ("TO x :y :z\nLABEL :y + :z\nEND\nx 25 26", "global x\ndef x(_y, _z):\n __checkhalt__()\n %s\n label(_y + _z)\n %s\n%s\nx(25, 26)" % (((self.LS),)*3)), - ("TO x :y :z\nLABEL :y + :z\nEND\nx 25 :w", "global x\ndef x(_y, _z):\n __checkhalt__()\n %s\n label(_y + _z)\n %s\n%s\nx(25, _w)" % (((self.LS),)*3)), - # UNICODE VARIABLE NAMES - ("Erdős=1", "Erd__u__0151s=1"), - # STRING CONSTANTS - ("LABEL \"label", "label(u'label')"), - ("LABEL “label”", "label(u'label')"), - ("LABEL 'label'", "label(u'label')"), - ("LABEL ‘label’", "label(u'label')"), - # check apostrophe and quote usage within strings - ("LABEL “label\’s”", "label(u'label’s')"), - ("LABEL ““It\’s quote\’s...\””", "label(u'“It’s quote’s...”')"), - ("LABEL ““It\\'s quote\\'s...\””", "label(u'“It\\'s quote\\'s...”')"), - # CONVERSION OF LOGO EXPRESSIONS - ("a=SIN 100 + COS 100", "a=sin(100 + cos(100))"), - ("a=SIN(101) + COS(101)", "a=sin(101) + cos(101)"), - ("a=(SIN 102) + (COS 102)", "a=(sin(102)) + (cos(102))"), - ("a=SIN 103 + COS 103 - SQRT 103", "a=sin(103 + cos(103 - sqrt(103)))"), - ("a=(SIN 104 + COS 104) - SQRT 104", "a=(sin(104 + cos(104))) - sqrt(104)"), - # SIN(x) is Python-like, SIN (x) is Logo-like syntax - ("a=SIN(105) + COS (105) - SQRT 105", "a=sin(105) + cos((105) - sqrt(105))"), - ("a=COUNT [1, 2, 3]", "a=len([1, 2, 3])"), - ("PRINT COUNT [1, 2, 3]", "Print(len([1, 2, 3]))"), - ("PRINT 'TEXT: ' + 'CHAR'[0] + ' TEXT2: ' + variable[-1]", "Print(u'TEXT: ' + u'CHAR'[0] + u' TEXT2: ' + variable[-1])"), - ("PRINT 'TEXT: ' + 'CHAR'[0][n] + ' TEXT2: ' + varia[len k][i+1]", "Print(u'TEXT: ' + u'CHAR'[0][n] + u' TEXT2: ' + varia[len(k)][i+1])"), - ("a=SQRT COUNT [1, 2, 3]", "a=sqrt(len([1, 2, 3]))"), - ("a=RANGE 1", "a=range(1,)"), - ("a=RANGE 1 10", "a=range(1, 10,)"), - ("a=RANGE 1 10 5", "a=range(1, 10, 5)"), - ("a=RANDOM 40 + 120", "a=Random(40 + 120)"), - ("a=RANDOM(40) + 120", "a=Random(40) + 120"), - ("a=RANDOM [1, 2, 3]", "a=Random([1, 2, 3])"), - ("a=[sin 90 + cos 15, cos 100 * x, sqrt 25 * 25]", "a=[sin(90 + cos(15)), cos(100 * x), sqrt(25 * 25)]"), - ("a=[sin 90 + cos 15, cos 100 * x, sqrt 25 * 25]", "a=[sin(90 + cos(15)), cos(100 * x), sqrt(25 * 25)]"), - ("a=[sin(90) + cos 15, cos(100) * x, sqrt(25) * 25]", "a=[sin(90) + cos(15), cos(100) * x, sqrt(25) * 25]"), - ("TO x y z\nOUTPUT 3\nEND", "global x\ndef x(y, z):\n __checkhalt__()\n %s\n return 3\n %s" % (((self.LS),)*2)), - ("TO x\nOUTPUT 3\nEND", "global x\ndef x():\n __checkhalt__()\n %s\n return 3\n %s" % (((self.LS),)*2)), - ("TO f x y z\nOUTPUT x+y+z\nEND\na = [-sin -len f [-cos 45, 6] -len [1, 2, 3] -sin -90", "global f\ndef f(x, y, z):\n __checkhalt__()\n %s\n return x+y+z\n %s\n%s\na = [-sin(-len(f([-cos(45), 6], -len([1, 2, 3]), -sin(-90))))" % (((self.LS),)*3)), - ("TO f x y z\nOUTPUT x+y+z\nEND\na = [sin len f [cos 45, 6] [1, 2, 3] sin 90", "global f\ndef f(x, y, z):\n __checkhalt__()\n %s\n return x+y+z\n %s\n%s\na = [sin(len(f([cos(45), 6], [1, 2, 3], sin(90))))" % (((self.LS),)*3)), - ("TO f x y z\nLABEL x+y+z\nEND\nf len [1, cos 2, [65]] sqrt len [1, 2, 3, 4] sin 90 * cos 270", "global f\ndef f(x, y, z):\n __checkhalt__()\n %s\n label(x+y+z)\n %s\n%s\nf(len([1, cos(2), [65]]), sqrt(len([1, 2, 3, 4])), sin(90 * cos(270)))" % (((self.LS),)*3)), - ("TO f x y z\nLABEL x+y+z\nEND\nf len([1, cos 2, [65]]) sqrt(len [1, 2, 3, 4]) sin(90) * cos 270", "global f\ndef f(x, y, z):\n __checkhalt__()\n %s\n label(x+y+z)\n %s\n%s\nf(len([1, cos(2), [65]]), sqrt(len([1, 2, 3, 4])), sin(90) * cos(270))" % (((self.LS),)*3)), - ("TO f x y z\nLABEL x+y+z\nEND\nf (len [1, cos 2, [65]]) (sqrt len [1, 2, 3, 4]) (sin 90) * (cos 270)", "global f\ndef f(x, y, z):\n __checkhalt__()\n %s\n label(x+y+z)\n %s\n%s\nf((len([1, cos(2), [65]])), (sqrt(len([1, 2, 3, 4]))), (sin(90)) * (cos(270)))" % (((self.LS),)*3)), - # arbitrary order of function definitions and calls - ("f 1 1 f 2 2\nTO f x y\nPRINT x + y\nEND", "global f\nf(1, 1)\nf(2, 2)\n%s\ndef f(x, y):\n __checkhalt__()\n %s\n Print(x + y)\n %s" % (((self.LS),)*3)), - ): - compiled = xCompile.invoke((test[0],), (), ())[0] - self.assertEqual(test[1], re.sub(r'(\n| +\n)+', '\n', re.sub(r'\( ', '(', compiled)).strip()) - -# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/uitest/librelogo/run.py b/sw/qa/uitest/librelogo/run.py deleted file mode 100644 index 5d64e1bea152..000000000000 --- a/sw/qa/uitest/librelogo/run.py +++ /dev/null @@ -1,103 +0,0 @@ -# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from uitest.framework import UITestCase -from libreoffice.uno.propertyvalue import mkPropertyValues -from uitest.uihelper.common import get_state_as_dict, type_text - -import time -from uitest.debug import sleep -from libreoffice.uno.propertyvalue import mkPropertyValues -from uitest.uihelper.common import select_pos - -class LibreLogoTest(UITestCase): - LIBRELOGO_PATH = "vnd.sun.star.script:LibreLogo|LibreLogo.py$%s?language=Python&location=share" - - def createMasterScriptProviderFactory(self): - xServiceManager = self.xContext.ServiceManager - return xServiceManager.createInstanceWithContext( - "com.sun.star.script.provider.MasterScriptProviderFactory", - self.xContext) - - def getScript(self, command): - xMasterScriptProviderFactory = self.createMasterScriptProviderFactory() - document = self.ui_test.get_component() - xScriptProvider = xMasterScriptProviderFactory.createScriptProvider(document) - xScript = xScriptProvider.getScript(self.LIBRELOGO_PATH %command) - self.assertIsNotNone(xScript, "xScript was not loaded") - return xScript - - def logo(self, command): - self.xUITest.executeCommand(self.LIBRELOGO_PATH %command) - - def test_librelogo(self): - self.ui_test.create_doc_in_start_center("writer") - document = self.ui_test.get_component() - xWriterDoc = self.xUITest.getTopFocusWindow() - xWriterEdit = xWriterDoc.getChild("writer_edit") - # to check the state of LibreLogo program execution - xIsAlive = self.getScript("__is_alive__") - - # run a program with basic drawing commands FORWARD and RIGHT - # using their abbreviated names FD and RT - type_text(xWriterEdit, "fd 100 rt 45 fd 100") - self.logo("run") - # wait for LibreLogo program termination - while xIsAlive.invoke((), (), ())[0]: - pass - # check shape count for - # a) program running: - # - turtle shape: result of program start - # - line shape: result of turtle drawing - # b) continuous line drawing (the regression - # related to the fix of tdf#106792 resulted shorter line - # segments than the turtle path and non-continuous line - # drawing, ie. in this example, three line shapes - # instead of a single one. See its fix in - # commit 502e8785085f9e8b54ee383080442c2dcaf95b15) - self.assertEqual(document.DrawPage.getCount(), 2) - - # check formatting by "magic wand" - self.logo("__translate__") - # a) check expansion of abbreviated commands : fd -> FORWARD, rt -> RIGHT, - # b) check line breaking (fix for tdf#100941: new line instead of the text "\" and "n") - self.assertEqual(document.Text.String, "\nFORWARD 100 RIGHT 45 FORWARD 100") - # c) check usage of real paragraphs instead of line break (tdf#120422) - # first paragraph is empty (for working page break) - self.assertEqual(document.Text.createEnumeration().nextElement().String, "") - - # function definitions and calls can be in arbitrary order - document.Text.String = """ -; dragon curve -TO x n -IF n = 0 [ STOP ] -x n-1 -RIGHT 90 -y n-1 ; it worked only as "y(n-1)" -FORWARD 10 -END - -TO y n -IF n = 0 [ STOP ] -FORWARD 10 -x n-1 -LEFT 90 -y n-1 -END - -PICTURE ; start new line draw -x 3 ; draw only a few levels -""" - self.logo("run") - # wait for LibreLogo program termination - while xIsAlive.invoke((), (), ())[0]: - pass - # new shape + previous two ones = 3 - self.assertEqual(document.DrawPage.getCount(), 3) - - self.ui_test.close_doc() - -# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/unit/sw-dialogs-test.cxx b/sw/qa/unit/sw-dialogs-test.cxx index f5968d36b7e7..d0ede8bc5214 100644 --- a/sw/qa/unit/sw-dialogs-test.cxx +++ b/sw/qa/unit/sw-dialogs-test.cxx @@ -15,6 +15,7 @@ #include <tools/svlibrary.h> #include <sfx2/app.hxx> #include <vcl/abstdlg.hxx> +#include <osl/module.hxx> #include <swabstdlg.hxx> diff --git a/sw/qa/unit/sw-dialogs-test_2.cxx b/sw/qa/unit/sw-dialogs-test_2.cxx index fe59616aace7..761ed71c12b1 100644 --- a/sw/qa/unit/sw-dialogs-test_2.cxx +++ b/sw/qa/unit/sw-dialogs-test_2.cxx @@ -15,6 +15,7 @@ #include <tools/svlibrary.h> #include <sfx2/app.hxx> #include <vcl/abstdlg.hxx> +#include <osl/module.hxx> #include <swabstdlg.hxx> #include <swdll.hxx> |