[Libreoffice-commits] core.git: include/test test/source

2023-03-13 Thread Stephan Bergmann (via logerrit)
 include/test/sheet/xdatapilotdescriptor.hxx |3 ++-
 test/source/sheet/xdatapilotdescriptor.cxx  |5 ++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 758050caa06bd742dddea55fb29b0eec1b2309e4
Author: Stephan Bergmann 
AuthorDate: Thu Mar 9 23:05:20 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Mar 13 19:01:37 2023 +

Use a more reasonable type for XDataPilotDescriptor::checkName nIndex 
parameter

Change-Id: If9e6760a6b23c63d03d337d6b111493684d67c85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148568
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/include/test/sheet/xdatapilotdescriptor.hxx 
b/include/test/sheet/xdatapilotdescriptor.hxx
index 9186b52ebb8f..5e4e7c62da87 100644
--- a/include/test/sheet/xdatapilotdescriptor.hxx
+++ b/include/test/sheet/xdatapilotdescriptor.hxx
@@ -16,6 +16,7 @@
 
 #include 
 
+#include 
 #include 
 
 namespace apitest {
@@ -41,7 +42,7 @@ protected:
 private:
 static void testGetDataPilotFields_Impl( css::uno::Reference< 
css::sheet::XDataPilotDescriptor > const & xDescr );
 
-static void checkName( css::uno::Reference< css::container::XIndexAccess > 
const & xIndex, sal_Int32 nIndex );
+static void checkName( css::uno::Reference< css::container::XIndexAccess > 
const & xIndex, std::size_t nIndex );
 static std::vector maFieldNames;
 };
 
diff --git a/test/source/sheet/xdatapilotdescriptor.cxx 
b/test/source/sheet/xdatapilotdescriptor.cxx
index a9cbcf5b125c..20392ff8ae4b 100644
--- a/test/source/sheet/xdatapilotdescriptor.cxx
+++ b/test/source/sheet/xdatapilotdescriptor.cxx
@@ -16,7 +16,6 @@
 
 #include 
 
-#include 
 #include 
 
 using namespace css;
@@ -175,10 +174,10 @@ void XDataPilotDescriptor::testGetHiddenFields()
 checkName( xIndex, 3 );
 }
 
-void XDataPilotDescriptor::checkName( uno::Reference< container::XIndexAccess 
> const & xIndex, sal_Int32 nIndex )
+void XDataPilotDescriptor::checkName( uno::Reference< container::XIndexAccess 
> const & xIndex, std::size_t nIndex )
 {
 CPPUNIT_ASSERT(xIndex.is());
-CPPUNIT_ASSERT(maFieldNames.size() >= o3tl::make_unsigned(nIndex));
+CPPUNIT_ASSERT(maFieldNames.size() >= nIndex);
 
 for (sal_Int32 i = 0; i < xIndex->getCount(); ++i)
 {


[Libreoffice-commits] core.git: include/test test/source

2023-03-03 Thread Colomban Wendling (via logerrit)
 include/test/a11y/accessibletestbase.hxx |   11 ++-
 test/source/a11y/accessibletestbase.cxx  |   97 +++
 2 files changed, 69 insertions(+), 39 deletions(-)

New commits:
commit 8a449f2de0d926967331436adfd3d5dd0b9e2db8
Author: Colomban Wendling 
AuthorDate: Tue Feb 7 16:32:22 2023 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 3 10:58:05 2023 +

test: Use css::awt::XExtentdedToolkit::addTopWindowListener()

Use awt::XExtentdedToolkit::addTopWindowListener() instead of
Application::AddEventListener() for lower dependency on vcl::Window.

We however still require some vcl::Window for EventPosterHelper to work
without which we cannot post events to the dialog.  It however doesn't
really have to be the top-level window itself, any vcl::Window high
enough the event tree would probably work.

Change-Id: I40b56a6c9e45f4e2ef2cab27a735856baef7e3c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146634
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/test/a11y/accessibletestbase.hxx 
b/include/test/a11y/accessibletestbase.hxx
index 5f5fb54aff4b..1445d0eb4737 100644
--- a/include/test/a11y/accessibletestbase.hxx
+++ b/include/test/a11y/accessibletestbase.hxx
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -181,23 +182,25 @@ protected:
   const EventPosterHelperBase* pEventPosterHelper = 
nullptr);
 
 /* Dialog handling */
-class Dialog : public test::EventPosterHelper
+class Dialog : public test::AccessibleEventPosterHelper
 {
 private:
 bool mbAutoClose;
+css::uno::Reference mxDialog2;
+css::uno::Reference mxAccessible;
 
 public:
-Dialog(vcl::Window* pWindow, bool bAutoClose = true);
+Dialog(css::uno::Reference& xDialog2, bool 
bAutoClose = true);
 virtual ~Dialog();
 
 void setAutoClose(bool bAutoClose) { mbAutoClose = bAutoClose; }
 
 css::uno::Reference getAccessible() 
const
 {
-return mxWindow ? mxWindow->GetAccessible() : nullptr;
+return mxAccessible;
 }
 
-bool close(sal_Int32 result = VclResponseType::RET_CANCEL);
+void close(sal_Int32 result = VclResponseType::RET_CANCEL);
 
 css::uno::Reference
 tabTo(const sal_Int16 role, const std::u16string_view name)
diff --git a/test/source/a11y/accessibletestbase.cxx 
b/test/source/a11y/accessibletestbase.cxx
index bcfdcc89db1d..20d6c88a5e19 100644
--- a/test/source/a11y/accessibletestbase.cxx
+++ b/test/source/a11y/accessibletestbase.cxx
@@ -17,7 +17,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -30,7 +32,8 @@
 #include 
 #include 
 #include 
-#include 
+
+#include 
 
 #include 
 
@@ -347,12 +350,22 @@ bool test::AccessibleTestBase::tabTo(
 
 /* Dialog handling */
 
-test::AccessibleTestBase::Dialog::Dialog(vcl::Window* pWindow, bool bAutoClose)
-: test::EventPosterHelper(pWindow)
-, mbAutoClose(bAutoClose)
+test::AccessibleTestBase::Dialog::Dialog(uno::Reference& 
xDialog2, bool bAutoClose)
+: mbAutoClose(bAutoClose)
+, mxDialog2(xDialog2)
 {
-CPPUNIT_ASSERT(pWindow);
-CPPUNIT_ASSERT(pWindow->IsDialog());
+CPPUNIT_ASSERT(xDialog2.is());
+
+mxAccessible.set(xDialog2, uno::UNO_QUERY);
+if (mxAccessible)
+setWindow(mxAccessible);
+else
+{
+std::cerr << "WARNING: AccessibleTestBase::Dialog() constructed with 
awt::XDialog2 '"
+  << xDialog2->getTitle()
+  << "' not implementing accessibility::XAccessible. Event 
delivery will not work."
+  << std::endl;
+}
 }
 
 test::AccessibleTestBase::Dialog::~Dialog()
@@ -361,16 +374,13 @@ test::AccessibleTestBase::Dialog::~Dialog()
 close();
 }
 
-bool test::AccessibleTestBase::Dialog::close(sal_Int32 result)
+void test::AccessibleTestBase::Dialog::close(sal_Int32 result)
 {
-if (mxWindow && !mxWindow->isDisposed())
+if (mxDialog2)
 {
-uno::Reference 
xDialog2(mxWindow->GetComponentInterface(),
-   uno::UNO_QUERY_THROW);
-xDialog2->endDialog(result);
-return mxWindow->isDisposed();
+mxDialog2->endDialog(result);
+mxDialog2.clear();
 }
-return true;
 }
 
 std::shared_ptr
@@ -387,7 +397,7 @@ test::AccessibleTestBase::awaitDialog(const 
std::u16string_view name,
 class ListenerHelper : public DialogWaiter
 {
 DialogCancelMode miPreviousDialogCancelMode;
-Link mLink;
+uno::Reference mxToolkit;
 bool mbWaitingForDialog;
 std::exception_ptr mpException;
 std::u16string_view msName;
@@ -395,14 +405,14 @@ test::AccessibleTestBase::awaitDialog(const 
std::u16string_view name,
 bool mbAutoClose;
 Timer maTimeoutTimer;
 Idle 

[Libreoffice-commits] core.git: include/test test/source

2023-03-03 Thread Colomban Wendling (via logerrit)
 include/test/a11y/AccessibilityTools.hxx |2 +
 test/source/a11y/AccessibilityTools.cxx  |   53 +++
 2 files changed, 55 insertions(+)

New commits:
commit 1791b26d75bd50971fe58627c6554f1711890817
Author: Colomban Wendling 
AuthorDate: Thu Nov 3 15:17:46 2022 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 3 10:56:31 2023 +

test: Add debug print support for XAccessibleAction

Change-Id: Ic511f2abc62703ead40a585989c54345cf3c17ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142261
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/test/a11y/AccessibilityTools.hxx 
b/include/test/a11y/AccessibilityTools.hxx
index 749be0635198..38a76ce407f1 100644
--- a/include/test/a11y/AccessibilityTools.hxx
+++ b/include/test/a11y/AccessibilityTools.hxx
@@ -28,6 +28,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 class OOO_DLLPUBLIC_TEST AccessibilityTools
@@ -256,6 +257,7 @@ private:
 static OUString debugName(css::accessibility::XAccessibleContext* xctx);
 static OUString debugName(css::accessibility::XAccessible* xacc);
 static OUString debugName(const css::accessibility::AccessibleEventObject* 
evobj);
+static OUString debugName(css::accessibility::XAccessibleAction* xAct);
 };
 
 CPPUNIT_NS_BEGIN
diff --git a/test/source/a11y/AccessibilityTools.cxx 
b/test/source/a11y/AccessibilityTools.cxx
index 137b1bdc3a97..b754f46d2f69 100644
--- a/test/source/a11y/AccessibilityTools.cxx
+++ b/test/source/a11y/AccessibilityTools.cxx
@@ -24,8 +24,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 
+#include 
 #include 
 #include 
 #include 
@@ -647,6 +650,56 @@ OUString 
AccessibilityTools::debugName(accessibility::XAccessible* acc)
 return debugName(acc->getAccessibleContext().get());
 }
 
+OUString AccessibilityTools::debugName(accessibility::XAccessibleAction* xAct)
+{
+OUStringBuffer r = "actions=[";
+
+const sal_Int32 nActions = xAct->getAccessibleActionCount();
+for (sal_Int32 i = 0; i < nActions; i++)
+{
+if (i > 0)
+r.append(", ");
+
+r.append("description=\"");
+r.append(xAct->getAccessibleActionDescription(i));
+r.append('"');
+
+const auto& xKeyBinding = xAct->getAccessibleActionKeyBinding(i);
+if (xKeyBinding)
+{
+r.append(" keybindings=[");
+const sal_Int32 nKeyBindings = 
xKeyBinding->getAccessibleKeyBindingCount();
+for (sal_Int32 j = 0; j < nKeyBindings; j++)
+{
+if (j > 0)
+r.append(", ");
+
+int k = 0;
+for (const auto& keyStroke : 
xKeyBinding->getAccessibleKeyBinding(j))
+{
+if (k++ > 0)
+r.append(", ");
+
+r.append('"');
+if (keyStroke.Modifiers & awt::KeyModifier::MOD1)
+r.append("");
+if (keyStroke.Modifiers & awt::KeyModifier::MOD2)
+r.append("");
+if (keyStroke.Modifiers & awt::KeyModifier::MOD3)
+r.append("");
+if (keyStroke.Modifiers & awt::KeyModifier::SHIFT)
+r.append("");
+r.append(keyStroke.KeyChar);
+r.append('"');
+}
+}
+r.append("]");
+}
+}
+r.append("]");
+return r.makeStringAndClear();
+}
+
 OUString AccessibilityTools::debugName(const 
accessibility::AccessibleEventObject* evobj)
 {
 return "(AccessibleEventObject) { id=" + getEventIdName(evobj->EventId)


[Libreoffice-commits] core.git: include/test test/source

2022-11-25 Thread Mike Kaganski (via logerrit)
 include/test/xmltesttools.hxx |   10 +++---
 test/source/xmltesttools.cxx  |5 -
 2 files changed, 3 insertions(+), 12 deletions(-)

New commits:
commit 2f91ab025de850fe5af8114565755a8deed55911
Author: Mike Kaganski 
AuthorDate: Fri Nov 25 16:36:57 2022 +0300
Commit: Mike Kaganski 
CommitDate: Fri Nov 25 17:19:10 2022 +0100

Merge two assertXPath overloads that both check number of nodes

Change-Id: I67eec623b90ab20330fa0c268152211b6bbdbe1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143301
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index a9f30f7d227d..09f06af5eb0d 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -65,10 +65,6 @@ protected:
  * Get the number of the nodes returned by the rXPath.
  */
 int   countXPathNodes(const xmlDocUniquePtr& pXmlDoc, const 
OString& rXPath);
-/**
- * Assert that rXPath exists, and returns exactly one node.
- */
-void  assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& 
rXPath);
 /**
  * Assert that rXPath exists, returns exactly one node, and the rXPath's 
attribute's value
  * equals to the rExpected value.
@@ -78,10 +74,10 @@ protected:
 void  assertXPathAttrs(const xmlDocUniquePtr& pXmlDoc, const 
OString& rXPath,
   const std::vector>& 
aPairVector);
 /**
- * Assert that rXPath exists, and returns exactly nNumberOfNodes nodes.
- * Useful for checking that we do _not_ export some node (nNumberOfNodes 
== 0).
+ * Assert that rXPath exists, and returns exactly nNumberOfNodes nodes (1 
by default).
+ * Also useful for checking that we do _not_ export some node 
(nNumberOfNodes == 0).
  */
-void  assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& 
rXPath, int nNumberOfNodes);
+void  assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& 
rXPath, int nNumberOfNodes = 1);
 /**
  * Assert that rXPath exists, and its content equals rContent.
  */
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx
index 26973b440c61..e329bc968760 100644
--- a/test/source/xmltesttools.cxx
+++ b/test/source/xmltesttools.cxx
@@ -162,11 +162,6 @@ OUString XmlTestTools::getXPathContent(const 
xmlDocUniquePtr& pXmlDoc, const OSt
 CPPUNIT_FAIL("Invalid XPath type");
 }
 
-void XmlTestTools::assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& 
rXPath)
-{
-getXPath(pXmlDoc, rXPath, ""); // it asserts that rXPath exists, and 
returns exactly one node
-}
-
 void XmlTestTools::assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& 
