Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
333ba462
Kaydet (Commit)
333ba462
authored
May 09, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: move common methods of subsequent filter tests to a SwModelTestBase
Change-Id: I71316d6c5b6f4fb820bd541be1cfbb4d39dd261e
üst
f909446c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
139 deletions
+92
-139
ooxmltok.cxx
sw/qa/extras/ooxmltok/ooxmltok.cxx
+3
-24
rtfexport.cxx
sw/qa/extras/rtfexport/rtfexport.cxx
+3
-45
rtftok.cxx
sw/qa/extras/rtftok/rtftok.cxx
+3
-47
swmodeltestbase.hxx
sw/qa/extras/swmodeltestbase.hxx
+80
-0
ww8tok.cxx
sw/qa/extras/ww8tok/ww8tok.cxx
+3
-23
No files found.
sw/qa/extras/ooxmltok/ooxmltok.cxx
Dosyayı görüntüle @
333ba462
...
...
@@ -25,6 +25,8 @@
* instead of those above.
*/
#include "../swmodeltestbase.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
...
...
@@ -33,25 +35,19 @@
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/XDependentTextField.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
#include <com/sun/star/text/XTextFramesSupplier.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <test/bootstrapfixture.hxx>
#include <unotest/macros_test.hxx>
#include <vcl/svapp.hxx>
using
rtl
::
OString
;
using
rtl
::
OUString
;
using
rtl
::
OUStringBuffer
;
using
namespace
com
::
sun
::
star
;
class
Test
:
public
test
::
BootstrapFixture
,
public
unotest
::
MacrosTest
class
Test
:
public
SwModelTestBase
{
public
:
virtual
void
setUp
();
virtual
void
tearDown
();
void
testN751054
();
void
testN751117
();
void
testN751017
();
...
...
@@ -71,7 +67,6 @@ public:
private
:
/// Load an OOXML file and make the document available via mxComponent.
void
load
(
const
OUString
&
rURL
);
uno
::
Reference
<
lang
::
XComponent
>
mxComponent
;
};
void
Test
::
load
(
const
OUString
&
rFilename
)
...
...
@@ -79,22 +74,6 @@ void Test::load(const OUString& rFilename)
mxComponent
=
loadFromDesktop
(
getURLFromSrc
(
"/sw/qa/extras/ooxmltok/data/"
)
+
rFilename
);
}
void
Test
::
setUp
()
{
test
::
BootstrapFixture
::
setUp
();
mxDesktop
.
set
(
getMultiServiceFactory
()
->
createInstance
(
"com.sun.star.frame.Desktop"
),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT
(
mxDesktop
.
is
());
}
void
Test
::
tearDown
()
{
if
(
mxComponent
.
is
())
mxComponent
->
dispose
();
test
::
BootstrapFixture
::
tearDown
();
}
void
Test
::
testN751054
()
{
load
(
"n751054.docx"
);
...
...
sw/qa/extras/rtfexport/rtfexport.cxx
Dosyayı görüntüle @
333ba462
...
...
@@ -25,26 +25,22 @@
* instead of those above.
*/
#include "../swmodeltestbase.hxx"
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <test/bootstrapfixture.hxx>
#include <unotest/macros_test.hxx>
#include <unotools/tempfile.hxx>
#include <vcl/svapp.hxx>
using
rtl
::
OString
;
using
rtl
::
OUString
;
using
rtl
::
OUStringBuffer
;
using
namespace
com
::
sun
::
star
;
class
Test
:
public
test
::
BootstrapFixture
,
public
unotest
::
MacrosTest
class
Test
:
public
SwModelTestBase
{
public
:
virtual
void
setUp
();
virtual
void
tearDown
();
void
testZoom
();
void
testFdo38176
();
void
testFdo49683
();
...
...
@@ -59,9 +55,6 @@ public:
private
:
void
roundtrip
(
const
OUString
&
rURL
);
/// Get the length of the whole document.
int
getLength
();
uno
::
Reference
<
lang
::
XComponent
>
mxComponent
;
};
void
Test
::
roundtrip
(
const
OUString
&
rFilename
)
...
...
@@ -77,41 +70,6 @@ void Test::roundtrip(const OUString& rFilename)
mxComponent
=
loadFromDesktop
(
aTempFile
.
GetURL
());
}
int
Test
::
getLength
()
{
uno
::
Reference
<
text
::
XTextDocument
>
xTextDocument
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumerationAccess
>
xParaEnumAccess
(
xTextDocument
->
getText
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumeration
>
xParaEnum
=
xParaEnumAccess
->
createEnumeration
();
OUStringBuffer
aBuf
;
while
(
xParaEnum
->
hasMoreElements
())
{
uno
::
Reference
<
container
::
XEnumerationAccess
>
xRangeEnumAccess
(
xParaEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumeration
>
xRangeEnum
=
xRangeEnumAccess
->
createEnumeration
();
while
(
xRangeEnum
->
hasMoreElements
())
{
uno
::
Reference
<
text
::
XTextRange
>
xRange
(
xRangeEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
aBuf
.
append
(
xRange
->
getString
());
}
}
return
aBuf
.
getLength
();
}
void
Test
::
setUp
()
{
test
::
BootstrapFixture
::
setUp
();
mxDesktop
.
set
(
getMultiServiceFactory
()
->
createInstance
(
"com.sun.star.frame.Desktop"
),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT
(
mxDesktop
.
is
());
}
void
Test
::
tearDown
()
{
if
(
mxComponent
.
is
())
mxComponent
->
dispose
();
test
::
BootstrapFixture
::
tearDown
();
}
void
Test
::
testZoom
()
{
roundtrip
(
"zoom.rtf"
);
...
...
sw/qa/extras/rtftok/rtftok.cxx
Dosyayı görüntüle @
333ba462
...
...
@@ -25,7 +25,8 @@
* instead of those above.
*/
#include <com/sun/star/beans/XPropertySet.hpp>
#include "../swmodeltestbase.hxx"
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/style/CaseMap.hpp>
...
...
@@ -39,7 +40,6 @@
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/XFootnotesSupplier.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
#include <com/sun/star/text/XTextFramesSupplier.hpp>
...
...
@@ -48,24 +48,18 @@
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <rtl/oustringostreaminserter.hxx>
#include <test/bootstrapfixture.hxx>
#include <unotest/macros_test.hxx>
#include <vcl/outdev.hxx>
#include <vcl/svapp.hxx>
#include <vcl/fontmanager.hxx>
#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
using
rtl
::
OString
;
using
rtl
::
OUString
;
using
rtl
::
OUStringBuffer
;
using
namespace
com
::
sun
::
star
;
class
Test
:
public
test
::
BootstrapFixture
,
public
unotest
::
MacrosTest
class
Test
:
public
SwModelTestBase
{
public
:
virtual
void
setUp
();
virtual
void
tearDown
();
void
testFdo45553
();
void
testN192129
();
void
testFdo45543
();
...
...
@@ -135,12 +129,9 @@ public:
private
:
/// Load an RTF file and make the document available via mxComponent.
void
load
(
const
OUString
&
rURL
);
/// Get the length of the whole document.
int
getLength
();
/// Get page count.
int
getPages
();
uno
::
Reference
<
container
::
XNameAccess
>
getStyles
(
OUString
aFamily
);
uno
::
Reference
<
lang
::
XComponent
>
mxComponent
;
};
void
Test
::
load
(
const
OUString
&
rFilename
)
...
...
@@ -148,25 +139,6 @@ void Test::load(const OUString& rFilename)
mxComponent
=
loadFromDesktop
(
getURLFromSrc
(
"/sw/qa/extras/rtftok/data/"
)
+
rFilename
);
}
int
Test
::
getLength
()
{
uno
::
Reference
<
text
::
XTextDocument
>
xTextDocument
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumerationAccess
>
xParaEnumAccess
(
xTextDocument
->
getText
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumeration
>
xParaEnum
=
xParaEnumAccess
->
createEnumeration
();
OUStringBuffer
aBuf
;
while
(
xParaEnum
->
hasMoreElements
())
{
uno
::
Reference
<
container
::
XEnumerationAccess
>
xRangeEnumAccess
(
xParaEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumeration
>
xRangeEnum
=
xRangeEnumAccess
->
createEnumeration
();
while
(
xRangeEnum
->
hasMoreElements
())
{
uno
::
Reference
<
text
::
XTextRange
>
xRange
(
xRangeEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
aBuf
.
append
(
xRange
->
getString
());
}
}
return
aBuf
.
getLength
();
}
int
Test
::
getPages
()
{
uno
::
Reference
<
frame
::
XModel
>
xModel
(
mxComponent
,
uno
::
UNO_QUERY
);
...
...
@@ -184,22 +156,6 @@ uno::Reference<container::XNameAccess> Test::getStyles(OUString aFamily)
return
xPageStyles
;
}
void
Test
::
setUp
()
{
test
::
BootstrapFixture
::
setUp
();
mxDesktop
.
set
(
getMultiServiceFactory
()
->
createInstance
(
"com.sun.star.frame.Desktop"
),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT
(
mxDesktop
.
is
());
}
void
Test
::
tearDown
()
{
if
(
mxComponent
.
is
())
mxComponent
->
dispose
();
test
::
BootstrapFixture
::
tearDown
();
}
void
Test
::
testFdo45553
()
{
load
(
"fdo45553.rtf"
);
...
...
sw/qa/extras/swmodeltestbase.hxx
0 → 100644
Dosyayı görüntüle @
333ba462
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Initial Developer of the Original Code is
* Miklos Vajna <vmiklos@suse.cz> (SUSE, Inc.)
* Portions created by the Initial Developer are Copyright (C) 2012 the
* Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#include <com/sun/star/text/XTextDocument.hpp>
#include <test/bootstrapfixture.hxx>
#include <unotest/macros_test.hxx>
#include <rtl/ustrbuf.hxx>
using
namespace
com
::
sun
::
star
;
/// Base class for filter tests loading or roundtriping a document, then asserting the document model.
class
SwModelTestBase
:
public
test
::
BootstrapFixture
,
public
unotest
::
MacrosTest
{
public
:
virtual
void
setUp
()
{
test
::
BootstrapFixture
::
setUp
();
mxDesktop
.
set
(
getMultiServiceFactory
()
->
createInstance
(
"com.sun.star.frame.Desktop"
),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT
(
mxDesktop
.
is
());
}
virtual
void
tearDown
()
{
if
(
mxComponent
.
is
())
mxComponent
->
dispose
();
test
::
BootstrapFixture
::
tearDown
();
}
protected
:
/// Get the length of the whole document.
int
getLength
()
{
uno
::
Reference
<
text
::
XTextDocument
>
xTextDocument
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumerationAccess
>
xParaEnumAccess
(
xTextDocument
->
getText
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumeration
>
xParaEnum
=
xParaEnumAccess
->
createEnumeration
();
rtl
::
OUStringBuffer
aBuf
;
while
(
xParaEnum
->
hasMoreElements
())
{
uno
::
Reference
<
container
::
XEnumerationAccess
>
xRangeEnumAccess
(
xParaEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumeration
>
xRangeEnum
=
xRangeEnumAccess
->
createEnumeration
();
while
(
xRangeEnum
->
hasMoreElements
())
{
uno
::
Reference
<
text
::
XTextRange
>
xRange
(
xRangeEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
aBuf
.
append
(
xRange
->
getString
());
}
}
return
aBuf
.
getLength
();
}
uno
::
Reference
<
lang
::
XComponent
>
mxComponent
;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sw/qa/extras/ww8tok/ww8tok.cxx
Dosyayı görüntüle @
333ba462
...
...
@@ -25,24 +25,21 @@
* instead of those above.
*/
#include "../swmodeltestbase.hxx"
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/text/XDependentTextField.hpp>
#include <com/sun/star/text/XTextFramesSupplier.hpp>
#include <test/bootstrapfixture.hxx>
#include <unotest/macros_test.hxx>
#include <vcl/svapp.hxx>
using
rtl
::
OString
;
using
rtl
::
OUString
;
using
rtl
::
OUStringBuffer
;
using
namespace
com
::
sun
::
star
;
class
Test
:
public
test
::
BootstrapFixture
,
public
unotest
::
MacrosTest
class
Test
:
public
SwModelTestBase
{
public
:
virtual
void
setUp
();
virtual
void
tearDown
();
void
testN757910
();
CPPUNIT_TEST_SUITE
(
Test
);
...
...
@@ -54,7 +51,6 @@ public:
private
:
/// Load a WW8 file and make the document available via mxComponent.
void
load
(
const
OUString
&
rURL
);
uno
::
Reference
<
lang
::
XComponent
>
mxComponent
;
};
void
Test
::
load
(
const
OUString
&
rFilename
)
...
...
@@ -62,22 +58,6 @@ void Test::load(const OUString& rFilename)
mxComponent
=
loadFromDesktop
(
getURLFromSrc
(
"/sw/qa/extras/ww8tok/data/"
)
+
rFilename
);
}
void
Test
::
setUp
()
{
test
::
BootstrapFixture
::
setUp
();
mxDesktop
.
set
(
getMultiServiceFactory
()
->
createInstance
(
"com.sun.star.frame.Desktop"
),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT
(
mxDesktop
.
is
());
}
void
Test
::
tearDown
()
{
if
(
mxComponent
.
is
())
mxComponent
->
dispose
();
test
::
BootstrapFixture
::
tearDown
();
}
void
Test
::
testN757910
()
{
load
(
"n757910.doc"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment