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
1652b8a5
Kaydet (Commit)
1652b8a5
authored
Nis 25, 2014
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
added .xlsx .xls .ods export/reimport tests for new spreadsheet functions
Change-Id: I71baaf27a16e60eb11f80f61664fc09dcf047cf1
üst
25c2a966
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
159 additions
and
114 deletions
+159
-114
shared_test_impl.hxx
sc/qa/unit/helper/shared_test_impl.hxx
+120
-0
subsequent_export-test.cxx
sc/qa/unit/subsequent_export-test.cxx
+38
-0
subsequent_filters-test.cxx
sc/qa/unit/subsequent_filters-test.cxx
+1
-114
No files found.
sc/qa/unit/helper/shared_test_impl.hxx
Dosyayı görüntüle @
1652b8a5
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
#include "colorscale.hxx"
#include "colorscale.hxx"
#include "conditio.hxx"
#include "conditio.hxx"
#include "document.hxx"
#include "document.hxx"
#include "formulacell.hxx"
struct
FindCondFormatByEnclosingRange
struct
FindCondFormatByEnclosingRange
{
{
...
@@ -151,6 +152,125 @@ void testColorScale3Entry_Impl(ScDocument* pDoc)
...
@@ -151,6 +152,125 @@ void testColorScale3Entry_Impl(ScDocument* pDoc)
}
}
}
}
void
testFunctionsExcel2010_Impl
(
ScDocument
*
pDoc
)
{
// Original test case document is functions-excel-2010.xlsx
// Which test rows to evaluate, 1-based as in UI to ease maintenance.
struct
{
SCROW
nRow
;
bool
bEvaluate
;
}
aTests
[]
=
{
{
2
,
false
},
{
3
,
true
},
{
4
,
true
},
{
5
,
true
},
{
6
,
true
},
{
7
,
true
},
{
8
,
true
},
{
9
,
true
},
{
10
,
true
},
{
11
,
true
},
{
12
,
true
},
{
13
,
true
},
{
14
,
true
},
{
15
,
true
},
{
16
,
true
},
{
17
,
true
},
{
18
,
true
},
{
19
,
true
},
{
20
,
true
},
{
21
,
true
},
{
22
,
true
},
{
23
,
true
},
{
24
,
true
},
{
25
,
true
},
{
26
,
true
},
{
27
,
true
},
{
28
,
true
},
{
29
,
true
},
{
30
,
true
},
{
31
,
true
},
{
32
,
true
},
{
33
,
true
},
{
34
,
true
},
{
35
,
true
},
{
36
,
true
},
{
37
,
true
},
{
38
,
true
},
{
39
,
true
},
{
40
,
true
},
{
41
,
true
},
{
42
,
true
},
{
43
,
true
},
{
44
,
true
},
{
45
,
false
},
// name=[ NETWORKDAYS.INTL ], result=18, expected=19
{
46
,
true
},
{
47
,
true
},
{
48
,
true
},
{
49
,
true
},
{
50
,
true
},
{
51
,
true
},
{
52
,
true
},
{
53
,
true
},
{
54
,
true
},
{
55
,
true
},
{
56
,
true
},
{
57
,
true
},
{
58
,
true
},
{
59
,
true
},
{
60
,
true
},
{
61
,
true
},
{
62
,
true
},
{
63
,
true
},
{
64
,
true
},
{
65
,
true
},
{
66
,
true
},
{
67
,
true
},
{
68
,
true
},
{
69
,
true
},
{
70
,
true
},
{
71
,
true
},
{
72
,
true
},
{
73
,
true
},
{
74
,
true
},
{
75
,
true
},
{
76
,
true
},
{
77
,
true
},
{
78
,
true
},
{
79
,
false
},
// name=[ WORKDAY.INTL ], result=41755 , expected=41754
{
80
,
true
}
};
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aTests
);
++
i
)
{
if
(
aTests
[
i
].
bEvaluate
)
{
// Column A is description, B is formula, C is Excel result, D is
// comparison.
SCROW
nRow
=
aTests
[
i
].
nRow
-
1
;
// 0-based
OString
aStr
=
OString
::
number
(
aTests
[
i
].
nRow
)
+
", function name=[ "
+
OUStringToOString
(
pDoc
->
GetString
(
ScAddress
(
0
,
nRow
,
0
)),
RTL_TEXTENCODING_UTF8
)
+
" ], result="
+
OString
::
number
(
pDoc
->
GetValue
(
ScAddress
(
1
,
nRow
,
0
))
)
+
", expected="
+
OString
::
number
(
pDoc
->
GetValue
(
ScAddress
(
2
,
nRow
,
0
))
);
ScFormulaCell
*
pFC
=
pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
nRow
,
0
)
);
if
(
pFC
&&
pFC
->
GetErrCode
()
!=
0
)
aStr
+=
", error code ="
+
OString
::
number
(
pFC
->
GetErrCode
()
);
CPPUNIT_ASSERT_MESSAGE
(
OString
(
"Expected a formula cell without error at row "
+
aStr
).
getStr
(),
isFormulaWithoutError
(
*
pDoc
,
ScAddress
(
1
,
nRow
,
0
)));
CPPUNIT_ASSERT_MESSAGE
(
OString
(
"Expected a TRUE value at row "
+
aStr
).
getStr
(),
0
!=
pDoc
->
GetValue
(
ScAddress
(
3
,
nRow
,
0
)));
}
}
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/qa/unit/subsequent_export-test.cxx
Dosyayı görüntüle @
1652b8a5
...
@@ -97,6 +97,11 @@ public:
...
@@ -97,6 +97,11 @@ public:
void
testSharedFormulaExportXLSX
();
void
testSharedFormulaExportXLSX
();
void
testSharedFormulaStringResultExportXLSX
();
void
testSharedFormulaStringResultExportXLSX
();
void
testFunctionsExcel2010
(
sal_uLong
nFormatType
);
void
testFunctionsExcel2010XLSX
();
void
testFunctionsExcel2010XLS
();
void
testFunctionsExcel2010ODS
();
CPPUNIT_TEST_SUITE
(
ScExportTest
);
CPPUNIT_TEST_SUITE
(
ScExportTest
);
CPPUNIT_TEST
(
test
);
CPPUNIT_TEST
(
test
);
#if !defined(MACOSX) && !defined(DRAGONFLY)
#if !defined(MACOSX) && !defined(DRAGONFLY)
...
@@ -126,6 +131,9 @@ public:
...
@@ -126,6 +131,9 @@ public:
CPPUNIT_TEST
(
testSharedFormulaExportXLS
);
CPPUNIT_TEST
(
testSharedFormulaExportXLS
);
CPPUNIT_TEST
(
testSharedFormulaExportXLSX
);
CPPUNIT_TEST
(
testSharedFormulaExportXLSX
);
CPPUNIT_TEST
(
testSharedFormulaStringResultExportXLSX
);
CPPUNIT_TEST
(
testSharedFormulaStringResultExportXLSX
);
CPPUNIT_TEST
(
testFunctionsExcel2010XLSX
);
CPPUNIT_TEST
(
testFunctionsExcel2010XLS
);
CPPUNIT_TEST
(
testFunctionsExcel2010ODS
);
CPPUNIT_TEST_SUITE_END
();
CPPUNIT_TEST_SUITE_END
();
...
@@ -1406,6 +1414,36 @@ void ScExportTest::testSharedFormulaStringResultExportXLSX()
...
@@ -1406,6 +1414,36 @@ void ScExportTest::testSharedFormulaStringResultExportXLSX()
xDocSh2
->
DoClose
();
xDocSh2
->
DoClose
();
}
}
void
ScExportTest
::
testFunctionsExcel2010
(
sal_uLong
nFormatType
)
{
ScDocShellRef
xShell
=
loadDoc
(
"functions-excel-2010."
,
XLSX
);
CPPUNIT_ASSERT_MESSAGE
(
"Failed to load the document."
,
xShell
.
Is
());
ScDocShellRef
xDocSh
=
saveAndReload
(
xShell
,
nFormatType
);
ScDocument
*
pDoc
=
xDocSh
->
GetDocument
();
CPPUNIT_ASSERT
(
pDoc
);
pDoc
->
CalcAll
();
// perform hard re-calculation.
testFunctionsExcel2010_Impl
(
pDoc
);
xDocSh
->
DoClose
();
}
void
ScExportTest
::
testFunctionsExcel2010XLSX
()
{
testFunctionsExcel2010
(
XLSX
);
}
void
ScExportTest
::
testFunctionsExcel2010XLS
()
{
testFunctionsExcel2010
(
XLS
);
}
void
ScExportTest
::
testFunctionsExcel2010ODS
()
{
testFunctionsExcel2010
(
ODS
);
}
ScExportTest
::
ScExportTest
()
ScExportTest
::
ScExportTest
()
:
ScBootstrapFixture
(
"/sc/qa/unit/data"
)
:
ScBootstrapFixture
(
"/sc/qa/unit/data"
)
{
{
...
...
sc/qa/unit/subsequent_filters-test.cxx
Dosyayı görüntüle @
1652b8a5
...
@@ -434,120 +434,7 @@ void ScFiltersTest::testFunctionsExcel2010()
...
@@ -434,120 +434,7 @@ void ScFiltersTest::testFunctionsExcel2010()
ScDocument
*
pDoc
=
xDocSh
->
GetDocument
();
ScDocument
*
pDoc
=
xDocSh
->
GetDocument
();
pDoc
->
CalcAll
();
// perform hard re-calculation.
pDoc
->
CalcAll
();
// perform hard re-calculation.
// Which test rows to evaluate, 1-based as in UI to ease maintenance.
testFunctionsExcel2010_Impl
(
pDoc
);
struct
{
SCROW
nRow
;
bool
bEvaluate
;
}
aTests
[]
=
{
{
2
,
false
},
{
3
,
true
},
{
4
,
true
},
{
5
,
true
},
{
6
,
true
},
{
7
,
true
},
{
8
,
true
},
{
9
,
true
},
{
10
,
true
},
{
11
,
true
},
{
12
,
true
},
{
13
,
true
},
{
14
,
true
},
{
15
,
true
},
{
16
,
true
},
{
17
,
true
},
{
18
,
true
},
{
19
,
true
},
{
20
,
true
},
{
21
,
true
},
{
22
,
true
},
{
23
,
true
},
{
24
,
true
},
{
25
,
true
},
{
26
,
true
},
{
27
,
true
},
{
28
,
true
},
{
29
,
true
},
{
30
,
true
},
{
31
,
true
},
{
32
,
true
},
{
33
,
true
},
{
34
,
true
},
{
35
,
true
},
{
36
,
true
},
{
37
,
true
},
{
38
,
true
},
{
39
,
true
},
{
40
,
true
},
{
41
,
true
},
{
42
,
true
},
{
43
,
true
},
{
44
,
true
},
{
45
,
false
},
// name=[ NETWORKDAYS.INTL ], result=18, expected=19
{
46
,
true
},
{
47
,
true
},
{
48
,
true
},
{
49
,
true
},
{
50
,
true
},
{
51
,
true
},
{
52
,
true
},
{
53
,
true
},
{
54
,
true
},
{
55
,
true
},
{
56
,
true
},
{
57
,
true
},
{
58
,
true
},
{
59
,
true
},
{
60
,
true
},
{
61
,
true
},
{
62
,
true
},
{
63
,
true
},
{
64
,
true
},
{
65
,
true
},
{
66
,
true
},
{
67
,
true
},
{
68
,
true
},
{
69
,
true
},
{
70
,
true
},
{
71
,
true
},
{
72
,
true
},
{
73
,
true
},
{
74
,
true
},
{
75
,
true
},
{
76
,
true
},
{
77
,
true
},
{
78
,
true
},
{
79
,
false
},
// name=[ WORKDAY.INTL ], result=41755 , expected=41754
{
80
,
true
}
};
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aTests
);
++
i
)
{
if
(
aTests
[
i
].
bEvaluate
)
{
// Column A is description, B is formula, C is Excel result, D is
// comparison.
SCROW
nRow
=
aTests
[
i
].
nRow
-
1
;
// 0-based
OString
aStr
=
OString
::
number
(
aTests
[
i
].
nRow
)
+
", function name=[ "
+
OUStringToOString
(
pDoc
->
GetString
(
ScAddress
(
0
,
nRow
,
0
)),
RTL_TEXTENCODING_UTF8
)
+
" ], result="
+
OString
::
number
(
pDoc
->
GetValue
(
ScAddress
(
1
,
nRow
,
0
))
)
+
", expected="
+
OString
::
number
(
pDoc
->
GetValue
(
ScAddress
(
2
,
nRow
,
0
))
);
ScFormulaCell
*
pFC
=
pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
nRow
,
0
)
);
if
(
pFC
&&
pFC
->
GetErrCode
()
!=
0
)
aStr
+=
", error code ="
+
OString
::
number
(
pFC
->
GetErrCode
()
);
CPPUNIT_ASSERT_MESSAGE
(
OString
(
"Expected a formula cell without error at row "
+
aStr
).
getStr
(),
isFormulaWithoutError
(
*
pDoc
,
ScAddress
(
1
,
nRow
,
0
)));
CPPUNIT_ASSERT_MESSAGE
(
OString
(
"Expected a TRUE value at row "
+
aStr
).
getStr
(),
0
!=
pDoc
->
GetValue
(
ScAddress
(
3
,
nRow
,
0
)));
}
}
xDocSh
->
DoClose
();
xDocSh
->
DoClose
();
}
}
...
...
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