rXPath, const OString& rAttribute, const OUString& rExpectedValue)
 {
 OUString aValue = getXPath(pXmlDoc, rXPath, rAttribute);


[Libreoffice-commits] core.git: include/test test/source ucb/source unoxml/source writerfilter/source

2019-08-24 Thread Noel Grandin (via logerrit)
 include/test/table/xtablecolumns.hxx |2 +-
 test/source/table/xtablecolumns.cxx  |2 +-
 ucb/source/ucp/webdav-neon/webdavcontent.cxx |2 +-
 ucb/source/ucp/webdav-neon/webdavcontent.hxx |2 +-
 unoxml/source/rdf/librdf_repository.cxx  |8 
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |4 ++--
 writerfilter/source/dmapper/DomainMapperTableManager.hxx |2 +-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx|4 ++--
 writerfilter/source/dmapper/DomainMapper_Impl.hxx|4 ++--
 writerfilter/source/dmapper/FontTable.cxx|2 +-
 writerfilter/source/dmapper/FontTable.hxx|2 +-
 writerfilter/source/dmapper/StyleSheetTable.cxx  |6 +++---
 writerfilter/source/dmapper/StyleSheetTable.hxx  |6 +++---
 writerfilter/source/dmapper/ThemeTable.cxx   |2 +-
 writerfilter/source/dmapper/ThemeTable.hxx   |2 +-
 writerfilter/source/ooxml/OOXMLParserState.cxx   |2 +-
 writerfilter/source/ooxml/OOXMLParserState.hxx   |2 +-
 17 files changed, 27 insertions(+), 27 deletions(-)

New commits:
commit 57c9a995bafcaeb9ab00facb9b7f3ed52c7e7d2a
Author: Noel Grandin 
AuthorDate: Sat Aug 24 20:35:05 2019 +0200
Commit: Noel Grandin 
CommitDate: Sat Aug 24 22:12:28 2019 +0200

loplugin:returnconstval in test..writerfilter

Change-Id: Iea7d15f0a54921514cc4b71c5dc8caaa2ee573c8
Reviewed-on: https://gerrit.libreoffice.org/78063
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/test/table/xtablecolumns.hxx 
b/include/test/table/xtablecolumns.hxx
index 169eac9dbc77..957d344c598f 100644
--- a/include/test/table/xtablecolumns.hxx
+++ b/include/test/table/xtablecolumns.hxx
@@ -47,7 +47,7 @@ protected:
 private:
 css::uno::Reference m_xSheet;
 
-static const OUString getCellText(const 
css::uno::Reference& r_xCell);
+static OUString getCellText(const css::uno::Reference& 
r_xCell);
 };
 
 } // namespace apitest
diff --git a/test/source/table/xtablecolumns.cxx 
b/test/source/table/xtablecolumns.cxx
index 90c67977dd83..b338ddd0bdb4 100644
--- a/test/source/table/xtablecolumns.cxx
+++ b/test/source/table/xtablecolumns.cxx
@@ -163,7 +163,7 @@ void XTableColumns::testRemoveByIndexWithOutOfBoundIndex()
 CPPUNIT_ASSERT_THROW(xTC->removeByIndex(xTC->getCount(), 1), 
uno::RuntimeException);
 }
 
-const OUString XTableColumns::getCellText(const uno::Reference& 
r_xCell)
+OUString XTableColumns::getCellText(const uno::Reference& 
r_xCell)
 {
 uno::Reference xST(r_xCell, uno::UNO_QUERY_THROW);
 return xST->getString();
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx 
b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index b360f300265a..62181772ae17 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -3664,7 +3664,7 @@ void Content::cancelCommandExecution(
 }
 
 
-const OUString
+OUString
 Content::getBaseURI( const std::unique_ptr< DAVResourceAccess > & rResAccess )
 {
 osl::Guard< osl::Mutex > aGuard( m_aMutex );
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.hxx 
b/ucb/source/ucp/webdav-neon/webdavcontent.hxx
index 2d56c02b42c3..dbe3102c744b 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.hxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.hxx
@@ -142,7 +142,7 @@ private:
 bool
 exchangeIdentity( const css::uno::Reference< css::ucb::XContentIdentifier 
>& xNewId );
 
-const OUString
+OUString
 getBaseURI( const std::unique_ptr< DAVResourceAccess > & rResAccess );
 
 /// @throws css::uno::Exception
diff --git a/unoxml/source/rdf/librdf_repository.cxx 
b/unoxml/source/rdf/librdf_repository.cxx
index eb15843ef25b..72e417cfd699 100644
--- a/unoxml/source/rdf/librdf_repository.cxx
+++ b/unoxml/source/rdf/librdf_repository.cxx
@@ -344,10 +344,10 @@ public:
 const uno::Sequence< css::uno::Any > & i_rArguments) override;
 
 // XNamedGraph forwards -
-const NamedGraphMap_t::iterator clearGraph_NoLock(
+NamedGraphMap_t::iterator clearGraph_NoLock(
 const OUString & i_rGraphName,
 bool i_Internal = false );
-const NamedGraphMap_t::iterator clearGraph_Lock(
+NamedGraphMap_t::iterator clearGraph_Lock(
 const OUString & i_rGraphName,
 bool i_Internal);
 void addStatementGraph_NoLock(
@@ -1747,7 +1747,7 @@ void SAL_CALL librdf_Repository::initialize(
 m_pWorld.get(), m_pStorage.get()), safe_librdf_free_model);
 }
 
-const NamedGraphMap_t::iterator librdf_Repository::clearGraph_NoLock(
+NamedGraphMap_t::iterator librdf_Repository::clearGraph_NoLock(
 OUString const& i_rGraphName, bool i_Internal)
 //throw (uno::RuntimeException, container::NoSuchElementException,
 //

[Libreoffice-commits] core.git: include/test test/source

2019-07-23 Thread Gabor Kelemen (via logerrit)
 include/test/container/xnameaccess.hxx   |1 -
 include/test/drawing/xshapedescriptor.hxx|1 -
 include/test/helper/form.hxx |1 -
 include/test/helper/shape.hxx|1 -
 include/test/helper/transferable.hxx |1 -
 include/test/lang/xcomponent.hxx |1 -
 include/test/lang/xserviceinfo.hxx   |1 -
 include/test/sheet/cellarealink.hxx  |1 -
 include/test/sheet/functiondescription.hxx   |1 -
 include/test/sheet/xprintareas.hxx   |2 +-
 include/test/sheet/xsheetannotation.hxx  |1 -
 include/test/sheet/xsheetoutline.hxx |3 +--
 include/test/sheet/xsheetpagebreak.hxx   |3 +--
 include/test/sheet/xspreadsheetdocument.hxx  |1 -
 include/test/sheet/xsubtotalcalculatable.hxx |1 -
 include/test/table/xcellrange.hxx|1 -
 include/test/table/xtablecolumns.hxx |2 --
 include/test/testinteractionhandler.hxx  |2 +-
 include/test/text/baseindex.hxx  |2 ++
 include/test/text/textdocumentindex.hxx  |3 +--
 include/test/text/textprintersettings.hxx|3 +--
 include/test/text/textsettings.hxx   |4 
 include/test/text/xsimpletext.hxx|2 +-
 include/test/text/xtext.hxx  |2 +-
 include/test/util/xsearchable.hxx|2 ++
 test/source/sheet/xsheetoutline.cxx  |1 +
 26 files changed, 17 insertions(+), 27 deletions(-)

New commits:
commit bfe225b7003d119ff214cbaa771289de105c48d5
Author: Gabor Kelemen 
AuthorDate: Sun Jul 7 23:10:31 2019 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jul 23 14:16:09 2019 +0200

tdf#42949 Fix IWYU warnings in include/test

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

New IWYU and recent developments in f-u-i helped to identify
some non self contained files, those were fixed too.

Change-Id: I527f7c2cf2660a758b13eabb4c444ff79ae35f8c
Reviewed-on: https://gerrit.libreoffice.org/75186
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/include/test/container/xnameaccess.hxx 
b/include/test/container/xnameaccess.hxx
index 6ff525917380..960cf67822b9 100644
--- a/include/test/container/xnameaccess.hxx
+++ b/include/test/container/xnameaccess.hxx
@@ -14,7 +14,6 @@
 
 #include 
 
-#include 
 #include 
 
 namespace apitest
diff --git a/include/test/drawing/xshapedescriptor.hxx 
b/include/test/drawing/xshapedescriptor.hxx
index cb7c37e3a5ba..2c99e7e9c197 100644
--- a/include/test/drawing/xshapedescriptor.hxx
+++ b/include/test/drawing/xshapedescriptor.hxx
@@ -14,7 +14,6 @@
 #include 
 
 #include 
-#include 
 
 namespace apitest
 {
diff --git a/include/test/helper/form.hxx b/include/test/helper/form.hxx
index d84794cc5b6d..0fbcd2c7b06a 100644
--- a/include/test/helper/form.hxx
+++ b/include/test/helper/form.hxx
@@ -15,7 +15,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 #include 
diff --git a/include/test/helper/shape.hxx b/include/test/helper/shape.hxx
index e4322bec1357..341a9fad93fc 100644
--- a/include/test/helper/shape.hxx
+++ b/include/test/helper/shape.hxx
@@ -10,7 +10,6 @@
 #ifndef INCLUDED_TEST_HELPER_SHAPE_HXX
 #define INCLUDED_TEST_HELPER_SHAPE_HXX
 
-#include 
 #include 
 #include 
 #include 
diff --git a/include/test/helper/transferable.hxx 
b/include/test/helper/transferable.hxx
index 280b28ad5006..d0454bc6e410 100644
--- a/include/test/helper/transferable.hxx
+++ b/include/test/helper/transferable.hxx
@@ -9,7 +9,6 @@
 
 #pragma once
 
-#include 
 #include 
 #include 
 #include 
diff --git a/include/test/lang/xcomponent.hxx b/include/test/lang/xcomponent.hxx
index fdbeccc6cf7b..9314749fbc52 100644
--- a/include/test/lang/xcomponent.hxx
+++ b/include/test/lang/xcomponent.hxx
@@ -10,7 +10,6 @@
 #ifndef INCLUDED_TEST_LANG_XCOMPONENT_HXX
 #define INCLUDED_TEST_LANG_XCOMPONENT_HXX
 
-#include 
 #include 
 #include 
 
diff --git a/include/test/lang/xserviceinfo.hxx 
b/include/test/lang/xserviceinfo.hxx
index 86a92480d970..14ce4e61 100644
--- a/include/test/lang/xserviceinfo.hxx
+++ b/include/test/lang/xserviceinfo.hxx
@@ -16,7 +16,6 @@
 
 #include 
 
-#include 
 #include 
 
 namespace apitest
diff --git a/include/test/sheet/cellarealink.hxx 
b/include/test/sheet/cellarealink.hxx
index 6eff944ae7be..eb3a13547c0a 100644
--- a/include/test/sheet/cellarealink.hxx
+++ b/include/test/sheet/cellarealink.hxx
@@ -15,7 +15,6 @@
 #include 
 
 #include 
-#include 
 
 namespace apitest
 {
diff --git a/include/test/sheet/functiondescription.hxx 
b/include/test/sheet/functiondescription.hxx
index 4e3128bcaaaf..bfe719bc5972 100644
--- a/include/test/sheet/functiondescription.hxx
+++ b/include/test/sheet/functiondescription.hxx
@@ -11,7 +11,6 @@
 #define INCLUDED_TEST_SHEET_FUNCTIONDESCRIPTION_HXX
 
 #include 
-#include 
 #include 
 
 #include 
diff --git a/include/test/sheet/xprintareas.hxx 
b/include/test/sheet/xprintareas.hxx

[Libreoffice-commits] core.git: include/test test/source

2019-05-02 Thread Jens Carl (via logerrit)
 include/test/lang/xserviceinfo.hxx |   11 +--
 test/source/lang/xserviceinfo.cxx  |4 ++--
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit de529f32120e2eaa73d804a53ce519979da38438
Author: Jens Carl 
AuthorDate: Fri May 3 00:33:02 2019 +
Commit: Jens Carl 
CommitDate: Fri May 3 03:32:45 2019 +0200

Enable testing of multiple service names

Enable testing of multiple service names of the object supports this, by
storing all possible names in a vector.

Change-Id: Iff2c974cc30a0729cb26b07002582e0786a4de44
Reviewed-on: https://gerrit.libreoffice.org/71713
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/lang/xserviceinfo.hxx 
b/include/test/lang/xserviceinfo.hxx
index 498e5ed8387f..86a92480d970 100644
--- a/include/test/lang/xserviceinfo.hxx
+++ b/include/test/lang/xserviceinfo.hxx
@@ -10,6 +10,8 @@
 #ifndef INCLUDED_TEST_LANG_XSERVICEINFO_HXX
 #define INCLUDED_TEST_LANG_XSERVICEINFO_HXX
 
+#include 
+
 #include 
 
 #include 
@@ -24,7 +26,12 @@ class OOO_DLLPUBLIC_TEST XServiceInfo
 public:
 XServiceInfo(const OUString& rImplName, const OUString& rServiceName)
 : m_aImplName(rImplName)
-, m_aServiceName(rServiceName)
+{
+m_aServiceNames.push_back(rServiceName);
+}
+XServiceInfo(const OUString& rImplName, const std::vector 
rServiceNames)
+: m_aImplName(rImplName)
+, m_aServiceNames(rServiceNames)
 {
 }
 
@@ -39,7 +46,7 @@ protected:
 
 private:
 OUString const m_aImplName;
-OUString const m_aServiceName;
+std::vector m_aServiceNames;
 };
 
 } // namespace apitest
diff --git a/test/source/lang/xserviceinfo.cxx 
b/test/source/lang/xserviceinfo.cxx
index 9db9e4b1cbe3..3f7e6541fa85 100644
--- a/test/source/lang/xserviceinfo.cxx
+++ b/test/source/lang/xserviceinfo.cxx
@@ -18,7 +18,6 @@
 #include 
 
 using namespace css;
-using namespace css::uno;
 
 namespace apitest
 {
@@ -41,7 +40,8 @@ void XServiceInfo::testSupportsService()
 {
 uno::Reference xSI(init(), uno::UNO_QUERY_THROW);
 
-CPPUNIT_ASSERT(xSI->supportsService(m_aServiceName));
+for (const auto& aServiceName : m_aServiceNames)
+CPPUNIT_ASSERT(xSI->supportsService(aServiceName));
 }
 
 } // namespace apitest
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/test test/source

2019-04-25 Thread Mike Kaganski (via logerrit)
 include/test/xmltesttools.hxx |   12 +++-
 test/source/xmltesttools.cxx  |5 +
 2 files changed, 12 insertions(+), 5 deletions(-)

New commits:
commit 3fef9fa3f5d260dd1264b67d8b42aad476332eea
Author: Mike Kaganski 
AuthorDate: Thu Apr 25 12:51:40 2019 +0300
Commit: Mike Kaganski 
CommitDate: Thu Apr 25 14:42:13 2019 +0200

assertXPath: disallow passing rAttribute without rExpectedValue

Change-Id: I7fb59039429361dad04fb68507f40545f9c4dd6d
Reviewed-on: https://gerrit.libreoffice.org/71290
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index 4f725f5948c5..c24a81eb65d6 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -61,12 +61,14 @@ protected:
 int   getXPathPosition(xmlDocPtr pXmlDoc, const OString& rXPath, 
const OUString& rChildName);
 /**
  * Assert that rXPath exists, and returns exactly one node.
- * In case rAttribute is provided, the rXPath's attribute's value must
- * equal to the rExpected value.
  */
-void  assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath,
-  const OString& rAttribute = OString(),
-  const OUString& rExpectedValue = OUString());
+void  assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath);
+/**
+ * Assert that rXPath exists, returns exactly one node, and the rXPath's 
attribute's value
+ * equals to the rExpected value.
+ */
+void  assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath, const 
OString& rAttribute,
+  const OUString& rExpectedValue);
 void  assertXPathAttrs(xmlDocPtr pXmlDoc, const OString& rXPath,
   const std::vector>& 
aPairVector);
 /**
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx
index 123af01b28db..20149cc03c37 100644
--- a/test/source/xmltesttools.cxx
+++ b/test/source/xmltesttools.cxx
@@ -135,6 +135,11 @@ OUString XmlTestTools::getXPathContent(xmlDocPtr pXmlDoc, 
const OString& rXPath)
 CPPUNIT_FAIL("Invalid XPath type");
 }
 
+void XmlTestTools::assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath)
+{
+getXPath(pXmlDoc, rXPath, ""); // it asserts that rXPath exists, and 
returns exactly one node
+}
+
 void XmlTestTools::assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath, const 
OString& rAttribute, const OUString& rExpectedValue)
 {
 OUString aValue = getXPath(pXmlDoc, rXPath, rAttribute);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/test test/source

2019-03-27 Thread Noel Grandin (via logerrit)
 include/test/sheet/xspreadsheets2.hxx |2 +-
 test/source/sheet/xspreadsheets2.cxx  |   29 ++---
 2 files changed, 11 insertions(+), 20 deletions(-)

New commits:
commit 705558aa455403cd006993f95b5b13981fdb3483
Author: Noel Grandin 
AuthorDate: Tue Mar 26 15:54:47 2019 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 27 07:40:12 2019 +0100

condition always true in XSpreadsheets2::importSheetToCopy

leftover from
commit ed45c87896de74048708d51c050ecd42c9f4a0a0
Date:   Mon Oct 20 21:08:54 2014 +0200
sc: fix temp file leak in ScTableSheetsObj

Change-Id: Ic108fb36cc0caccbe57f2b47f7fcbe80156842dc
Reviewed-on: https://gerrit.libreoffice.org/69749
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/test/sheet/xspreadsheets2.hxx 
b/include/test/sheet/xspreadsheets2.hxx
index e3928d349efb..1340b80be216 100644
--- a/include/test/sheet/xspreadsheets2.hxx
+++ b/include/test/sheet/xspreadsheets2.hxx
@@ -46,7 +46,7 @@ protected:
 css::uno::Reference< css::sheet::XSpreadsheetDocument> xDocument;
 
 private:
-css::uno::Reference< css::sheet::XSpreadsheetDocument> getDoc(const 
OUString&, css::uno::Reference< css::lang::XComponent >&);
+css::uno::Reference< css::sheet::XSpreadsheetDocument> getDoc(const 
OUString&);
 static css::uno::Reference< css::sheet::XNamedRanges> 
getNamedRanges(css::uno::Reference< css::sheet::XSpreadsheetDocument > const &);
 void importSheetToCopy();
 static bool isExternalReference(const OUString& aDestContent, const 
OUString& aSrcContent );
diff --git a/test/source/sheet/xspreadsheets2.cxx 
b/test/source/sheet/xspreadsheets2.cxx
index cea68e1cfad9..ab3ef3e75688 100644
--- a/test/source/sheet/xspreadsheets2.cxx
+++ b/test/source/sheet/xspreadsheets2.cxx
@@ -275,13 +275,12 @@ void XSpreadsheets2::testImportCellStyle()
 CPPUNIT_ASSERT_EQUAL_MESSAGE("New style: VertJustify not set", 
table::CellVertJustify_CENTER, 
static_cast(aVertJustify));
 }
 
-uno::Reference< sheet::XSpreadsheetDocument> XSpreadsheets2::getDoc(const 
OUString& aFileBase, uno::Reference< lang::XComponent >& xComp)
+uno::Reference< sheet::XSpreadsheetDocument> XSpreadsheets2::getDoc(const 
OUString& aFileBase)
 {
 OUString aFileURL;
 createFileURL(aFileBase, aFileURL);
 
-if (!xComp.is())
-xComp = loadFromDesktop(aFileURL);
+uno::Reference< lang::XComponent > xComp = loadFromDesktop(aFileURL);
 
 CPPUNIT_ASSERT(xComp.is());
 
@@ -301,22 +300,14 @@ void XSpreadsheets2::importSheetToCopy()
 uno::Reference< container::XNameAccess> 
xSrcNameAccess(init(),UNO_QUERY_THROW);
 xSrcSheet.set( xSrcNameAccess->getByName(gaSrcSheetName), UNO_QUERY_THROW);
 
-uno::Reference< lang::XComponent > xDestComponent;
-if (!xDestComponent.is())
-{
-xDestDoc = getDoc(gaDestFileBase, xDestComponent);
-CPPUNIT_ASSERT(xDestDoc.is());
-
-// import sheet
-uno::Reference< sheet::XSpreadsheets2 > xDestSheets 
(xDestDoc->getSheets(), UNO_QUERY_THROW);
-sal_Int32 nDestPos = 0;
-sal_Int32 nDestPosEffective = xDestSheets->importSheet(xDocument, 
gaSrcSheetName, nDestPos);
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong sheet index", nDestPosEffective, 
nDestPos);
-}
-else
-{
-xDestDoc.set(xDestComponent,UNO_QUERY_THROW);
-}
+xDestDoc = getDoc(gaDestFileBase);
+CPPUNIT_ASSERT(xDestDoc.is());
+
+// import sheet
+uno::Reference< sheet::XSpreadsheets2 > xDestSheets 
(xDestDoc->getSheets(), UNO_QUERY_THROW);
+sal_Int32 nDestPos = 0;
+sal_Int32 nDestPosEffective = xDestSheets->importSheet(xDocument, 
gaSrcSheetName, nDestPos);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong sheet index", nDestPosEffective, 
nDestPos);
 
 uno::Reference< container::XNameAccess > xDestSheetNameAccess 
(xDestDoc->getSheets(), UNO_QUERY_THROW);
 xDestSheet.set( xDestSheetNameAccess->getByName(gaSrcSheetName), 
UNO_QUERY_THROW);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/test test/source

2018-12-01 Thread Libreoffice Gerrit user
 include/test/container/xindexaccess.hxx |   23 +++
 test/source/container/xindexaccess.cxx  |   31 +++
 2 files changed, 30 insertions(+), 24 deletions(-)

New commits:
commit d0a6f8a8e862bede67989cd3fac105d7c8231eb0
Author: Jens Carl 
AuthorDate: Sat Dec 1 07:42:52 2018 +
Commit: Jens Carl 
CommitDate: Sat Dec 1 09:51:12 2018 +0100

Enable XIndexAccess test cases

Add macro OOO_DLLPUBLIC_TEST to class XIndexAccess (needed to use the
test cases), refactor ctor, and add missing header files.

Change-Id: Id8b27c8c3a3d7fc5c64fafd25b0d9b4b511c281f
Reviewed-on: https://gerrit.libreoffice.org/64375
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/container/xindexaccess.hxx 
b/include/test/container/xindexaccess.hxx
index 415008880e52..aa4273ded053 100644
--- a/include/test/container/xindexaccess.hxx
+++ b/include/test/container/xindexaccess.hxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -10,16 +10,23 @@
 #ifndef INCLUDED_TEST_CONTAINER_XINDEXACCESS_HXX
 #define INCLUDED_TEST_CONTAINER_XINDEXACCESS_HXX
 
+#include 
+
 #include 
 
-namespace apitest {
+#include 
 
-class XIndexAccess
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XIndexAccess
 {
 public:
-XIndexAccess(sal_Int32 nItems);
+XIndexAccess(sal_Int32 nItems)
+: m_nItems(nItems)
+{
+}
 
-virtual css::uno::Reference< css::uno::XInterface > init() = 0;
+virtual css::uno::Reference init() = 0;
 void testGetCount();
 void testGetByIndex();
 // will throw an exception and should fail if not
@@ -29,11 +36,11 @@ protected:
 ~XIndexAccess() {}
 
 private:
-sal_Int32 const mnItems;
+sal_Int32 const m_nItems;
 };
 
-}
+} // namespace apitest
 
 #endif // INCLUDED_TEST_CONTAINER_XINDEXACCESS_HXX
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/test/source/container/xindexaccess.cxx 
b/test/source/container/xindexaccess.cxx
index 3791e2b76393..9139136b36b3 100644
--- a/test/source/container/xindexaccess.cxx
+++ b/test/source/container/xindexaccess.cxx
@@ -8,49 +8,48 @@
  */
 
 #include 
