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
1abc8c16
Kaydet (Commit)
1abc8c16
authored
Tem 27, 2015
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
unit test for FORMULA() with and without array context
Change-Id: Ic8e0f5dfad6e9b9a70e6dca89a970c131efc53d9
üst
dcec162e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+2
-0
ucalc_formula.cxx
sc/qa/unit/ucalc_formula.cxx
+41
-0
No files found.
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
1abc8c16
...
@@ -181,6 +181,7 @@ public:
...
@@ -181,6 +181,7 @@ public:
void
testFuncGETPIVOTDATALeafAccess
();
void
testFuncGETPIVOTDATALeafAccess
();
void
testMatrixOp
();
void
testMatrixOp
();
void
testFuncRangeOp
();
void
testFuncRangeOp
();
void
testFuncFORMULA
();
void
testExternalRef
();
void
testExternalRef
();
void
testExternalRefFunctions
();
void
testExternalRefFunctions
();
...
@@ -508,6 +509,7 @@ public:
...
@@ -508,6 +509,7 @@ public:
CPPUNIT_TEST
(
testFuncGETPIVOTDATALeafAccess
);
CPPUNIT_TEST
(
testFuncGETPIVOTDATALeafAccess
);
CPPUNIT_TEST
(
testMatrixOp
);
CPPUNIT_TEST
(
testMatrixOp
);
CPPUNIT_TEST
(
testFuncRangeOp
);
CPPUNIT_TEST
(
testFuncRangeOp
);
CPPUNIT_TEST
(
testFuncFORMULA
);
CPPUNIT_TEST
(
testExternalRef
);
CPPUNIT_TEST
(
testExternalRef
);
CPPUNIT_TEST
(
testExternalRefFunctions
);
CPPUNIT_TEST
(
testExternalRefFunctions
);
CPPUNIT_TEST
(
testCopyToDocument
);
CPPUNIT_TEST
(
testCopyToDocument
);
...
...
sc/qa/unit/ucalc_formula.cxx
Dosyayı görüntüle @
1abc8c16
...
@@ -5325,4 +5325,45 @@ void Test::testFuncRangeOp()
...
@@ -5325,4 +5325,45 @@ void Test::testFuncRangeOp()
m_pDoc
->
DeleteTab
(
0
);
m_pDoc
->
DeleteTab
(
0
);
}
}
void
Test
::
testFuncFORMULA
()
{
sc
::
AutoCalcSwitch
aACSwitch
(
*
m_pDoc
,
true
);
// turn on auto calc.
m_pDoc
->
InsertTab
(
0
,
"Sheet1"
);
// Data in B1:D3
const
char
*
aData
[][
3
]
=
{
{
"=A1"
,
"=FORMULA(B1)"
,
"=FORMULA(B1:B3)"
},
{
0
,
"=FORMULA(B2)"
,
"=FORMULA(B1:B3)"
},
{
"=A3"
,
"=FORMULA(B3)"
,
"=FORMULA(B1:B3)"
},
};
ScAddress
aPos
(
1
,
0
,
0
);
ScRange
aRange
=
insertRangeData
(
m_pDoc
,
aPos
,
aData
,
SAL_N_ELEMENTS
(
aData
));
CPPUNIT_ASSERT
(
aRange
.
aStart
==
aPos
);
// Checks of C1:D3, where Cy==Dy, and D4:D6
const
char
*
aChecks
[]
=
{
"=A1"
,
"#N/A"
,
"=A3"
,
};
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aChecks
);
++
i
)
{
CPPUNIT_ASSERT_EQUAL
(
OUString
::
createFromAscii
(
aChecks
[
i
]),
m_pDoc
->
GetString
(
2
,
i
,
0
));
CPPUNIT_ASSERT_EQUAL
(
OUString
::
createFromAscii
(
aChecks
[
i
]),
m_pDoc
->
GetString
(
3
,
i
,
0
));
}
// Matrix in D4:D6, no intersection with B1:B3
ScMarkData
aMark
;
aMark
.
SelectOneTable
(
0
);
m_pDoc
->
InsertMatrixFormula
(
3
,
3
,
3
,
5
,
aMark
,
"=FORMULA(B1:B3)"
);
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aChecks
);
++
i
)
{
CPPUNIT_ASSERT_EQUAL
(
OUString
::
createFromAscii
(
aChecks
[
i
]),
m_pDoc
->
GetString
(
3
,
i
+
3
,
0
));
}
m_pDoc
->
DeleteTab
(
0
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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