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
4796d5dd
Kaydet (Commit)
4796d5dd
authored
Ock 06, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add unit test for getting data entries. This used to crash at MAXROW.
Change-Id: Ia904f69ddebcbd61e4ad3b97a0ace3db2d3a33e7
üst
9e77ddcd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
ucalc.cxx
sc/qa/unit/ucalc.cxx
+40
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+7
-0
No files found.
sc/qa/unit/ucalc.cxx
Dosyayı görüntüle @
4796d5dd
...
...
@@ -636,6 +636,46 @@ void Test::testInput()
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testDataEntries
()
{
m_pDoc
->
InsertTab
(
0
,
"Test"
);
m_pDoc
->
SetString
(
ScAddress
(
0
,
5
,
0
),
"Andy"
);
m_pDoc
->
SetString
(
ScAddress
(
0
,
6
,
0
),
"Bruce"
);
m_pDoc
->
SetString
(
ScAddress
(
0
,
7
,
0
),
"Charlie"
);
m_pDoc
->
SetString
(
ScAddress
(
0
,
10
,
0
),
"Andy"
);
std
::
vector
<
ScTypedStrData
>
aEntries
;
m_pDoc
->
GetDataEntries
(
0
,
0
,
0
,
true
,
aEntries
);
// Try at the very top.
// Entries are supposed to be sorted in ascending order, and are all unique.
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
size_t
>
(
3
),
aEntries
.
size
());
std
::
vector
<
ScTypedStrData
>::
const_iterator
it
=
aEntries
.
begin
();
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"Andy"
),
it
->
GetString
());
++
it
;
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"Bruce"
),
it
->
GetString
());
++
it
;
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"Charlie"
),
it
->
GetString
());
++
it
;
CPPUNIT_ASSERT_MESSAGE
(
"The entries should have ended here."
,
it
==
aEntries
.
end
());
aEntries
.
clear
();
m_pDoc
->
GetDataEntries
(
0
,
MAXROW
,
0
,
true
,
aEntries
);
// Try at the very bottom.
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
size_t
>
(
3
),
aEntries
.
size
());
// Make sure we get the same set of suggestions.
it
=
aEntries
.
begin
();
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"Andy"
),
it
->
GetString
());
++
it
;
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"Bruce"
),
it
->
GetString
());
++
it
;
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"Charlie"
),
it
->
GetString
());
++
it
;
CPPUNIT_ASSERT_MESSAGE
(
"The entries should have ended here."
,
it
==
aEntries
.
end
());
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testCopyAttributes
()
{
CPPUNIT_ASSERT_MESSAGE
(
"mashed up attributes"
,
!
(
IDF_ATTRIB
&
IDF_CONTENTS
));
...
...
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
4796d5dd
...
...
@@ -84,6 +84,12 @@ public:
void
testRangeList
();
void
testInput
();
/**
* The 'data entries' data is a list of strings used for suggestions as
* the user types in new cell value.
*/
void
testDataEntries
();
void
testFormulaCreateStringFromTokens
();
void
testFormulaParseReference
();
void
testFetchVectorRefArray
();
...
...
@@ -299,6 +305,7 @@ public:
CPPUNIT_TEST
(
testSharedStringPool
);
CPPUNIT_TEST
(
testRangeList
);
CPPUNIT_TEST
(
testInput
);
CPPUNIT_TEST
(
testDataEntries
);
CPPUNIT_TEST
(
testFormulaCreateStringFromTokens
);
CPPUNIT_TEST
(
testFormulaParseReference
);
CPPUNIT_TEST
(
testFetchVectorRefArray
);
...
...
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