summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2014-08-12 19:56:35 +0200
committerThomas Arnhold <thomas@arnhold.org>2014-08-13 10:10:51 +0200
commit1e61e181694b602ea7308533f6d5dc3c6c4292b8 (patch)
tree226608e52af45e946119ab1451401ccf8bd5fa3e
parent5824c22abf7abc341b669b4e42dddf0d6f4a36ba (diff)
warning C4245: 'initializing' : conversion from 'int' to 'sal_uLong'...
...signed/unsigned mismatch In history this was sal_Long and then converted to sal_uLong, but the test never got aligned. Fix it by adding arbitrary element counts starting from 30. old: getCount(): {-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9} (With -5 silently converted to SAL_MAX_UINT32 - 5) new: getCount(): {30,31,32,33,34,0,1,2,3,4,5,6,7,8,9} Change-Id: Ic13678094c7bb4dcd122727f028c910513609cef
-rw-r--r--sw/qa/core/Test-BigPtrArray.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/sw/qa/core/Test-BigPtrArray.cxx b/sw/qa/core/Test-BigPtrArray.cxx
index bc1d824c9b40..54ae06c4ed0f 100644
--- a/sw/qa/core/Test-BigPtrArray.cxx
+++ b/sw/qa/core/Test-BigPtrArray.cxx
@@ -196,9 +196,10 @@ public:
fillBigPtrArray(bparr, NUM_ENTRIES);
dumpBigPtrArray(bparr);
- sal_uLong oldCount = bparr.Count();
+ const sal_uLong oldCount = bparr.Count();
- for (sal_uLong i = 0, j = -5; i < 5; i++, j++)
+ // insert 5 elements
+ for (sal_uLong i = 0, j = 30; i < 5; i++, j++)
bparr.Insert(new BigPtrEntryMock(j), i);
CPPUNIT_ASSERT_MESSAGE
@@ -207,12 +208,14 @@ public:
(oldCount + 5 == bparr.Count())
);
- for (sal_uLong i = 0, j = -5; i < bparr.Count(); i++, j++)
+ // now, first 5 elements have counts: 30,31,..34
+ // next 10 elements have counts: 0,1,..9
+ for (sal_uLong i = 0, j = 30; i < bparr.Count(); i++, j++)
{
CPPUNIT_ASSERT_MESSAGE
(
"test_insert_at_already_used_index failed",
- static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == j
+ static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == (i < 5 ? j : i - 5)
);
}