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
This commit is contained in:
parent
5824c22abf
commit
1e61e18169
1 changed files with 7 additions and 4 deletions
|
@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue