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
f7b4c1ce
Kaydet (Commit)
f7b4c1ce
authored
Tem 23, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add test for extending range reference.
Change-Id: I882f312fd0908d83203da5b48d9c3f4d002e8dd0
üst
a5890efc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
14 deletions
+34
-14
ucalc_formula.cxx
sc/qa/unit/ucalc_formula.cxx
+34
-14
No files found.
sc/qa/unit/ucalc_formula.cxx
Dosyayı görüntüle @
f7b4c1ce
...
@@ -117,20 +117,40 @@ void Test::testFormulaHashAndTag()
...
@@ -117,20 +117,40 @@ void Test::testFormulaHashAndTag()
void
Test
::
testFormulaRefData
()
void
Test
::
testFormulaRefData
()
{
{
ScAddress
aAddr
(
4
,
5
,
3
),
aPos
(
2
,
2
,
2
);
ScAddress
aAddr
(
4
,
5
,
3
),
aPos
(
2
,
2
,
2
);
ScSingleRefData
aRefData
;
ScSingleRefData
aRef
;
aRefData
.
InitAddress
(
aAddr
);
aRef
.
InitAddress
(
aAddr
);
CPPUNIT_ASSERT_MESSAGE
(
"Wrong ref data state."
,
!
aRefData
.
IsRowRel
()
&&
!
aRefData
.
IsColRel
()
&&
!
aRefData
.
IsTabRel
());
CPPUNIT_ASSERT_MESSAGE
(
"Wrong ref data state."
,
!
aRef
.
IsRowRel
()
&&
!
aRef
.
IsColRel
()
&&
!
aRef
.
IsTabRel
());
ASSERT_EQUAL_TYPE
(
SCCOL
,
4
,
aRefData
.
GetCol
());
ASSERT_EQUAL_TYPE
(
SCCOL
,
4
,
aRef
.
GetCol
());
ASSERT_EQUAL_TYPE
(
SCROW
,
5
,
aRefData
.
GetRow
());
ASSERT_EQUAL_TYPE
(
SCROW
,
5
,
aRef
.
GetRow
());
ASSERT_EQUAL_TYPE
(
SCTAB
,
3
,
aRefData
.
GetTab
());
ASSERT_EQUAL_TYPE
(
SCTAB
,
3
,
aRef
.
GetTab
());
aRefData
.
SetRowRel
(
true
);
aRef
.
SetRowRel
(
true
);
aRefData
.
SetColRel
(
true
);
aRef
.
SetColRel
(
true
);
aRefData
.
SetTabRel
(
true
);
aRef
.
SetTabRel
(
true
);
aRefData
.
SetAddress
(
aAddr
,
aPos
);
aRef
.
SetAddress
(
aAddr
,
aPos
);
ASSERT_EQUAL_TYPE
(
SCCOL
,
2
,
aRefData
.
GetCol
());
ASSERT_EQUAL_TYPE
(
SCCOL
,
2
,
aRef
.
GetCol
());
ASSERT_EQUAL_TYPE
(
SCROW
,
3
,
aRefData
.
GetRow
());
ASSERT_EQUAL_TYPE
(
SCROW
,
3
,
aRef
.
GetRow
());
ASSERT_EQUAL_TYPE
(
SCTAB
,
1
,
aRefData
.
GetTab
());
ASSERT_EQUAL_TYPE
(
SCTAB
,
1
,
aRef
.
GetTab
());
// Test extension of range reference.
ScComplexRefData
aDoubleRef
;
aDoubleRef
.
InitRange
(
ScRange
(
2
,
2
,
0
,
4
,
4
,
0
));
aRef
.
InitAddress
(
ScAddress
(
6
,
5
,
0
));
aDoubleRef
.
Extend
(
aRef
,
ScAddress
());
ScRange
aTest
=
aDoubleRef
.
toAbs
(
ScAddress
());
CPPUNIT_ASSERT_MESSAGE
(
"Wrong start position of extended range."
,
aTest
.
aStart
==
ScAddress
(
2
,
2
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"Wrong end position of extended range."
,
aTest
.
aEnd
==
ScAddress
(
6
,
5
,
0
));
ScComplexRefData
aDoubleRef2
;
aDoubleRef2
.
InitRangeRel
(
ScRange
(
1
,
2
,
0
,
8
,
6
,
0
),
ScAddress
(
5
,
5
,
0
));
aDoubleRef
.
Extend
(
aDoubleRef2
,
ScAddress
(
5
,
5
,
0
));
aTest
=
aDoubleRef
.
toAbs
(
ScAddress
(
5
,
5
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"Wrong start position of extended range."
,
aTest
.
aStart
==
ScAddress
(
1
,
2
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"Wrong end position of extended range."
,
aTest
.
aEnd
==
ScAddress
(
8
,
6
,
0
));
}
}
namespace
{
namespace
{
...
...
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