summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorslideon <adamkasztenny@gmail.com>2016-06-03 22:03:03 -0400
committerjan iversen <jani@documentfoundation.org>2016-07-05 06:26:32 +0000
commita12955be5bcfab3dda482a562eed66d7b0ffd996 (patch)
tree6d2b1d4c6b918142810f2e8f6b623ff336244fd4 /sw
parentbcbc72fc3371bba6362ecea3d864761a39a809b2 (diff)
Add test for sw_NormalizeRange
The docstring for the function gave some examples, but this method was not fully tested Change-Id: I53bca734183297a9cca860c55b27570ad0e0f3e6 Reviewed-on: https://gerrit.libreoffice.org/25886 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/core/uwriter.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 9d27692c3615..aa830210fab6 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -1659,6 +1659,30 @@ void SwDocTest::testTableCellComparison()
CPPUNIT_ASSERT_EQUAL( +1, sw_CompareCellRanges("A2", "Z2", "A1", "Z1", false) );
CPPUNIT_ASSERT_EQUAL( +1, sw_CompareCellRanges("A2", "Z2", "A1", "Z1", true) );
CPPUNIT_ASSERT_EQUAL( +1, sw_CompareCellRanges("A6", "Z2", "A1", "Z1", true) );
+
+ OUString rCell1 = OUString("A1");
+ OUString rCell2 = OUString("C5");
+
+ sw_NormalizeRange(rCell1, rCell2);
+ CPPUNIT_ASSERT_EQUAL( OUString("A1"), rCell1 );
+ CPPUNIT_ASSERT_EQUAL( OUString("C5"), rCell2 );
+
+ sw_NormalizeRange(rCell2, rCell1);
+ CPPUNIT_ASSERT_EQUAL( OUString("C5"), rCell1 );
+ CPPUNIT_ASSERT_EQUAL( OUString("A1"), rCell2 );
+
+ rCell1 = OUString("A5");
+ rCell2 = OUString("C1");
+
+ sw_NormalizeRange(rCell1, rCell2);
+ CPPUNIT_ASSERT_EQUAL( OUString("A1"), rCell1 );
+ CPPUNIT_ASSERT_EQUAL( OUString("C5"), rCell2 );
+
+ sw_NormalizeRange(rCell2, rCell1);
+ CPPUNIT_ASSERT_EQUAL( OUString("C5"), rCell1 );
+ CPPUNIT_ASSERT_EQUAL( OUString("A1"), rCell2 );
+
+ CPPUNIT_ASSERT_EQUAL( OUString(), sw_GetCellName(-1, -1) );
}
void SwDocTest::setUp()