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
96a4189c
Kaydet (Commit)
96a4189c
authored
Kas 25, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#86615: Write test for this.
Change-Id: I75412790e0afc1dbe3255254ff13fd41c5e9934b
üst
f46a5d6d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+3
-0
ucalc_formula.cxx
sc/qa/unit/ucalc_formula.cxx
+29
-0
No files found.
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
96a4189c
...
@@ -204,6 +204,8 @@ public:
...
@@ -204,6 +204,8 @@ public:
*/
*/
void
testFormulaDepTracking2
();
void
testFormulaDepTracking2
();
void
testFormulaDepTracking3
();
void
testFormulaDepTrackingDeleteRow
();
void
testFormulaDepTrackingDeleteRow
();
void
testFormulaDepTrackingDeleteCol
();
void
testFormulaDepTrackingDeleteCol
();
...
@@ -491,6 +493,7 @@ public:
...
@@ -491,6 +493,7 @@ public:
CPPUNIT_TEST
(
testValueIterator
);
CPPUNIT_TEST
(
testValueIterator
);
CPPUNIT_TEST
(
testFormulaDepTracking
);
CPPUNIT_TEST
(
testFormulaDepTracking
);
CPPUNIT_TEST
(
testFormulaDepTracking2
);
CPPUNIT_TEST
(
testFormulaDepTracking2
);
CPPUNIT_TEST
(
testFormulaDepTracking3
);
CPPUNIT_TEST
(
testFormulaDepTrackingDeleteRow
);
CPPUNIT_TEST
(
testFormulaDepTrackingDeleteRow
);
CPPUNIT_TEST
(
testFormulaDepTrackingDeleteCol
);
CPPUNIT_TEST
(
testFormulaDepTrackingDeleteCol
);
CPPUNIT_TEST
(
testFormulaMatrixResultUpdate
);
CPPUNIT_TEST
(
testFormulaMatrixResultUpdate
);
...
...
sc/qa/unit/ucalc_formula.cxx
Dosyayı görüntüle @
96a4189c
...
@@ -4248,6 +4248,35 @@ void Test::testFormulaDepTracking2()
...
@@ -4248,6 +4248,35 @@ void Test::testFormulaDepTracking2()
m_pDoc->DeleteTab(0);
m_pDoc->DeleteTab(0);
}
}
void Test::testFormulaDepTracking3()
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.
m_pDoc->InsertTab(0, "Formula");
const char* pData[][4] = {
{ "1", "2", "=SUM(A1:B1)", "=SUM(C1:C3)" },
{ "3", "4", "=SUM(A2:B2)", 0 },
{ "5", "6", "=SUM(A3:B3)", 0 },
};
insertRangeData(m_pDoc, ScAddress(0,0,0), pData, SAL_N_ELEMENTS(pData), true);
// Check the initial formula results.
CPPUNIT_ASSERT_EQUAL( 3.0, m_pDoc->GetValue(ScAddress(2,0,0)));
CPPUNIT_ASSERT_EQUAL( 7.0, m_pDoc->GetValue(ScAddress(2,1,0)));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(ScAddress(2,2,0)));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(ScAddress(3,0,0)));
// Change B3 and make sure the change gets propagated to D1.
ScDocFunc& rFunc = getDocShell().GetDocFunc();
rFunc.SetValueCell(ScAddress(1,2,0), 60.0, false);
CPPUNIT_ASSERT_EQUAL(65.0, m_pDoc->GetValue(ScAddress(2,2,0)));
CPPUNIT_ASSERT_EQUAL(75.0, m_pDoc->GetValue(ScAddress(3,0,0)));
m_pDoc->DeleteTab(0);
}
void Test::testFormulaDepTrackingDeleteRow()
void Test::testFormulaDepTrackingDeleteRow()
{
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.
...
...
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