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
bd69146c
Kaydet (Commit)
bd69146c
authored
Kas 03, 2013
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
improve starmath test code
Change-Id: Ife7e1306ce65dc1d935181553803fbc9266b628c
üst
5f9cda2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
32 deletions
+8
-32
test_nodetotextvisitors.cxx
starmath/qa/cppunit/test_nodetotextvisitors.cxx
+8
-32
No files found.
starmath/qa/cppunit/test_nodetotextvisitors.cxx
Dosyayı görüntüle @
bd69146c
...
@@ -18,24 +18,6 @@
...
@@ -18,24 +18,6 @@
#include <visitors.hxx>
#include <visitors.hxx>
#include <cursor.hxx>
#include <cursor.hxx>
namespace
CppUnit
{
template
<>
struct
assertion_traits
<
OUString
>
{
static
bool
equal
(
const
OUString
&
x
,
const
OUString
&
y
)
{
return
x
==
y
;
}
static
std
::
string
toString
(
const
OUString
&
x
)
{
OStringStream
ost
;
ost
<<
OUStringToOString
(
x
,
RTL_TEXTENCODING_UTF8
).
getStr
();
return
ost
.
str
();
}
};
}
SV_DECL_REF
(
SmDocShell
)
SV_DECL_REF
(
SmDocShell
)
SV_IMPL_REF
(
SmDocShell
)
SV_IMPL_REF
(
SmDocShell
)
...
@@ -578,12 +560,10 @@ void Test::testBinVerInUnary()
...
@@ -578,12 +560,10 @@ void Test::testBinVerInUnary()
void
Test
::
testBinHorInSubSup
()
void
Test
::
testBinHorInSubSup
()
{
{
OUString
sInput
,
sExpected
;
OUString
sInput
;
SmNode
*
pTree
;
// set up a blank formula
// set up a blank formula
sInput
+=
""
;
SmNode
*
pTree
=
SmParser
().
Parse
(
sInput
);
pTree
=
SmParser
().
Parse
(
sInput
);
pTree
->
Prepare
(
xDocShRef
->
GetFormat
(),
*
xDocShRef
);
pTree
->
Prepare
(
xDocShRef
->
GetFormat
(),
*
xDocShRef
);
SmCursor
aCursor
(
pTree
,
xDocShRef
);
SmCursor
aCursor
(
pTree
,
xDocShRef
);
...
@@ -601,7 +581,7 @@ void Test::testBinHorInSubSup()
...
@@ -601,7 +581,7 @@ void Test::testBinHorInSubSup()
aCursor
.
InsertElement
(
PlusElement
);
aCursor
.
InsertElement
(
PlusElement
);
aCursor
.
InsertText
(
"d"
);
aCursor
.
InsertText
(
"d"
);
sExpected
+
=
" { a rsup { b + c } + d } "
;
OUString
sExpected
=
" { a rsup { b + c } + d } "
;
//FIXME CPPUNIT_ASSERT_EQUAL_MESSAGE("BinHor in SubSup", sExpected, xDocShRef->GetText());
//FIXME CPPUNIT_ASSERT_EQUAL_MESSAGE("BinHor in SubSup", sExpected, xDocShRef->GetText());
delete
pTree
;
delete
pTree
;
...
@@ -609,20 +589,16 @@ void Test::testBinHorInSubSup()
...
@@ -609,20 +589,16 @@ void Test::testBinHorInSubSup()
void
Test
::
testUnaryInMixedNumberAsNumerator
()
void
Test
::
testUnaryInMixedNumberAsNumerator
()
{
{
OUString
sInput
,
sExpected
;
SmNode
*
pTree
;
// set up a unary operator
// set up a unary operator
sInput
+
=
"- 1"
;
OUString
sInput
=
"- 1"
;
pTree
=
SmParser
().
Parse
(
sInput
);
SmNode
*
pTree
=
SmParser
().
Parse
(
sInput
);
pTree
->
Prepare
(
xDocShRef
->
GetFormat
(),
*
xDocShRef
);
pTree
->
Prepare
(
xDocShRef
->
GetFormat
(),
*
xDocShRef
);
SmCursor
aCursor
(
pTree
,
xDocShRef
);
SmCursor
aCursor
(
pTree
,
xDocShRef
);
TestOutputDevice
aOutputDevice
;
TestOutputDevice
aOutputDevice
;
// move forward (more than) enough places to be at the end
// move forward (more than) enough places to be at the end
int
i
;
for
(
size_t
i
=
0
;
i
<
3
;
++
i
)
for
(
i
=
0
;
i
<
3
;
++
i
)
aCursor
.
Move
(
&
aOutputDevice
,
MoveRight
);
aCursor
.
Move
(
&
aOutputDevice
,
MoveRight
);
// Select the whole Unary Horizontal Node
// Select the whole Unary Horizontal Node
...
@@ -641,14 +617,14 @@ void Test::testUnaryInMixedNumberAsNumerator()
...
@@ -641,14 +617,14 @@ void Test::testUnaryInMixedNumberAsNumerator()
aCursor
.
InsertText
(
"2"
);
aCursor
.
InsertText
(
"2"
);
// move forward (more than) enough places to be at the end
// move forward (more than) enough places to be at the end
for
(
i
=
0
;
i
<
8
;
++
i
)
for
(
size_t
i
=
0
;
i
<
8
;
++
i
)
aCursor
.
Move
(
&
aOutputDevice
,
MoveRight
);
aCursor
.
Move
(
&
aOutputDevice
,
MoveRight
);
// add 4 to the end
// add 4 to the end
aCursor
.
InsertElement
(
PlusElement
);
aCursor
.
InsertElement
(
PlusElement
);
aCursor
.
InsertText
(
"4"
);
aCursor
.
InsertText
(
"4"
);
sExpected
+
=
" { 2 { - 1 over 2 } + 4 } "
;
OUString
sExpected
=
" { 2 { - 1 over 2 } + 4 } "
;
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"Unary in mixed number as Numerator"
,
sExpected
,
xDocShRef
->
GetText
());
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"Unary in mixed number as Numerator"
,
sExpected
,
xDocShRef
->
GetText
());
delete
pTree
;
delete
pTree
;
...
...
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