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
9943473a
Kaydet (Commit)
9943473a
authored
Tem 14, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#81309: Write test for out-of-place sorting.
Change-Id: Id98c080e2b1ba120b1ac4f9f27e6ab10574daa88
üst
5ed9dea7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
1 deletion
+70
-1
ucalc.cxx
sc/qa/unit/ucalc.cxx
+68
-1
ucalc.hxx
sc/qa/unit/ucalc.hxx
+2
-0
No files found.
sc/qa/unit/ucalc.cxx
Dosyayı görüntüle @
9943473a
...
...
@@ -5561,7 +5561,7 @@ void Test::testSortRefUpdate3()
m_pDoc->SetAnonymousDBData(
0, new ScDBData(STR_DB_LOCAL_NONAME, 0, 0, 0, 0, 5));
// Sort A1:
B5
by column A (with a row header).
// Sort A1:
A6
by column A (with a row header).
ScSortParam aSortData;
aSortData.nCol1 = 0;
aSortData.nCol2 = 0;
...
...
@@ -5615,6 +5615,73 @@ void Test::testSortRefUpdate3()
m_pDoc->DeleteTab(0);
}
void Test::testSortOutOfPlaceResult()
{
m_pDoc->InsertTab(0, "Sort");
const char* pData[] = {
"Header",
"1",
"23",
"2",
"9",
"-2",
0 // terminator
};
// source data in A1:A6.
for (SCROW i = 0; pData[i]; ++i)
m_pDoc->SetString(ScAddress(0,i,0), OUString::createFromAscii(pData[i]));
// Check the initial values.
CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(23.0, m_pDoc->GetValue(ScAddress(0,2,0)));
CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(0,3,0)));
CPPUNIT_ASSERT_EQUAL( 9.0, m_pDoc->GetValue(ScAddress(0,4,0)));
CPPUNIT_ASSERT_EQUAL(-2.0, m_pDoc->GetValue(ScAddress(0,5,0)));
ScDBDocFunc aFunc(getDocShell());
// Sort A1:A6, and set the result to C2:C7
m_pDoc->SetAnonymousDBData(
0, new ScDBData(STR_DB_LOCAL_NONAME, 0, 0, 0, 0, 5));
ScSortParam aSortData;
aSortData.nCol1 = 0;
aSortData.nCol2 = 0;
aSortData.nRow1 = 0;
aSortData.nRow2 = 5;
aSortData.bHasHeader = true;
aSortData.bInplace = false;
aSortData.nDestTab = 0;
aSortData.nDestCol = 2;
aSortData.nDestRow = 1;
aSortData.maKeyState[0].bDoSort = true;
aSortData.maKeyState[0].nField = 0;
aSortData.maKeyState[0].bAscending = true;
bool bSorted = aFunc.Sort(0, aSortData, true, true, true);
CPPUNIT_ASSERT(bSorted);
// Source data still intact.
CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(23.0, m_pDoc->GetValue(ScAddress(0,2,0)));
CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(0,3,0)));
CPPUNIT_ASSERT_EQUAL( 9.0, m_pDoc->GetValue(ScAddress(0,4,0)));
CPPUNIT_ASSERT_EQUAL(-2.0, m_pDoc->GetValue(ScAddress(0,5,0)));
// Sort result in C2:C7.
CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(2,1,0)));
CPPUNIT_ASSERT_EQUAL(-2.0, m_pDoc->GetValue(ScAddress(2,2,0)));
CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(2,3,0)));
CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(2,4,0)));
CPPUNIT_ASSERT_EQUAL( 9.0, m_pDoc->GetValue(ScAddress(2,5,0)));
CPPUNIT_ASSERT_EQUAL(23.0, m_pDoc->GetValue(ScAddress(2,6,0)));
m_pDoc->DeleteTab(0);
}
void Test::testShiftCells()
{
m_pDoc->InsertTab(0, "foo");
...
...
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
9943473a
...
...
@@ -349,6 +349,7 @@ public:
void
testSortRefUpdate
();
void
testSortRefUpdate2
();
void
testSortRefUpdate3
();
void
testSortOutOfPlaceResult
();
void
testShiftCells
();
void
testNoteBasic
();
...
...
@@ -521,6 +522,7 @@ public:
CPPUNIT_TEST
(
testSortRefUpdate
);
CPPUNIT_TEST
(
testSortRefUpdate2
);
CPPUNIT_TEST
(
testSortRefUpdate3
);
CPPUNIT_TEST
(
testSortOutOfPlaceResult
);
CPPUNIT_TEST
(
testShiftCells
);
CPPUNIT_TEST
(
testNoteBasic
);
CPPUNIT_TEST
(
testNoteDeleteRow
);
...
...
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