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
18fa4733
Kaydet (Commit)
18fa4733
authored
Nis 28, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#75397: Write unit test for this.
Change-Id: Id261aebd427eb032463668c2654ce837139b4a05
üst
d2f9e1a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+2
-0
ucalc_formula.cxx
sc/qa/unit/ucalc_formula.cxx
+33
-0
No files found.
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
18fa4733
...
...
@@ -133,6 +133,7 @@ public:
void
testFuncN
();
void
testFuncCOUNTIF
();
void
testFuncNUMBERVALUE
();
void
testFuncLEN
();
void
testFuncLOOKUP
();
void
testFuncVLOOKUP
();
void
testFuncMATCH
();
...
...
@@ -383,6 +384,7 @@ public:
CPPUNIT_TEST
(
testFuncN
);
CPPUNIT_TEST
(
testFuncCOUNTIF
);
CPPUNIT_TEST
(
testFuncNUMBERVALUE
);
CPPUNIT_TEST
(
testFuncLEN
);
CPPUNIT_TEST
(
testFuncLOOKUP
);
CPPUNIT_TEST
(
testFuncVLOOKUP
);
CPPUNIT_TEST
(
testFuncMATCH
);
...
...
sc/qa/unit/ucalc_formula.cxx
Dosyayı görüntüle @
18fa4733
...
...
@@ -2635,6 +2635,39 @@ void Test::testFuncNUMBERVALUE()
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testFuncLEN
()
{
sc
::
AutoCalcSwitch
aACSwitch
(
*
m_pDoc
,
true
);
// turn auto calc on.
m_pDoc
->
InsertTab
(
0
,
"Formula"
);
// Leave A1:A3 empty, and insert an array of LEN in B1:B3 that references
// these empty cells.
ScMarkData
aMark
;
aMark
.
SelectOneTable
(
0
);
m_pDoc
->
InsertMatrixFormula
(
1
,
0
,
1
,
2
,
aMark
,
"=LEN(A1:A3)"
,
NULL
);
ScFormulaCell
*
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
0
,
0
));
CPPUNIT_ASSERT
(
pFC
);
CPPUNIT_ASSERT_MESSAGE
(
"This formulashould be a matrix origin."
,
pFC
->
GetMatrixFlag
()
==
MM_FORMULA
);
// This should be a 1x3 matrix.
SCCOL
nCols
=
-
1
;
SCROW
nRows
=
-
1
;
pFC
->
GetMatColsRows
(
nCols
,
nRows
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCCOL
>
(
1
),
nCols
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
3
),
nRows
);
// LEN value should be 0 for an empty cell.
CPPUNIT_ASSERT_EQUAL
(
0.0
,
m_pDoc
->
GetValue
(
ScAddress
(
1
,
0
,
0
)));
CPPUNIT_ASSERT_EQUAL
(
0.0
,
m_pDoc
->
GetValue
(
ScAddress
(
1
,
1
,
0
)));
CPPUNIT_ASSERT_EQUAL
(
0.0
,
m_pDoc
->
GetValue
(
ScAddress
(
1
,
2
,
0
)));
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testFuncLOOKUP
()
{
FormulaGrammarSwitch
aFGSwitch
(
m_pDoc
,
formula
::
FormulaGrammar
::
GRAM_ENGLISH_XL_R1C1
);
...
...
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