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
228cd29a
Kaydet (Commit)
228cd29a
authored
Ock 23, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#73986: Write unit test for document statistics.
Change-Id: I8ff51fda91627b365cf71be8849d07b92b447ba9
üst
9ce7ba20
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
ucalc.cxx
sc/qa/unit/ucalc.cxx
+21
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+2
-0
No files found.
sc/qa/unit/ucalc.cxx
Dosyayı görüntüle @
228cd29a
...
@@ -634,6 +634,27 @@ void Test::testInput()
...
@@ -634,6 +634,27 @@ void Test::testInput()
m_pDoc
->
DeleteTab
(
0
);
m_pDoc
->
DeleteTab
(
0
);
}
}
void
Test
::
testDocStatistics
()
{
SCTAB
nStartTabs
=
m_pDoc
->
GetTableCount
();
m_pDoc
->
InsertTab
(
0
,
"Sheet1"
);
CPPUNIT_ASSERT_MESSAGE
(
"Failed to increment sheet count."
,
m_pDoc
->
GetTableCount
()
==
nStartTabs
+
1
);
m_pDoc
->
InsertTab
(
1
,
"Sheet2"
);
CPPUNIT_ASSERT_MESSAGE
(
"Failed to increment sheet count."
,
m_pDoc
->
GetTableCount
()
==
nStartTabs
+
2
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_uLong
>
(
0
),
m_pDoc
->
GetCellCount
());
m_pDoc
->
SetValue
(
ScAddress
(
0
,
0
,
0
),
2.0
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_uLong
>
(
1
),
m_pDoc
->
GetCellCount
());
m_pDoc
->
SetValue
(
ScAddress
(
2
,
2
,
0
),
2.5
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_uLong
>
(
2
),
m_pDoc
->
GetCellCount
());
m_pDoc
->
SetString
(
ScAddress
(
1
,
1
,
1
),
"Test"
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_uLong
>
(
3
),
m_pDoc
->
GetCellCount
());
m_pDoc
->
DeleteTab
(
1
);
CPPUNIT_ASSERT_MESSAGE
(
"Failed to decrement sheet count."
,
m_pDoc
->
GetTableCount
()
==
nStartTabs
+
1
);
m_pDoc
->
DeleteTab
(
0
);
// This may fail in case there is only one sheet in the document.
}
void
Test
::
testDataEntries
()
void
Test
::
testDataEntries
()
{
{
m_pDoc
->
InsertTab
(
0
,
"Test"
);
m_pDoc
->
InsertTab
(
0
,
"Test"
);
...
...
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
228cd29a
...
@@ -83,6 +83,7 @@ public:
...
@@ -83,6 +83,7 @@ public:
void
testSharedStringPool
();
void
testSharedStringPool
();
void
testRangeList
();
void
testRangeList
();
void
testInput
();
void
testInput
();
void
testDocStatistics
();
/**
/**
* The 'data entries' data is a list of strings used for suggestions as
* The 'data entries' data is a list of strings used for suggestions as
...
@@ -314,6 +315,7 @@ public:
...
@@ -314,6 +315,7 @@ public:
CPPUNIT_TEST
(
testSharedStringPool
);
CPPUNIT_TEST
(
testSharedStringPool
);
CPPUNIT_TEST
(
testRangeList
);
CPPUNIT_TEST
(
testRangeList
);
CPPUNIT_TEST
(
testInput
);
CPPUNIT_TEST
(
testInput
);
CPPUNIT_TEST
(
testDocStatistics
);
CPPUNIT_TEST
(
testDataEntries
);
CPPUNIT_TEST
(
testDataEntries
);
CPPUNIT_TEST
(
testSelectionFunction
);
CPPUNIT_TEST
(
testSelectionFunction
);
CPPUNIT_TEST
(
testFormulaCreateStringFromTokens
);
CPPUNIT_TEST
(
testFormulaCreateStringFromTokens
);
...
...
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