[Libreoffice-commits] core.git: 2 commits - qadevOOo/tests sw/qa
Bjoern Michaelsen
bjoern.michaelsen at canonical.com
Tue Apr 14 05:23:06 PDT 2015
qadevOOo/tests/java/ifc/chart/_XChartDataArray.java | 17 ++++++++++++-----
sw/qa/python/check_table.py | 20 ++++++++++----------
2 files changed, 22 insertions(+), 15 deletions(-)
New commits:
commit 4c28e293fcc4a7ea4fecf5498b347d24c2d091b1
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date: Tue Apr 14 02:33:21 2015 +0200
also test get/setData for labelless tables
Change-Id: I61f7eaaad92b2a7b543fbb8f16f5b695700e8073
diff --git a/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java b/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java
index 21af50f..2cfaedb 100644
--- a/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java
+++ b/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java
@@ -136,9 +136,12 @@ public class _XChartDataArray extends MultiMethodTest {
bResult = true;
double[][] _data = oObj.getData();
data = _data;
-
- for (int i = 0; i < rowDscs.length; i++) {
- for (int j = 0; j < colDscs.length; j++)
+ if(rowDscs.length != 0 && rowDscs.length != data.length)
+ bResult = false;
+ if(colDscs.length != 0 && colDscs.length != data[0].length)
+ bResult = false;
+ for (int i = 0; i < data.length; i++) {
+ for (int j = 0; j < data[i].length; j++)
data[i][j] = i * (j + 1);
}
oObj.setData(data);
@@ -211,8 +214,12 @@ public class _XChartDataArray extends MultiMethodTest {
double[][] _data = oObj.getData();
data = _data;
- for (int i = 0; i < rowDscs.length; i++) {
- for (int j = 0; j < colDscs.length; j++) {
+ if(rowDscs.length != 0 && rowDscs.length != data.length)
+ bResult = false;
+ if(colDscs.length != 0 && colDscs.length != data[0].length)
+ bResult = false;
+ for (int i = 0; i < data.length; i++) {
+ for (int j = 0; j < data[i].length; j++) {
bResult &= data[i][j] == _data[i][j];
}
}
commit 9d130fd1f3ce7c1efb72dd9933a9a41b2cb1407f
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date: Tue Apr 14 01:49:34 2015 +0200
have a nonsymetric test table to better catch transpose errors
Change-Id: If36ec5ed78a3e0b7a9037eaa1903772f1d228bce
diff --git a/sw/qa/python/check_table.py b/sw/qa/python/check_table.py
index ab3adde..95db0b4 100644
--- a/sw/qa/python/check_table.py
+++ b/sw/qa/python/check_table.py
@@ -314,34 +314,34 @@ class CheckTable(unittest.TestCase):
xDoc = CheckTable._uno.openEmptyWriterDoc()
# insert table
xTable = xDoc.createInstance("com.sun.star.text.TextTable")
- xTable.initialize(3, 3)
+ xTable.initialize(4, 3)
xCursor = xDoc.Text.createTextCursor()
xDoc.Text.insertTextContent(xCursor, xTable, False)
xTable.ChartColumnAsLabel = False
xTable.ChartRowAsLabel = False
# roundtrip
- xTable.Data = ((1,2,3), (4,5,6), (7,8,9))
- self.assertEqual( xTable.Data, ((1,2,3), (4,5,6), (7,8,9)))
+ xTable.Data = ((1,2,3), (4,5,6), (7,8,9), (10,11,12))
+ self.assertEqual( xTable.Data, ((1,2,3), (4,5,6), (7,8,9), (10,11,12)))
# missing row
with self.assertRaises(Exception):
- xTable.Data = ((1,2,3), (4,5,6))
+ xTable.Data = ((1,2,3), (4,5,6), (7,8,9))
# missing column
with self.assertRaises(Exception):
- xTable.Data = ((1,2), (4,5), (7,8))
+ xTable.Data = ((1,2), (4,5), (7,8), (10,11))
# with labels
xTable.ChartColumnAsLabel = True
xTable.ChartRowAsLabel = True
- self.assertEqual( xTable.Data, ((5,6), (8,9)))
- xTable.Data = ((55,66), (88,99))
+ self.assertEqual( xTable.Data, ((5,6), (8,9), (11,12)))
+ xTable.Data = ((55,66), (88,99), (1111,1212))
xTable.ChartColumnAsLabel = True
xTable.ChartRowAsLabel = False
- self.assertEqual( xTable.Data, ((2,3), (55,66), (88,99)))
+ self.assertEqual( xTable.Data, ((2,3), (55,66), (88,99), (1111,1212)))
xTable.ChartColumnAsLabel = False
xTable.ChartRowAsLabel = True
- self.assertEqual( xTable.Data, ((4,55,66), (7,88,99)))
+ self.assertEqual( xTable.Data, ((4,55,66), (7,88,99), (10,1111,1212)))
xTable.ChartColumnAsLabel = False
xTable.ChartRowAsLabel = False
- self.assertEqual( xTable.Data, ((1,2,3), (4,55,66), (7,88,99)))
+ self.assertEqual( xTable.Data, ((1,2,3), (4,55,66), (7,88,99), (10,1111,1212)))
xDoc.dispose()
if __name__ == '__main__':
More information about the Libreoffice-commits
mailing list