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
ac5682aa
Kaydet (Commit)
ac5682aa
authored
Şub 08, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#74453: Write unit test for this.
Change-Id: Ic8cbc650d6608ff7af5d1d58deeeba409bb81725
üst
2d04286f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+2
-0
ucalc_sharedformula.cxx
sc/qa/unit/ucalc_sharedformula.cxx
+39
-0
No files found.
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
ac5682aa
...
...
@@ -252,6 +252,7 @@ public:
void
testSharedFormulasRefUpdateRange
();
void
testSharedFormulasDeleteRows
();
void
testSharedFormulasRefUpdateMoveSheets
();
void
testSharedFormulasRefUpdateCopySheets
();
void
testSharedFormulasCopyPaste
();
void
testSharedFormulaInsertColumn
();
void
testFormulaPosition
();
...
...
@@ -414,6 +415,7 @@ public:
CPPUNIT_TEST
(
testSharedFormulasRefUpdateRange
);
CPPUNIT_TEST
(
testSharedFormulasDeleteRows
);
CPPUNIT_TEST
(
testSharedFormulasRefUpdateMoveSheets
);
CPPUNIT_TEST
(
testSharedFormulasRefUpdateCopySheets
);
CPPUNIT_TEST
(
testSharedFormulasCopyPaste
);
CPPUNIT_TEST
(
testSharedFormulaInsertColumn
);
CPPUNIT_TEST
(
testFormulaPosition
);
...
...
sc/qa/unit/ucalc_sharedformula.cxx
Dosyayı görüntüle @
ac5682aa
...
...
@@ -600,6 +600,45 @@ void Test::testSharedFormulasRefUpdateMoveSheets()
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testSharedFormulasRefUpdateCopySheets
()
{
sc
::
AutoCalcSwitch
aACSwitch
(
*
m_pDoc
,
true
);
// make sure auto calc is on.
m_pDoc
->
InsertTab
(
0
,
"Sheet1"
);
m_pDoc
->
InsertTab
(
1
,
"Sheet2"
);
m_pDoc
->
SetValue
(
ScAddress
(
0
,
0
,
1
),
1.0
);
// A1 on Sheet2
m_pDoc
->
SetValue
(
ScAddress
(
0
,
1
,
1
),
2.0
);
// A2 on Sheet2
// Reference values on Sheet2, but use absolute sheet references.
m_pDoc
->
SetString
(
ScAddress
(
0
,
0
,
0
),
"=$Sheet2.A1"
);
m_pDoc
->
SetString
(
ScAddress
(
0
,
1
,
0
),
"=$Sheet2.A2"
);
CPPUNIT_ASSERT_EQUAL
(
1.0
,
m_pDoc
->
GetValue
(
ScAddress
(
0
,
0
,
0
)));
CPPUNIT_ASSERT_EQUAL
(
2.0
,
m_pDoc
->
GetValue
(
ScAddress
(
0
,
1
,
0
)));
// Copy Sheet1 and insert the copied sheet before the current Sheet1 position.
m_pDoc
->
CopyTab
(
0
,
0
);
if
(
!
checkFormula
(
*
m_pDoc
,
ScAddress
(
0
,
0
,
0
),
"$Sheet2.A1"
))
CPPUNIT_FAIL
(
"Wrong formula"
);
if
(
!
checkFormula
(
*
m_pDoc
,
ScAddress
(
0
,
1
,
0
),
"$Sheet2.A2"
))
CPPUNIT_FAIL
(
"Wrong formula"
);
// Check the values on the copied sheet.
CPPUNIT_ASSERT_EQUAL
(
1.0
,
m_pDoc
->
GetValue
(
ScAddress
(
0
,
0
,
0
)));
CPPUNIT_ASSERT_EQUAL
(
2.0
,
m_pDoc
->
GetValue
(
ScAddress
(
0
,
1
,
0
)));
// Check the values on the original sheet.
CPPUNIT_ASSERT_EQUAL
(
1.0
,
m_pDoc
->
GetValue
(
ScAddress
(
0
,
0
,
1
)));
CPPUNIT_ASSERT_EQUAL
(
2.0
,
m_pDoc
->
GetValue
(
ScAddress
(
0
,
1
,
1
)));
m_pDoc
->
DeleteTab
(
2
);
m_pDoc
->
DeleteTab
(
1
);
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testSharedFormulasCopyPaste
()
{
m_pDoc
->
InsertTab
(
0
,
"Test"
);
...
...
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