summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-21 12:12:51 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-21 17:05:02 +0200
commitf240f073d228e62afd3f60563c23626efad0df7f (patch)
tree901cefc01ce33d540e035c02e4f8c839402a70e0 /sw/qa
parentd0ebd056868e96469ca1356a0a2f37c433456f75 (diff)
Related: tdf#102308 sw: ignore seconds when combining redlines
The purpose of storing seconds was to get a better timestamp, not to make combining impossible. Also fix two issues with the existing testcase: - read both timestamps, so test doesn't fail if the second is 0 in the first redline - don't fail if minute changes while waiting for a second Change-Id: Ib6c8ecdcf2f0da9191f0b48e6aaefc0b2449583e
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 4e5f9ccc835e..54755d373d0a 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -3960,11 +3960,20 @@ void SwUiWriterTest::testRedlineTimestamp()
pWrtShell->EndDoc();
pWrtShell->Insert("zzz");
+ // Inserting additional characters at the start changed the table size to
+ // 3, i.e. the first and the second "aaa" wasn't combined.
+ pWrtShell->SttDoc();
+ pWrtShell->Insert("aaa");
+
// Now assert that at least one of the the seconds are not 0.
const SwRedlineTable& rTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable();
+ if (rTable.size() >= 2 && rTable[0]->GetRedlineData().GetTimeStamp().GetMin() != rTable[1]->GetRedlineData().GetTimeStamp().GetMin())
+ // The relatively rare case when waiting for a second also changes the minute.
+ return;
+
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rTable.size());
sal_uInt16 nSec1 = rTable[0]->GetRedlineData().GetTimeStamp().GetSec();
- sal_uInt16 nSec2 = rTable[0]->GetRedlineData().GetTimeStamp().GetSec();
+ sal_uInt16 nSec2 = rTable[1]->GetRedlineData().GetTimeStamp().GetSec();
// This failed, seconds was always 0.
CPPUNIT_ASSERT(nSec1 != 0 || nSec2 != 0);
}