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
c43c3e3c
Kaydet (Commit)
c43c3e3c
authored
Tem 19, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add test for resizing range references. To be expanded later.
Change-Id: I886d190dd2533b89185dbc24d0b9043941618802
üst
3d7976b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+2
-0
ucalc_formula.cxx
sc/qa/unit/ucalc_formula.cxx
+38
-0
No files found.
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
c43c3e3c
...
...
@@ -87,6 +87,7 @@ public:
void
testFormulaRefData
();
void
testFormulaCompiler
();
void
testFormulaRefUpdate
();
void
testFormulaRefUpdateRange
();
void
testFuncSUM
();
void
testFuncPRODUCT
();
void
testFuncN
();
...
...
@@ -274,6 +275,7 @@ public:
CPPUNIT_TEST
(
testFormulaRefData
);
CPPUNIT_TEST
(
testFormulaCompiler
);
CPPUNIT_TEST
(
testFormulaRefUpdate
);
CPPUNIT_TEST
(
testFormulaRefUpdateRange
);
CPPUNIT_TEST
(
testFuncSUM
);
CPPUNIT_TEST
(
testFuncPRODUCT
);
CPPUNIT_TEST
(
testFuncN
);
...
...
sc/qa/unit/ucalc_formula.cxx
Dosyayı görüntüle @
c43c3e3c
...
...
@@ -441,6 +441,44 @@ void Test::testFormulaRefUpdate()
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testFormulaRefUpdateRange
()
{
m_pDoc
->
InsertTab
(
0
,
"Formula"
);
sc
::
AutoCalcSwitch
aACSwitch
(
*
m_pDoc
,
true
);
// turn auto calc on.
// Set values to B2:C5.
m_pDoc
->
SetValue
(
ScAddress
(
1
,
1
,
0
),
1
);
m_pDoc
->
SetValue
(
ScAddress
(
1
,
2
,
0
),
2
);
m_pDoc
->
SetValue
(
ScAddress
(
1
,
3
,
0
),
3
);
m_pDoc
->
SetValue
(
ScAddress
(
1
,
4
,
0
),
4
);
m_pDoc
->
SetValue
(
ScAddress
(
2
,
1
,
0
),
5
);
m_pDoc
->
SetValue
(
ScAddress
(
2
,
2
,
0
),
6
);
m_pDoc
->
SetValue
(
ScAddress
(
2
,
3
,
0
),
7
);
m_pDoc
->
SetValue
(
ScAddress
(
2
,
4
,
0
),
8
);
// Set formula cells to A7 and A8.
m_pDoc
->
SetString
(
ScAddress
(
0
,
6
,
0
),
"=SUM(B2:C5)"
);
m_pDoc
->
SetString
(
ScAddress
(
0
,
7
,
0
),
"=SUM($B$2:$C$5)"
);
if
(
!
checkFormula
(
*
m_pDoc
,
ScAddress
(
0
,
6
,
0
),
"SUM(B2:C5)"
))
CPPUNIT_FAIL
(
"Wrong formula in A7."
);
if
(
!
checkFormula
(
*
m_pDoc
,
ScAddress
(
0
,
7
,
0
),
"SUM($B$2:$C$5)"
))
CPPUNIT_FAIL
(
"Wrong formula in A8."
);
// Delete row 3. This should shrink the range references by one row.
m_pDoc
->
DeleteRow
(
ScRange
(
0
,
2
,
0
,
MAXCOL
,
2
,
0
));
if
(
!
checkFormula
(
*
m_pDoc
,
ScAddress
(
0
,
5
,
0
),
"SUM(B2:C4)"
))
CPPUNIT_FAIL
(
"Wrong formula in A6."
);
if
(
!
checkFormula
(
*
m_pDoc
,
ScAddress
(
0
,
6
,
0
),
"SUM($B$2:$C$4)"
))
CPPUNIT_FAIL
(
"Wrong formula in A7."
);
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testFuncSUM
()
{
OUString
aTabName
(
"foo"
);
...
...
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