+
 #include 
+
+#include 
+
 #include 
 
 using namespace css;
 using namespace css::uno;
 
-namespace apitest {
-
-XIndexAccess::XIndexAccess(sal_Int32 nItems):
-mnItems(nItems)
+namespace apitest
 {
-}
-
 void XIndexAccess::testGetCount()
 {
-uno::Reference< container::XIndexAccess > xIndexAccess(init(), 
UNO_QUERY_THROW);
-CPPUNIT_ASSERT_EQUAL(mnItems, xIndexAccess->getCount());
+uno::Reference xIndexAccess(init(), 
UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(m_nItems, xIndexAccess->getCount());
 }
 
 void XIndexAccess::testGetByIndex()
 {
-uno::Reference< container::XIndexAccess > xIndexAccess(init(), 
UNO_QUERY_THROW);
-CPPUNIT_ASSERT_EQUAL(mnItems, xIndexAccess->getCount());
+uno::Reference xIndexAccess(init(), 
UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(m_nItems, xIndexAccess->getCount());
 
-if (mnItems > 0)
+if (m_nItems > 0)
 {
 Any aAny = xIndexAccess->getByIndex(0);
 CPPUNIT_ASSERT(aAny.hasValue());
 
-aAny = xIndexAccess->getByIndex(mnItems/2);
+aAny = xIndexAccess->getByIndex(m_nItems / 2);
 CPPUNIT_ASSERT(aAny.hasValue());
 
-aAny = xIndexAccess->getByIndex(mnItems-1);
+aAny = xIndexAccess->getByIndex(m_nItems - 1);
 CPPUNIT_ASSERT(aAny.hasValue());
 }
 }
 
 void XIndexAccess::testGetByIndexException()
 {
-uno::Reference< container::XIndexAccess > xIndexAccess(init(), 
UNO_QUERY_THROW);
-xIndexAccess->getByIndex(mnItems);
+uno::Reference xIndexAccess(init(), 
UNO_QUERY_THROW);
+xIndexAccess->getByIndex(m_nItems);
 }
 
-}
+} // namespace apitest
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test test/source

2018-05-11 Thread Michael Stahl
 include/test/setupvcl.hxx|2 +-
 test/source/bootstrapfixture.cxx |2 +-
 test/source/setupvcl.cxx |4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit e57462cd7b08df2794b1c81e7bb15ed96afef1f1
Author: Michael Stahl 
Date:   Thu May 10 15:45:30 2018 +0200

test: force EnableHeadlessMode() for PythonTest

Clearly this should be on, but we can't easily pass in a command line
argument like is done in CppunitTest because that doesn't end up in
rtl_getAppCommandArg(), which is empty since it's the python.bin process,
so we'd have to find a way to get the argv from python first...

Change-Id: I9321a9f933f388a659643898e0dc38f295f2068c
Reviewed-on: https://gerrit.libreoffice.org/54083
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/include/test/setupvcl.hxx b/include/test/setupvcl.hxx
index e7a1d08bba2c..78d4683e50ce 100644
--- a/include/test/setupvcl.hxx
+++ b/include/test/setupvcl.hxx
@@ -17,7 +17,7 @@
 namespace test {
 
 // Calls InitVCL etc.; needed from multiple places in the test infrastructure:
-OOO_DLLPUBLIC_TEST_SETUPVCL void setUpVcl();
+OOO_DLLPUBLIC_TEST_SETUPVCL void setUpVcl(bool forceHeadless = false);
 
 }
 
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index 99fd73151dfb..0808a6d4f9e7 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -92,7 +92,7 @@ SAL_DLLPUBLIC_EXPORT void 
test_init(lang::XMultiServiceFactory *pFactory)
 try
 {
 ::comphelper::setProcessServiceFactory(pFactory);
-test::setUpVcl();
+test::setUpVcl(true); // hard-code python tests to headless
 test_init_impl(false, true, pFactory);
 }
 catch (...) { abort(); }
diff --git a/test/source/setupvcl.cxx b/test/source/setupvcl.cxx
index 99f17b7fb056..ff6eec8b8605 100644
--- a/test/source/setupvcl.cxx
+++ b/test/source/setupvcl.cxx
@@ -57,7 +57,7 @@ IMPL_STATIC_LINK_NOARG(Hook, deinitHook, LinkParamNone *, 
void) {
 
 }
 
-void test::setUpVcl() {
+void test::setUpVcl(bool const forceHeadless) {
 // Force locale (and resource files loaded):
 OUString locale;
 if (getenv("LO_TEST_LOCALE") != nullptr)
@@ -72,7 +72,7 @@ void test::setUpVcl() {
 MsLangId::setConfiguredSystemUILanguage(tag.getLanguageType(false));
 LanguageTag::setConfiguredSystemLanguage(tag.getLanguageType(false));
 InitVCL();
-if (isHeadless()) {
+if (forceHeadless || isHeadless()) {
 Application::EnableHeadlessMode(false);
 }
 Application::setDeInitHook(LINK(nullptr, Hook, deinitHook));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test test/source

2018-05-08 Thread Tomaž Vajngerl
 include/test/unoapi_property_testers.hxx |   34 +
 test/source/unoapi_property_testers.cxx  |   50 +--
 2 files changed, 81 insertions(+), 3 deletions(-)

New commits:
commit 2af7daa18467cc7c3f4f435c58cd19ee682f754f
Author: Tomaž Vajngerl 
Date:   Tue May 8 19:48:10 2018 +0900

extend property tester - add optional variants and color

Change-Id: Iad72470b5f1fc5405673d2d7781bc59002a3a44a
Reviewed-on: https://gerrit.libreoffice.org/53988
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/test/unoapi_property_testers.hxx 
b/include/test/unoapi_property_testers.hxx
index fce19763e21f..f45b772b86e3 100644
--- a/include/test/unoapi_property_testers.hxx
+++ b/include/test/unoapi_property_testers.hxx
@@ -12,6 +12,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -26,6 +27,16 @@ namespace apitest
 void OOO_DLLPUBLIC_TEST testBooleanProperty(
 css::uno::Reference const& xPropertySet, const 
OUString& name);
 
+/** @brief Tester for optional property type 'boolean' of a @see 
com::sun::star::beans::XPropertySet.
+ *
+ * Pass the test also if the property doesn't exists (throws a 
com::sun::star::beans::UnknownPropertyException)
+ *
+ * @param   xPropertySetThe property set, which contains the property to 
test against.
+ * @param   nameName of property to test.
+ */
+void OOO_DLLPUBLIC_TEST testBooleanOptionalProperty(
+css::uno::Reference const& xPropertySet, const 
OUString& name);
+
 /** @brief Tester for read-only property type 'boolean' of a @see 
com::sun::star::beans::XPropertySet.
  *
  * @param   xPropertySetThe property set, which contains the property to 
test against.
@@ -104,6 +115,18 @@ void OOO_DLLPUBLIC_TEST
 testStringProperty(css::uno::Reference const& 
xPropertySet,
const OUString& name, const OUString& rValue);
 
+/** @brief Tester for optional property type 'string' of a @see 
com::sun::star::beans::XPropertySet.
+ *
+ * Pass the test also if the property doesn't exists (throws a 
com::sun::star::beans::UnknownPropertyException)
+ *
+ * @param   xPropertySetThe property set, which contains the property to 
test against.
+ * @param   nameName of property to test.
+ * @param   rValue  Value to use when setting a new value.
+ */
+void OOO_DLLPUBLIC_TEST
+testStringOptionalProperty(css::uno::Reference 
const& xPropertySet,
+   const OUString& name, const OUString& rValue = 
OUString("StringValue"));
+
 /** @brief Tester for read-only property type 'string' of a @see 
com::sun::star::beans::XPropertySet.
  *
  * @param   xPropertySetThe property set, which contains the property to 
test against.
@@ -113,6 +136,17 @@ 
testStringProperty(css::uno::Reference const& xPropert
 void OOO_DLLPUBLIC_TEST
 testStringReadonlyProperty(css::uno::Reference 
const& xPropertySet,
const OUString& name, const OUString& rValue);
+
+/** @brief Tester for property type com::sun::star::util::Color of a @see 
com::sun::star::beans::XPropertySet.
+ *
+ * @param   xPropertySetThe property set, which contains the property to 
test against.
+ * @param   nameName of property to test.
+ * @param   rValue  Value to use when setting a new value.
+ */
+void OOO_DLLPUBLIC_TEST testColorProperty(
+css::uno::Reference const& xPropertySet, const 
OUString& name,
+const css::util::Color& rValue = css::util::Color(0x12345678));
+
 } // namespace apitest
 #endif // INCLUDED_TEST_INC_UNOAPIPROPERTYTESTERS_HXX
 
diff --git a/test/source/unoapi_property_testers.cxx 
b/test/source/unoapi_property_testers.cxx
index 421079a01093..5a74443a2550 100644
--- a/test/source/unoapi_property_testers.cxx
+++ b/test/source/unoapi_property_testers.cxx
@@ -9,10 +9,7 @@
 
 #include 
 
-#include 
 #include 
-#include 
-
 #include 
 
 using namespace css;
@@ -39,6 +36,19 @@ void testBooleanProperty(uno::Reference 
const& xPropertySet
 CPPUNIT_ASSERT_EQUAL_MESSAGE(msgSet.getStr(), !bPropertyGet, bPropertySet);
 }
 
+void testBooleanOptionalProperty(uno::Reference const& 
xPropertySet,
+ const OUString& rName)
+{
+try
+{
+testBooleanProperty(xPropertySet, rName);
+}
+catch (css::beans::UnknownPropertyException /*ex*/)
+{
+// ignore if the property is unknown as it is optional
+}
+}
+
 void testBooleanReadonlyProperty(uno::Reference const& 
xPropertySet,
  const OUString& name)
 {
@@ -175,6 +185,19 @@ void 
testShortReadonlyProperty(uno::Reference const& xPrope
 CPPUNIT_ASSERT_EQUAL_MESSAGE(msgSet.getStr(), nPropertyGet, nPropertySet);
 }
 
+void testStringOptionalProperty(uno::Reference const& 
xPropertySet,
+const OUString& rName, const OUString& rValue)
+{
+try
+{
+

[Libreoffice-commits] core.git: include/test test/source

2018-03-20 Thread Jens Carl
 include/test/unoapi_property_testers.hxx |4 ++--
 test/source/unoapi_property_testers.cxx  |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit ea5eb69b65a3e27bfab9cd3f220eaeced159be39
Author: Jens Carl 
Date:   Tue Mar 20 07:05:53 2018 +

Fix error with default arguments

Change-Id: Id645d43ad63b7d91d3c47898c22594dc58333cd2
Reviewed-on: https://gerrit.libreoffice.org/51622
Tested-by: Jenkins 
Reviewed-by: Jens Carl 

diff --git a/include/test/unoapi_property_testers.hxx 
b/include/test/unoapi_property_testers.hxx
index c0c7cc86dd70..369ab586d366 100644
--- a/include/test/unoapi_property_testers.hxx
+++ b/include/test/unoapi_property_testers.hxx
@@ -34,7 +34,7 @@ void OOO_DLLPUBLIC_TEST testBooleanProperty(
  */
 void OOO_DLLPUBLIC_TEST
 testLongProperty(css::uno::Reference& xPropertySet, 
const OUString& name,
- const sal_Int32& nValue);
+ const sal_Int32& nValue = 42);
 
 /** @brief Tester for property type 'short' of a @see 
com::sun::star::beans::XPropertySet.
  *
@@ -44,7 +44,7 @@ 
testLongProperty(css::uno::Reference& xPropertySet, co
  */
 void OOO_DLLPUBLIC_TEST
 testShortProperty(css::uno::Reference& xPropertySet, 
const OUString& name,
-  const sal_Int16& nValue);
+  const sal_Int16& nValue = 42);
 
 /** @brief Tester for property type 'string' of a @see 
com::sun::star::beans::XPropertySet.
  *
diff --git a/test/source/unoapi_property_testers.cxx 
b/test/source/unoapi_property_testers.cxx
index e84ab8d7e7ab..08fde5ebd5d0 100644
--- a/test/source/unoapi_property_testers.cxx
+++ b/test/source/unoapi_property_testers.cxx
@@ -40,7 +40,7 @@ void testBooleanProperty(uno::Reference& 
xPropertySet, cons
 }
 
 void testLongProperty(uno::Reference& xPropertySet, const 
OUString& name,
-  const sal_Int32& nValue = 42)
+  const sal_Int32& nValue)
 {
 uno::Any aNewValue;
 
@@ -60,7 +60,7 @@ void testLongProperty(uno::Reference& 
xPropertySet, const O
 }
 
 void testShortProperty(uno::Reference& xPropertySet, 
const OUString& name,
-   const sal_Int16& nValue = 42)
+   const sal_Int16& nValue)
 {
 uno::Any aNewValue;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test test/source

2017-11-03 Thread Jens Carl
 include/test/cppunitasserthelper.hxx   |   72 +
 test/source/sheet/databaserange.cxx|   21 ---
 test/source/sheet/xarealink.cxx|   21 ---
 test/source/sheet/xcelladdressable.cxx |   20 --
 test/source/sheet/xsheetcellrangecontainer.cxx |   21 ---
 5 files changed, 76 insertions(+), 79 deletions(-)

New commits:
commit afc5d7aedf4d115bfaa539301b155db37be87054
Author: Jens Carl 
Date:   Fri Nov 3 22:56:02 2017 +

Create CppUnit::assertion_traits helper file

Place the CppUnit:assertion_traits for ::table::CellAddress and
::table::CellRangeAddress into a file, so that they can be used/shared
from several locations. Avoid copy/paste action.

Change-Id: Ie2358ea1ac6925eef05644bea03a2ae526cd7fc6
Reviewed-on: https://gerrit.libreoffice.org/44291
Tested-by: Jenkins 
Reviewed-by: Jens Carl 

diff --git a/include/test/cppunitasserthelper.hxx 
b/include/test/cppunitasserthelper.hxx
new file mode 100644
index ..0b26a228ba31
--- /dev/null
+++ b/include/test/cppunitasserthelper.hxx
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * 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/.
+ */
+
+#ifndef INCLUDED_TEST_CPPUNITASSERTHELPER_HXX
+#define INCLUDED_TEST_CPPUNITASSERTHELPER_HXX
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+
+CPPUNIT_NS_BEGIN
+
+/** @brief Trait used by CPPUNIT_ASSERT* macros to compare 
com::sun::star::table::CellAddress.
+ *
+ * This specialization from @c struct @c assertion_traits<> helps to compare
+ * @see com::sun::star::table::CellAddress.
+ */
+template<>
+struct assertion_traits
+{
+static bool equal(const table::CellAddress& x, const table::CellAddress& y)
+{
+return x == y;
+}
+
+static std::string toString( const table::CellAddress& x )
+{
+OStringStream ost;
+ost << "Sheet: " << x.Sheet << " Column: " << x.Column << " Row: " << 
x.Row;
+return ost.str();
+}
+};
+
+/** @brief Trait used by CPPUNIT_ASSERT* macros to compare 
com::sun::star::table::CellRangeAddress.
+ *
+ * This specialization from @c struct @c assertion_traits<> helps to compare
+ * @see com::sun::star::table::CellRangeAddress.
+ */
+template<>
+struct assertion_traits
+{
+static bool equal(const table::CellRangeAddress& x, const 
table::CellRangeAddress& y)
+{
+return x == y;
+}
+
+static std::string toString( const table::CellRangeAddress& x )
+{
+OStringStream ost;
+ost << "Sheet: " << x.Sheet << " StartColumn: " << x.StartColumn << " 
StartRow: " << x.StartRow
+<< " EndColumn: " << x.EndColumn << " EndRow: " << x.EndRow;
+return ost.str();
+}
+};
+
+CPPUNIT_NS_END
+
+#endif // INCLUDED_TEST_CPPUNITASSERTHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/source/sheet/databaserange.cxx 
b/test/source/sheet/databaserange.cxx
index 8e6f56cb1ed1..91ee88184863 100644
--- a/test/source/sheet/databaserange.cxx
+++ b/test/source/sheet/databaserange.cxx
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 
 #include 
 #include 
@@ -19,26 +20,6 @@
 using namespace com::sun::star;
 using namespace com::sun::star::uno;
 
-CPPUNIT_NS_BEGIN
-
-template<> struct assertion_traits
-{
-static bool equal(const table::CellRangeAddress& x, const 
table::CellRangeAddress& y)
-{
-return x == y;
-}
-
-static std::string toString( const table::CellRangeAddress& x )
-{
-OStringStream ost;
-ost << "Sheet: " << x.Sheet << " StartColumn: " << x.StartColumn << " 
StartRow: " << x.StartRow
-<< " EndColumn: " << x.EndColumn << " EndRow: " << x.EndRow;
-return ost.str();
-}
-};
-
-CPPUNIT_NS_END
-
 namespace apitest {
 
 void DatabaseRange::testMoveCells()
diff --git a/test/source/sheet/xarealink.cxx b/test/source/sheet/xarealink.cxx
index 89704052da45..ec7ce49a01f8 100644
--- a/test/source/sheet/xarealink.cxx
+++ b/test/source/sheet/xarealink.cxx
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 
 #include 
 #include 
@@ -18,26 +19,6 @@
 using namespace com::sun::star;
 using namespace com::sun::star::uno;
 
-CPPUNIT_NS_BEGIN
-
-template<> struct assertion_traits
-{
-static bool equal(const table::CellRangeAddress& x, const 
table::CellRangeAddress& y)
-{
-return x == y;
-}
-
-static std::string toString( const table::CellRangeAddress& x )
-{
-OStringStream ost;
-ost << "Sheet: " << x.Sheet << " StartColumn: " << x.StartColumn << " 
StartRow: " << x.StartRow
-<< 

[Libreoffice-commits] core.git: include/test test/source vcl/CppunitTest_vcl_svm_test.mk vcl/Module_vcl.mk vcl/qa

2017-01-14 Thread Tomaž Vajngerl
 include/test/xmltesttools.hxx   |4 
 test/source/mtfxmldump.cxx  |  329 +-
 test/source/xmltesttools.cxx|9 
 vcl/CppunitTest_vcl_svm_test.mk |   55 ++
 vcl/Module_vcl.mk   |1 
 vcl/qa/cppunit/svm/svmtest.cxx  |  904 
 6 files changed, 1279 insertions(+), 23 deletions(-)

New commits:
commit 61af2bae8d3cdf0e7acfa9e49224ca5afcdd38dc
Author: Tomaž Vajngerl 
Date:   Mon Jan 9 23:46:25 2017 +0100

vcl: add SVM metafile reading and writing test and extend xml dump

Change-Id: I88ffb795a9c33ea62d05d599757a287335c7d680
Reviewed-on: https://gerrit.libreoffice.org/32914
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index a4cf8cc..80f95b3 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -25,6 +25,8 @@
 
 #include 
 
+#include 
+
 class OOO_DLLPUBLIC_TEST XmlTestTools
 {
 public:
@@ -62,6 +64,8 @@ protected:
 void  assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath,
   const OString& rAttribute = OString(),
   const OUString& rExpectedValue = OUString());
+void  assertXPathAttrs(xmlDocPtr pXmlDoc, const OString& rXPath,
+   std::vector> 
aPairVector);
 /**
  * Assert that rXPath exists, and returns exactly nNumberOfNodes nodes.
  * Useful for checking that we do _not_ export some node (nNumberOfNodes 
== 0).
diff --git a/test/source/mtfxmldump.cxx b/test/source/mtfxmldump.cxx
index e2225e8..ee2bd7a 100644
--- a/test/source/mtfxmldump.cxx
+++ b/test/source/mtfxmldump.cxx
@@ -56,25 +56,28 @@ OUString flagToString(PushFlags nFlag)
 
 OUString collectPushFlags(PushFlags nFlags)
 {
-if ((nFlags & PushFlags::ALL) == nFlags)
+if ((nFlags & PushFlags::ALL) == PushFlags::ALL)
 return OUString("PushAll");
-else if ((nFlags & PUSH_ALLFONT) == nFlags)
+else if ((nFlags & PUSH_ALLFONT) == PUSH_ALLFONT)
 return OUString("PushAllFont");
-else if ((nFlags & PUSH_ALLTEXT) == nFlags)
+else if ((nFlags & PUSH_ALLTEXT) == PUSH_ALLTEXT)
 return OUString("PushAllText");
 
 OUString sFlags;
 
 for (sal_uInt16 nFlag = 1; nFlag > 0; nFlag <<= 1)
 {
-OUString sFlag = flagToString(static_cast(nFlag));
-if (!sFlag.isEmpty())
+if ((nFlag & sal_uInt16(nFlags)) == nFlag)
 {
-if (!sFlags.isEmpty())
+OUString sFlag = flagToString(static_cast(nFlag));
+if (!sFlag.isEmpty())
 {
-sFlags += ",";
+if (!sFlags.isEmpty())
+{
+sFlags += ", ";
+}
+sFlags += flagToString(static_cast(nFlag));
 }
-sFlags += flagToString(static_cast(nFlag));
 }
 }
 
@@ -147,6 +150,18 @@ OUString convertLineCapToString(css::drawing::LineCap eCap)
 }
 }
 
+OUString convertPolygonFlags(PolyFlags eFlags)
+{
+switch (eFlags)
+{
+default:
+case PolyFlags::Normal:   return OUString("normal");
+case PolyFlags::Control:  return OUString("control");
+case PolyFlags::Smooth:   return OUString("smooth");
+case PolyFlags::Symmetric:   return OUString("symmetric");
+}
+}
+
 OUString convertFontWeigthToString(FontWeight eFontWeight)
 {
 enum FontWeight { WEIGHT_DONTKNOW, WEIGHT_THIN, WEIGHT_ULTRALIGHT,
@@ -233,6 +248,25 @@ OString convertLineStyleToString(const MetaActionType 
nActionType)
 return "";
 }
 
+OUString convertBitmapExTransparentType(TransparentType eType)
+{
+switch (eType)
+{
+default:
+case TransparentType::NONE:   return OUString("none");
+case TransparentType::Bitmap: return OUString("bitmap");
+case TransparentType::Color:  return OUString("color");
+}
+}
+
+
+OUString hex32(sal_uInt32 nNumber)
+{
+std::stringstream ss;
+ss << std::hex << std::setfill ('0') << std::setw(8) << nNumber;
+return OUString::createFromAscii(ss.str().c_str());
+}
+
 } // anonymous namespace
 
 MetafileXmlDump::MetafileXmlDump()
@@ -291,6 +325,119 @@ void MetafileXmlDump::writeXml(const GDIMetaFile& 
rMetaFile, XmlWriter& rWriter)
 
 switch (nActionType)
 {
+case MetaActionType::PIXEL:
+{
+auto* pMetaAction = static_cast(pAction);
+rWriter.startElement(sCurrentElementTag);
+rWriter.attribute("x", pMetaAction->GetPoint().X());
+rWriter.attribute("y", pMetaAction->GetPoint().Y());
+rWriter.attribute("color", 
convertColorToString(pMetaAction->GetColor()));
+rWriter.endElement();
+}
+break;
+
+ 

[Libreoffice-commits] core.git: include/test test/source

2016-11-17 Thread Samuel Mehrbrodt
 include/test/screenshot_test.hxx |3 +++
 test/source/screenshot_test.cxx  |6 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 9ed4f270d0135551a5fd7f9b93c0de8977936448
Author: Samuel Mehrbrodt 
Date:   Wed Nov 16 23:41:08 2016 +0100

Put generated screenshots in lang-dependant subdir

Change-Id: Ida481fcef52fa70390a539ab8f3a838a15084256
Reviewed-on: https://gerrit.libreoffice.org/30913
Reviewed-by: Samuel Mehrbrodt 
Tested-by: Samuel Mehrbrodt 

diff --git a/include/test/screenshot_test.hxx b/include/test/screenshot_test.hxx
index 1868e18..5f8fbf8 100644
--- a/include/test/screenshot_test.hxx
+++ b/include/test/screenshot_test.hxx
@@ -27,6 +27,9 @@ private:
 /// the target directory for screenshots
 OUStringm_aScreenshotDirectory;
 
+/// The current UI language
+OUStringmaCurrentLanguage;
+
 /// the set of known dialogs and their ID for usage in createDialogByID
 mapType maKnownDialogs;
 
diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx
index df107b8..2077344 100644
--- a/test/source/screenshot_test.cxx
+++ b/test/source/screenshot_test.cxx
@@ -15,6 +15,8 @@
 #include 
 #include 
 #include 
+#include 
+
 
 namespace {
 void splitHelpId( const OString& rHelpId, OUString& rDirname, OUString 
 )
@@ -36,6 +38,8 @@ ScreenshotTest::ScreenshotTest()
 :   m_aScreenshotDirectory("/workdir/screenshots/"),
 maKnownDialogs()
 {
+SvtSysLocaleOptions localeOptions;
+maCurrentLanguage = localeOptions.GetLocaleConfigString();
 }
 
 ScreenshotTest::~ScreenshotTest()
@@ -63,7 +67,7 @@ void ScreenshotTest::implSaveScreenshot(const Bitmap& 
rScreenshot, const OString
 {
 OUString aDirname, aBasename;
 splitHelpId(rScreenshotId, aDirname, aBasename);
-aDirname = m_aScreenshotDirectory + aDirname;
+aDirname = m_aScreenshotDirectory + maCurrentLanguage + "/" + aDirname;
 
 osl::FileBase::RC err = 
osl::Directory::createPath(m_directories.getURLFromSrc(aDirname));
 CPPUNIT_ASSERT_MESSAGE(OUStringToOString("Failed to create " + aDirname, 
RTL_TEXTENCODING_UTF8).getStr(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test test/source

2016-06-17 Thread Vasily Melenchuk
 include/test/bootstrapfixture.hxx |3 ++-
 test/source/bootstrapfixture.cxx  |   11 ++-
 2 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit c3453ea24608123195588ea910b8db7b13922054
Author: Vasily Melenchuk 
Date:   Fri Jun 17 10:36:38 2016 +0300

Add MS binary format validator support in test fixture

bffvalidator (Microsoft Office Binary File Format Validator) can now be
used for verification of MS binary export tests

Change-Id: Ibc65e64726a454cdd33946006b36427b9cc6fbd2
Reviewed-on: https://gerrit.libreoffice.org/26405
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 

diff --git a/include/test/bootstrapfixture.hxx 
b/include/test/bootstrapfixture.hxx
index 448605a..5e24753 100644
--- a/include/test/bootstrapfixture.hxx
+++ b/include/test/bootstrapfixture.hxx
@@ -30,7 +30,8 @@ namespace test {
 enum ValidationFormat
 {
 OOXML,
-ODF
+ODF,
+MSBINARY
 };
 
 // Class to do lots of heavy-lifting UNO & environment
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index f274dbc..c28615d 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -173,10 +173,19 @@ void test::BootstrapFixture::validate(const OUString& 
rPath, test::ValidationFor
 {
 var = "OFFICEOTRON";
 }
-else
+else if ( eFormat == test::ODF )
 {
 var = "ODFVALIDATOR";
 }
+else if ( eFormat == test::MSBINARY )
+{
+#if HAVE_BFFVALIDATOR
+var = "BFFVALIDATOR";
+#else
+// Binary Format Validator is disabled
+return;
+#endif
+}
 OUString aValidator;
 oslProcessError e = osl_getEnvironment(var.pData, );
 CPPUNIT_ASSERT_EQUAL_MESSAGE(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test test/source

2015-12-26 Thread Chris Sherlock
 include/test/container/xnamed.hxx   |4 ++--
 include/test/container/xnamereplace.hxx |4 ++--
 test/source/container/xnamed.cxx|   12 ++--
 test/source/container/xnamereplace.cxx  |4 ++--
 4 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 38e4f627095c81e92b3eab4fa17c4f20fbcadda6
Author: Chris Sherlock 
Date:   Sun Dec 27 00:50:44 2015 +1100

test: change maName to more descriptive variable name

Change-Id: I93b553c74bfa6f046092c6a550d229278e413446
Reviewed-on: https://gerrit.libreoffice.org/20956
Reviewed-by: Chris Sherlock 
Tested-by: Chris Sherlock 

diff --git a/include/test/container/xnamed.hxx 
b/include/test/container/xnamed.hxx
index 5c79cc1..e328806 100644
--- a/include/test/container/xnamed.hxx
+++ b/include/test/container/xnamed.hxx
@@ -19,7 +19,7 @@ namespace apitest {
 class OOO_DLLPUBLIC_TEST XNamed
 {
 public:
-XNamed(const OUString& rName): maName(rName) {}
+XNamed(const OUString& rName): maTestName(rName) {}
 virtual ~XNamed();
 
 void testGetName();
@@ -27,7 +27,7 @@ public:
 
 virtual css::uno::Reference< css::uno::XInterface > init() = 0;
 private:
-OUString maName;
+OUString maTestName;
 
 };
 
diff --git a/include/test/container/xnamereplace.hxx 
b/include/test/container/xnamereplace.hxx
index c6a2d7f..9ce6dfd 100644
--- a/include/test/container/xnamereplace.hxx
+++ b/include/test/container/xnamereplace.hxx
@@ -20,7 +20,7 @@ namespace apitest {
 class OOO_DLLPUBLIC_TEST XNameReplace
 {
 public:
-XNameReplace(const OUString& rName): maName(rName) {}
+XNameReplace(const OUString& rName): maTestReplacementName(rName) {}
 
 virtual css::uno::Reference< css::uno::XInterface > init() = 0;
 
@@ -31,7 +31,7 @@ public:
 virtual ~XNameReplace() {}
 
 private:
-OUString maName;
+OUString maTestReplacementName;
 
 };
 
diff --git a/test/source/container/xnamed.cxx b/test/source/container/xnamed.cxx
index 6b28bf4..a334402 100644
--- a/test/source/container/xnamed.cxx
+++ b/test/source/container/xnamed.cxx
@@ -19,20 +19,20 @@ namespace apitest {
 void XNamed::testGetName()
 {
 uno::Reference< container::XNamed > xNamed(init(), UNO_QUERY_THROW);
-CPPUNIT_ASSERT( maName == xNamed->getName() );
+CPPUNIT_ASSERT( maTestName == xNamed->getName() );
 }
 
 void XNamed::testSetName()
 {
 uno::Reference< container::XNamed > xNamed(init(), UNO_QUERY_THROW);
-OUString aName("NewName");
+OUString aTestName("NewName");
 
-xNamed->setName(aName);
-CPPUNIT_ASSERT( aName == xNamed->getName() );
+xNamed->setName(aTestName);
+CPPUNIT_ASSERT( aTestName == xNamed->getName() );
 
 // restore old name
-xNamed->setName(maName);
-CPPUNIT_ASSERT(maName == xNamed->getName());
+xNamed->setName(maTestName);
+CPPUNIT_ASSERT(maTestName == xNamed->getName());
 }
 
 XNamed::~XNamed()
diff --git a/test/source/container/xnamereplace.cxx 
b/test/source/container/xnamereplace.cxx
index 8af5e7c..159efca 100644
--- a/test/source/container/xnamereplace.cxx
+++ b/test/source/container/xnamereplace.cxx
@@ -19,8 +19,8 @@ namespace apitest {
 void XNameReplace::testReplaceByName()
 {
 uno::Reference< container::XNameReplace > xNameReplace(init(), 
UNO_QUERY_THROW);
-xNameReplace->replaceByName(maName, getAnyElementForNameReplace());
-Any aAny = xNameReplace->getByName( maName );
+xNameReplace->replaceByName(maTestReplacementName, 
getAnyElementForNameReplace());
+Any aAny = xNameReplace->getByName( maTestReplacementName );
 uno::Reference< uno::XInterface > xElement(aAny, UNO_QUERY_THROW);
 CPPUNIT_ASSERT(xElement.is());
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test test/source unusedcode.easy unusedcode.exclude

2015-12-20 Thread Juergen Funk
 include/test/primitive2dxmldump.hxx |3 ---
 test/source/primitive2dxmldump.cxx  |9 -
 unusedcode.easy |3 ---
 unusedcode.exclude  |1 +
 4 files changed, 1 insertion(+), 15 deletions(-)

New commits:
commit 5bd5cd1622608ded4a47c588e4f674a4c5b505be
Author: Juergen Funk 
Date:   Thu Dec 17 21:43:27 2015 +0100

unused code

   Primitive2dXmlDump::filterActionType(unsigned short, bool)
   Primitive2dXmlDump::filterAllActionTypes()

used code

   OutputDevice::LogicToLogic(basegfx::B2DPolyPolygon const&, MapMode 
const&, MapMode const&)
at
   
http://opengrok.libreoffice.org/xref/core/vcl/source/gdi/pdfwriter_impl.cxx#1388

tested under windows with enable-dbgutil

Change-Id: Ife200e5851323dfcfe138f5c978d028513213295
Reviewed-on: https://gerrit.libreoffice.org/20781
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/include/test/primitive2dxmldump.hxx 
b/include/test/primitive2dxmldump.hxx
index 176f6dd..b885234 100644
--- a/include/test/primitive2dxmldump.hxx
+++ b/include/test/primitive2dxmldump.hxx
@@ -29,9 +29,6 @@ public:
 Primitive2dXmlDump();
 virtual ~Primitive2dXmlDump();
 
-void filterActionType(const sal_uInt16 nActionType, bool bShouldFilter);
-void filterAllActionTypes();
-
 /** The actual result that will be used for testing.
 
 This function normally uses a SvMemoryStream for its operation; but
diff --git a/test/source/primitive2dxmldump.cxx 
b/test/source/primitive2dxmldump.cxx
index c00f6e2..4a99677 100644
--- a/test/source/primitive2dxmldump.cxx
+++ b/test/source/primitive2dxmldump.cxx
@@ -49,15 +49,6 @@ Primitive2dXmlDump::Primitive2dXmlDump() :
 Primitive2dXmlDump::~Primitive2dXmlDump()
 {}
 
-void Primitive2dXmlDump::filterActionType(const sal_uInt16 nActionType, bool 
bShouldFilter)
-{
-maFilter[nActionType] = bShouldFilter;
-}
-
-void Primitive2dXmlDump::filterAllActionTypes()
-{
-maFilter.assign(constMaxActionType, true);
-}
 
 xmlDocPtr Primitive2dXmlDump::dumpAndParse(
 const drawinglayer::primitive2d::Primitive2DContainer& 
rPrimitive2DSequence,
diff --git a/unusedcode.easy b/unusedcode.easy
index 082b4cf..38e742d 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -5,9 +5,6 @@ OpenGLContext::requestSingleBufferedRendering()
 OpenGLContext::requestVirtualDevice()
 OpenGLRender::CreateTextTexture(rtl::OUString const&, vcl::Font, long, 
com::sun::star::awt::Point, com::sun::star::awt::Size, long)
 OpenGLTexture::Draw()
-OutputDevice::LogicToLogic(basegfx::B2DPolyPolygon const&, MapMode const&, 
MapMode const&)
-Primitive2dXmlDump::filterActionType(unsigned short, bool)
-Primitive2dXmlDump::filterAllActionTypes()
 SalGraphics::drawTransformedBitmap(basegfx::B2DPoint const&, basegfx::B2DPoint 
const&, basegfx::B2DPoint const&, SalBitmap const&, SalBitmap const*)
 ScCellValue::set(ScRefCellValue const&)
 ScDocument::CreateFormatTable() const
diff --git a/unusedcode.exclude b/unusedcode.exclude
index 0862690..42f2776 100644
--- a/unusedcode.exclude
+++ b/unusedcode.exclude
@@ -28,4 +28,5 @@ 
comphelper::detail::ConfigurationWrapper::getGroupReadWrite(boost::shared_ptr
 const&, rtl::OUString const&, com::sun::star::uno::Any const&) const
 FontCharMap::GetDefaultMap(bool)
+OutputDevice::LogicToLogic(basegfx::B2DPolyPolygon const&, MapMode const&, 
MapMode const&)
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test test/source

2015-03-24 Thread Noel Grandin
 include/test/beans/xpropertyset.hxx  |4 
 include/test/sheet/xsheetoutline.hxx |1 -
 test/source/beans/xpropertyset.cxx   |   20 
 test/source/sheet/xsheetoutline.cxx  |4 
 4 files changed, 29 deletions(-)

New commits:
commit 5dad2733b83297d900cec548596e5358d8335f7b
Author: Noel Grandin n...@peralex.com
Date:   Tue Mar 24 09:45:26 2015 +0200

loplugin:constantfunction: test

Change-Id: I86eb9e46bec561bf0ede60180754ae35cefadfd5

diff --git a/include/test/beans/xpropertyset.hxx 
b/include/test/beans/xpropertyset.hxx
index aa29baf..19f0635 100644
--- a/include/test/beans/xpropertyset.hxx
+++ b/include/test/beans/xpropertyset.hxx
@@ -28,12 +28,8 @@ public:
 virtual css::uno::Referencecss::uno::XInterface init() = 0;
 
 void testGetPropertySetInfo();
-void testAddPropertyChangeListener();
-void testAddVetoableChangeListener();
 void testSetPropertyValue();
 void testGetPropertyValue();
-void testRemovePropertyChangeListener();
-void testRemoveVetoableChangeListener();
 
 protected:
 virtual bool isPropertyValueChangeable(const OUString rName);
diff --git a/include/test/sheet/xsheetoutline.hxx 
b/include/test/sheet/xsheetoutline.hxx
index 396fe41..2a7771a 100644
--- a/include/test/sheet/xsheetoutline.hxx
+++ b/include/test/sheet/xsheetoutline.hxx
@@ -27,7 +27,6 @@ public:
 void testShowLevel();
 void testUngroup();
 void testGroup();
-void testAutoOutline();
 void testClearOutline();
 
 protected:
diff --git a/test/source/beans/xpropertyset.cxx 
b/test/source/beans/xpropertyset.cxx
index c90e6e1..3ebfca4 100644
--- a/test/source/beans/xpropertyset.cxx
+++ b/test/source/beans/xpropertyset.cxx
@@ -39,16 +39,6 @@ void XPropertySet::testGetPropertySetInfo()
 }
 }
 
-void XPropertySet::testAddPropertyChangeListener()
-{
-// TODO: implement this.
-}
-
-void XPropertySet::testAddVetoableChangeListener()
-{
-// TODO: implement this.
-}
-
 void XPropertySet::testSetPropertyValue()
 {
 testGetPropertySetInfo();
@@ -80,16 +70,6 @@ void XPropertySet::testGetPropertyValue()
 }
 }
 
-void XPropertySet::testRemovePropertyChangeListener()
-{
-// TODO: implement this.
-}
-
-void XPropertySet::testRemoveVetoableChangeListener()
-{
-// TODO: implement this.
-}
-
 bool XPropertySet::isPropertyValueChangeable(const OUString rName)
 {
 uno::Referencebeans::XPropertySet xPropSet(init(), UNO_QUERY_THROW);
diff --git a/test/source/sheet/xsheetoutline.cxx 
b/test/source/sheet/xsheetoutline.cxx
index a6ff335..018be89 100644
--- a/test/source/sheet/xsheetoutline.cxx
+++ b/test/source/sheet/xsheetoutline.cxx
@@ -245,10 +245,6 @@ void XSheetOutline::testUngroup()
 
 }
 
-void XSheetOutline::testAutoOutline()
-{
-}
-
 void XSheetOutline::testClearOutline()
 {
 uno::Reference sheet::XSpreadsheet  aSheet(init(), UNO_QUERY_THROW);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test test/source

2014-04-30 Thread Miklos Vajna
 include/test/xmltesttools.hxx |   26 ++
 test/source/xmltesttools.cxx  |   26 --
 2 files changed, 26 insertions(+), 26 deletions(-)

New commits:
commit 76715b105fcfeffa140b03fb54d5c0846db1fba2
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Apr 30 09:30:48 2014 +0200

test: move XmlTestTools API documentation to the header

Change-Id: Iae56b1fb68fde0cbc44f6b9e37ba1a66194b25e0

diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index a12d780..5a9cdb1 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -31,14 +31,40 @@ protected:
 virtual void registerNamespaces(xmlXPathContextPtr pXmlXpathCtx);
 
 xmlNodeSetPtr getXPathNode(xmlDocPtr pXmlDoc, const OString rXPath);
+/**
+ * Same as the assertXPath(), but don't assert: return the string instead.
+ */
 OUString  getXPath(xmlDocPtr pXmlDoc, const OString rXPath, const 
OString rAttribute);
+/**
+ * Same as the assertXPathContent(), but don't assert: return the string 
instead.
+ */
 OUString  getXPathContent(xmlDocPtr pXmlDoc, const OString rXPath);
+/**
+ * Get the position of the child named rName of the parent node specified 
by rXPath.
+ * Useful for checking relative order of elements.
+ */
 int   getXPathPosition(xmlDocPtr pXmlDoc, const OString rXPath, 
const OUString rChildName);
+/**
+ * Assert that rXPath exists, and returns exactly one node.
+ * In case rAttribute is provided, the rXPath's attribute's value must
+ * equal to the rExpected value.
+ */
 void  assertXPath(xmlDocPtr pXmlDoc, const OString rXPath,
   const OString rAttribute = OString(),
   const OUString rExpectedValue = OUString());
+/**
+ * Assert that rXPath exists, and returns exactly nNumberOfNodes nodes.
+ * Useful for checking that we do _not_ export some node (nNumberOfNodes 
== 0).
+ */
 void  assertXPath(xmlDocPtr pXmlDoc, const OString rXPath, int 
nNumberOfNodes);
+/**
+ * Assert that rXPath exists, and its content equals rContent.
+ */
 void  assertXPathContent(xmlDocPtr pXmlDoc, const OString rXPath, 
const OUString rContent);
+/**
+ * Assert that rXPath exists, and has exactly nNumberOfChildNodes child 
nodes.
+ * Useful for checking that we do have a no child nodes to a specific node 
(nNumberOfChildNodes == 0).
+ */
 void  assertXPathChildren(xmlDocPtr pXmlDoc, const OString 
rXPath, int nNumberOfChildNodes);
 
 };
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx
index 9815351..e80674d 100644
--- a/test/source/xmltesttools.cxx
+++ b/test/source/xmltesttools.cxx
@@ -27,9 +27,6 @@ void XmlTestTools::registerNamespaces(xmlXPathContextPtr 
/*pXmlXpathCtx*/)
 {
 }
 
-/**
- * Same as the assertXPath(), but don't assert: return the string instead.
- */
 OUString XmlTestTools::getXPath(xmlDocPtr pXmlDoc, const OString rXPath, 
const OString rAttribute)
 {
 xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc, rXPath);
@@ -41,9 +38,6 @@ OUString XmlTestTools::getXPath(xmlDocPtr pXmlDoc, const 
OString rXPath, const
 return OUString::createFromAscii((const char*)xmlGetProp(pXmlNode, 
BAD_CAST(rAttribute.getStr(;
 }
 
-/**
- * Same as the assertXPathContent(), but don't assert: return the string 
instead.
- */
 OUString XmlTestTools::getXPathContent(xmlDocPtr pXmlDoc, const OString 
rXPath)
 {
 xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc, rXPath);
@@ -55,11 +49,6 @@ OUString XmlTestTools::getXPathContent(xmlDocPtr pXmlDoc, 
const OString rXPath)
 return OUString::createFromAscii((const 
char*)((pXmlNode-children[0]).content));
 }
 
-/**
- * Assert that rXPath exists, and returns exactly one node.
- * In case rAttribute is provided, the rXPath's attribute's value must
- * equal to the rExpected value.
- */
 void XmlTestTools::assertXPath(xmlDocPtr pXmlDoc, const OString rXPath, const 
OString rAttribute, const OUString rExpectedValue)
 {
 OUString aValue = getXPath(pXmlDoc, rXPath, rAttribute);
@@ -67,10 +56,6 @@ void XmlTestTools::assertXPath(xmlDocPtr pXmlDoc, const 
OString rXPath, const O
  rExpectedValue, aValue);
 }
 
-/**
- * Assert that rXPath exists, and returns exactly nNumberOfNodes nodes.
- * Useful for checking that we do _not_ export some node (nNumberOfNodes == 0).
- */
 void XmlTestTools::assertXPath(xmlDocPtr pXmlDoc, const OString rXPath, int 
nNumberOfNodes)
 {
 xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc, rXPath);
@@ -78,18 +63,11 @@ void XmlTestTools::assertXPath(xmlDocPtr pXmlDoc, const 
OString rXPath, int nNu
  nNumberOfNodes, 
xmlXPathNodeSetGetLength(pXmlNodes));
 }
 
-/**
- * Assert that rXPath exists, and its content equals rContent.
- */
 void 

[Libreoffice-commits] core.git: include/test test/source

2013-04-26 Thread Thomas Arnhold
 include/test/container/xelementaccess.hxx  |8 +++-
 include/test/container/xindexaccess.hxx|4 +---
 include/test/container/xnamecontainer.hxx  |4 +---
 include/test/container/xnamed.hxx  |4 +---
 include/test/container/xnamereplace.hxx|6 ++
 include/test/sheet/cellproperties.hxx  |4 +---
 include/test/sheet/datapilotfield.hxx  |4 +---
 include/test/sheet/tableautoformatfield.hxx|6 ++
 include/test/sheet/xcellrangedata.hxx  |5 +
 include/test/sheet/xcellrangereferrer.hxx  |8 +++-
 include/test/sheet/xcellrangesquery.hxx|7 +--
 include/test/sheet/xdatabaserange.hxx  |5 +
 include/test/sheet/xdatapilotdescriptor.hxx|9 +++--
 include/test/sheet/xdatapilotfieldgrouping.hxx |4 +---
 include/test/sheet/xdatapilottable.hxx |8 +++-
 include/test/sheet/xdatapilottable2.hxx|   22 ++
 include/test/sheet/xgoalseek.hxx   |5 +
 include/test/sheet/xnamedrange.hxx |8 +++-
 include/test/sheet/xnamedranges.hxx|7 ++-
 include/test/sheet/xprintareas.hxx |   10 +++---
 include/test/sheet/xsheetannotation.hxx|7 ++-
 include/test/sheet/xsheetannotations.hxx   |9 ++---
 include/test/sheet/xsheetoutline.hxx   |4 +---
 include/test/sheet/xspreadsheetdocument.hxx|4 +---
 include/test/sheet/xspreadsheets2.hxx  |   22 +-
 include/test/text/xtext.hxx|6 ++
 include/test/text/xtextcontent.hxx |   10 +++---
 include/test/text/xtextfield.hxx   |4 +---
 include/test/unoapi_test.hxx   |8 ++--
 include/test/util/xreplaceable.hxx |5 +
 include/test/util/xsearchable.hxx  |5 +
 test/source/container/xelementaccess.cxx   |3 ++-
 test/source/container/xindexaccess.cxx |3 ++-
 test/source/container/xnamecontainer.cxx   |3 ++-
 test/source/container/xnamed.cxx   |3 ++-
 test/source/container/xnamereplace.cxx |3 ++-
 test/source/sheet/cellproperties.cxx   |3 ++-
 test/source/sheet/datapilotfield.cxx   |3 ++-
 test/source/sheet/xcellrangedata.cxx   |3 ++-
 test/source/sheet/xcellrangereferrer.cxx   |3 ++-
 test/source/sheet/xdatabaserange.cxx   |3 ++-
 test/source/sheet/xdatapilotdescriptor.cxx |3 ++-
 test/source/sheet/xdatapilotfieldgrouping.cxx  |3 ++-
 test/source/sheet/xdatapilottable.cxx  |3 ++-
 test/source/sheet/xdatapilottable2.cxx |3 ++-
 test/source/sheet/xgoalseek.cxx|3 ++-
 test/source/sheet/xnamedrange.cxx  |3 ++-
 test/source/sheet/xnamedranges.cxx |3 ++-
 test/source/sheet/xprintareas.cxx  |3 ++-
 test/source/sheet/xsheetannotation.cxx |3 ++-
 test/source/sheet/xsheetannotations.cxx|3 ++-
 test/source/sheet/xsheetoutline.cxx|3 ++-
 test/source/sheet/xspreadsheetdocument.cxx |3 ++-
 test/source/sheet/xspreadsheets2.cxx   |3 ++-
 test/source/text/xtext.cxx |3 ++-
 test/source/text/xtextcontent.cxx  |3 ++-
 test/source/text/xtextfield.cxx|4 ++--
 test/source/unoapi_test.cxx|3 +++
 test/source/util/xreplaceable.cxx  |3 ++-
 test/source/util/xsearchable.cxx   |3 ++-
 60 files changed, 128 insertions(+), 182 deletions(-)

New commits:
commit add638b725bb9e5c94b33f6802483bc7101e3681
Author: Thomas Arnhold tho...@arnhold.org
Date:   Fri Apr 26 14:38:52 2013 +0200

test: clean up namespacing

Change-Id: I7df07176bdbd15fdfdf8f9a7cdb26d4bee12997d

diff --git a/include/test/container/xelementaccess.hxx 
b/include/test/container/xelementaccess.hxx
index 71306d3..a776d33 100644
--- a/include/test/container/xelementaccess.hxx
+++ b/include/test/container/xelementaccess.hxx
@@ -10,24 +10,22 @@
 #include com/sun/star/uno/Type.hxx
 #include com/sun/star/uno/Reference.hxx
 
-using namespace com::sun::star;
-
 namespace apitest {
 
 class XElementAccess
 {
 public:
-XElementAccess(uno::Type rType): maType(rType) {}
+XElementAccess(css::uno::Type rType): maType(rType) {}
 
 void testGetElementType();
 void testHasElements();
 
-virtual uno::Reference uno::XInterface  init() = 0;
+virtual css::uno::Reference css::uno::XInterface  init() = 0;
 
 virtual ~XElementAccess() {}
 
 private:
-uno::Type maType;
+css::uno::Type maType;
 };
 
 }
diff --git a/include/test/container/xindexaccess.hxx 
b/include/test/container/xindexaccess.hxx
index 1962f9f..95401c1 100644
--- a/include/test/container/xindexaccess.hxx
+++