Lines Matching refs:bparr

83     void dumpBigPtrArray(const BigPtrArray& bparr)  in dumpBigPtrArray()  argument
86 for (int i = 0; i < bparr.Count(); i++) in dumpBigPtrArray()
87 …i,%i]: %i\n", i, static_cast<BigPtrEntryMock*>(bparr[i])->Position(), static_cast<BigPtrEntryMock*… in dumpBigPtrArray()
93 void fillBigPtrArray(BigPtrArray& bparr, sal_uLong numEntries) in fillBigPtrArray() argument
96 bparr.Insert(new BigPtrEntryMock(i), bparr.Count()); in fillBigPtrArray()
106 bool checkElementPositions(const BigPtrArray& bparr) in checkElementPositions() argument
108 for (int i = 0; i < bparr.Count(); i++) in checkElementPositions()
110 if (static_cast<BigPtrEntryMock*>(bparr[i])->Position() != i) in checkElementPositions()
116 void releaseBigPtrArrayContent(BigPtrArray& bparr) in releaseBigPtrArrayContent() argument
118 for (int i = 0; i < bparr.Count(); i++) in releaseBigPtrArrayContent()
119 delete bparr[i]; in releaseBigPtrArrayContent()
142 BigPtrArray bparr; in test_ctor() local
147 bparr.Count() == 0 in test_ctor()
157 BigPtrArray bparr; in test_insert_entries_at_front() local
161 sal_uLong oldCount = bparr.Count(); in test_insert_entries_at_front()
162 bparr.Insert(new BigPtrEntryMock(i), 0); in test_insert_entries_at_front()
166 (bparr.Count() == oldCount + 1) in test_insert_entries_at_front()
177 static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == j in test_insert_entries_at_front()
184 checkElementPositions(bparr) in test_insert_entries_at_front()
187 releaseBigPtrArrayContent(bparr); in test_insert_entries_at_front()
188 dumpBigPtrArray(bparr); in test_insert_entries_at_front()
197 BigPtrArray bparr; in test_insert_entries_in_the_middle() local
199 fillBigPtrArray(bparr, NUM_ENTRIES); in test_insert_entries_in_the_middle()
200 dumpBigPtrArray(bparr); in test_insert_entries_in_the_middle()
202 sal_uLong oldCount = bparr.Count(); in test_insert_entries_in_the_middle()
204 bparr.Insert(new BigPtrEntryMock(NUM_ENTRIES), bparr.Count() / 2); in test_insert_entries_in_the_middle()
211 …(oldCount + 1 == bparr.Count() && static_cast<BigPtrEntryMock*>(bparr[bparr.Count() / 2])->getCoun… in test_insert_entries_in_the_middle()
217 checkElementPositions(bparr) in test_insert_entries_in_the_middle()
220 releaseBigPtrArrayContent(bparr); in test_insert_entries_in_the_middle()
221 dumpBigPtrArray(bparr); in test_insert_entries_in_the_middle()
230 BigPtrArray bparr; in test_insert_at_already_used_index() local
232 fillBigPtrArray(bparr, NUM_ENTRIES); in test_insert_at_already_used_index()
233 dumpBigPtrArray(bparr); in test_insert_at_already_used_index()
235 int oldCount = bparr.Count(); in test_insert_at_already_used_index()
238 bparr.Insert(new BigPtrEntryMock(j), i); in test_insert_at_already_used_index()
245 (oldCount + 5 == bparr.Count()) in test_insert_at_already_used_index()
248 for (int i = 0, j = -5; i < bparr.Count(); i++, j++) in test_insert_at_already_used_index()
253 static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == j in test_insert_at_already_used_index()
260 checkElementPositions(bparr) in test_insert_at_already_used_index()
263 releaseBigPtrArrayContent(bparr); in test_insert_at_already_used_index()
264 dumpBigPtrArray(bparr); in test_insert_at_already_used_index()
271 BigPtrArray bparr; in test_insert_at_end() local
273 fillBigPtrArray(bparr, NUM_ENTRIES); in test_insert_at_end()
274 dumpBigPtrArray(bparr); in test_insert_at_end()
276 sal_uLong oldCount = bparr.Count(); in test_insert_at_end()
277 bparr.Insert(new BigPtrEntryMock(NUM_ENTRIES), bparr.Count()); in test_insert_at_end()
282 …(oldCount + 1 == bparr.Count() && static_cast<BigPtrEntryMock*>(bparr[bparr.Count()-1])->getCount(… in test_insert_at_end()
288 checkElementPositions(bparr) in test_insert_at_end()
291 releaseBigPtrArrayContent(bparr); in test_insert_at_end()
292 dumpBigPtrArray(bparr); in test_insert_at_end()
301 BigPtrArray bparr; in test_remove_at_front() local
303 fillBigPtrArray(bparr, NUM_ENTRIES); in test_remove_at_front()
304 dumpBigPtrArray(bparr); in test_remove_at_front()
308 sal_uLong oldCount = bparr.Count(); in test_remove_at_front()
310 delete bparr[0]; // release content in test_remove_at_front()
311 bparr.Remove(0); // remove item from container in test_remove_at_front()
316 (oldCount - 1 == bparr.Count()) in test_remove_at_front()
319 for (int j = 0, k = i + 1; j < bparr.Count(); j++, k++) in test_remove_at_front()
324 static_cast<BigPtrEntryMock*>(bparr[j])->getCount() == k in test_remove_at_front()
331 checkElementPositions(bparr) in test_remove_at_front()
334 dumpBigPtrArray(bparr); in test_remove_at_front()
344 BigPtrArray bparr; in test_remove_at_back() local
346 fillBigPtrArray(bparr, NUM_ENTRIES); in test_remove_at_back()
347 dumpBigPtrArray(bparr); in test_remove_at_back()
351 sal_uLong oldCount = bparr.Count(); in test_remove_at_back()
352 delete bparr[i]; in test_remove_at_back()
353 bparr.Remove(i); in test_remove_at_back()
358 (oldCount - 1 == bparr.Count()) in test_remove_at_back()
361 for (int j = 0; j < bparr.Count(); j++) in test_remove_at_back()
366 static_cast<BigPtrEntryMock*>(bparr[j])->getCount() == j in test_remove_at_back()
373 checkElementPositions(bparr) in test_remove_at_back()
376 dumpBigPtrArray(bparr); in test_remove_at_back()
386 BigPtrArray bparr; in test_remove_in_the_middle() local
388 fillBigPtrArray(bparr, NUM_ENTRIES); in test_remove_in_the_middle()
389 dumpBigPtrArray(bparr); in test_remove_in_the_middle()
391 while (bparr.Count()) in test_remove_in_the_middle()
393 sal_uLong oldCount = bparr.Count(); in test_remove_in_the_middle()
394 int oldElement = static_cast<BigPtrEntryMock*>(bparr[bparr.Count() / 2])->getCount(); in test_remove_in_the_middle()
396 delete bparr[bparr.Count() / 2]; in test_remove_in_the_middle()
397 bparr.Remove(bparr.Count() / 2); in test_remove_in_the_middle()
402 (oldCount - 1 == bparr.Count()) in test_remove_in_the_middle()
405 for (int i = 0; i < bparr.Count(); i++) in test_remove_in_the_middle()
410 static_cast<BigPtrEntryMock*>(bparr[i])->getCount() != oldElement in test_remove_in_the_middle()
417 checkElementPositions(bparr) in test_remove_in_the_middle()
420 dumpBigPtrArray(bparr); in test_remove_in_the_middle()
429 BigPtrArray bparr; in test_remove_multiple_elements_at_once() local
431 fillBigPtrArray(bparr, NUM_ENTRIES); in test_remove_multiple_elements_at_once()
432 dumpBigPtrArray(bparr); in test_remove_multiple_elements_at_once()
434 while(bparr.Count()) in test_remove_multiple_elements_at_once()
436 sal_uLong nRemove = (bparr.Count() > 3) ? 3 : bparr.Count(); in test_remove_multiple_elements_at_once()
437 sal_uLong oldCount = bparr.Count(); in test_remove_multiple_elements_at_once()
440 delete bparr[i]; in test_remove_multiple_elements_at_once()
442 bparr.Remove(0, nRemove); in test_remove_multiple_elements_at_once()
447 (oldCount - nRemove == bparr.Count()) in test_remove_multiple_elements_at_once()
453 checkElementPositions(bparr) in test_remove_multiple_elements_at_once()
456 dumpBigPtrArray(bparr); in test_remove_multiple_elements_at_once()
464 BigPtrArray bparr; in test_remove_all_elements_at_once() local
466 fillBigPtrArray(bparr, NUM_ENTRIES); in test_remove_all_elements_at_once()
467 dumpBigPtrArray(bparr); in test_remove_all_elements_at_once()
469 releaseBigPtrArrayContent(bparr); in test_remove_all_elements_at_once()
470 bparr.Remove(0, bparr.Count()); in test_remove_all_elements_at_once()
475 bparr.Count() == 0 in test_remove_all_elements_at_once()
478 dumpBigPtrArray(bparr); in test_remove_all_elements_at_once()
485 BigPtrArray bparr; in test_move_elements_from_lower_to_higher_pos() local
487 fillBigPtrArray(bparr, NUM_ENTRIES); in test_move_elements_from_lower_to_higher_pos()
488 dumpBigPtrArray(bparr); in test_move_elements_from_lower_to_higher_pos()
492 bparr.Move(i, i + 2); in test_move_elements_from_lower_to_higher_pos()
493 dumpBigPtrArray(bparr); in test_move_elements_from_lower_to_higher_pos()
501 static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == (i + 1) in test_move_elements_from_lower_to_higher_pos()
508 static_cast<BigPtrEntryMock*>(bparr[NUM_ENTRIES -1])->getCount() == 0 in test_move_elements_from_lower_to_higher_pos()
514 checkElementPositions(bparr) in test_move_elements_from_lower_to_higher_pos()
517 releaseBigPtrArrayContent(bparr); in test_move_elements_from_lower_to_higher_pos()
524 BigPtrArray bparr; in test_move_elements_from_higher_to_lower_pos() local
526 fillBigPtrArray(bparr, NUM_ENTRIES); in test_move_elements_from_higher_to_lower_pos()
527 dumpBigPtrArray(bparr); in test_move_elements_from_higher_to_lower_pos()
531 bparr.Move(i, i - 1); in test_move_elements_from_higher_to_lower_pos()
532 dumpBigPtrArray(bparr); in test_move_elements_from_higher_to_lower_pos()
538 static_cast<BigPtrEntryMock*>(bparr[0])->getCount() == (NUM_ENTRIES - 1) in test_move_elements_from_higher_to_lower_pos()
546 static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == (i - 1) in test_move_elements_from_higher_to_lower_pos()
553 checkElementPositions(bparr) in test_move_elements_from_higher_to_lower_pos()
556 releaseBigPtrArrayContent(bparr); in test_move_elements_from_higher_to_lower_pos()
563 BigPtrArray bparr; in test_move_to_same_position() local
565 fillBigPtrArray(bparr, NUM_ENTRIES); in test_move_to_same_position()
566 dumpBigPtrArray(bparr); in test_move_to_same_position()
570 bparr.Move(i, i); in test_move_to_same_position()
573 dumpBigPtrArray(bparr); in test_move_to_same_position()
580 static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == i in test_move_to_same_position()
587 checkElementPositions(bparr) in test_move_to_same_position()
590 releaseBigPtrArrayContent(bparr); in test_move_to_same_position()
591 dumpBigPtrArray(bparr); in test_move_to_same_position()
598 BigPtrArray bparr; in test_replace_elements() local
600 fillBigPtrArray(bparr, NUM_ENTRIES); in test_replace_elements()
601 dumpBigPtrArray(bparr); in test_replace_elements()
605 delete bparr[i]; in test_replace_elements()
606 bparr.Replace(i, new BigPtrEntryMock(j)); in test_replace_elements()
607 dumpBigPtrArray(bparr); in test_replace_elements()
615 static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == (NUM_ENTRIES - i - 1) in test_replace_elements()
622 checkElementPositions(bparr) in test_replace_elements()
625 releaseBigPtrArrayContent(bparr); in test_replace_elements()
632 BigPtrArray bparr; in test_for_each() local
634 fillBigPtrArray(bparr, NUM_ENTRIES); in test_for_each()
635 dumpBigPtrArray(bparr); in test_for_each()
638 bparr.ForEach(AddToCount, &addCount); in test_for_each()
645 static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == (i+1) in test_for_each()
649 releaseBigPtrArrayContent(bparr); in test_for_each()
650 dumpBigPtrArray(bparr); in test_for_each()
657 BigPtrArray bparr; in test_for_some1() local
659 fillBigPtrArray(bparr, NUM_ENTRIES); in test_for_some1()
660 dumpBigPtrArray(bparr); in test_for_some1()
663 bparr.ForEach(0, NUM_ENTRIES / 2, AddToCount, &addCount); in test_for_some1()
671 static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == (i+1) in test_for_some1()
680 static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == (i) in test_for_some1()
684 releaseBigPtrArrayContent(bparr); in test_for_some1()
685 dumpBigPtrArray(bparr); in test_for_some1()
692 BigPtrArray bparr; in test_for_some2() local
694 fillBigPtrArray(bparr, NUM_ENTRIES); in test_for_some2()
695 dumpBigPtrArray(bparr); in test_for_some2()
698 bparr.ForEach(NUM_ENTRIES / 2, NUM_ENTRIES, AddToCount, &addCount); in test_for_some2()
706 static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == (i) in test_for_some2()
715 static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == (i+1) in test_for_some2()
719 releaseBigPtrArrayContent(bparr); in test_for_some2()
720 dumpBigPtrArray(bparr); in test_for_some2()
727 BigPtrArray bparr; in test_for_some3() local
729 fillBigPtrArray(bparr, NUM_ENTRIES); in test_for_some3()
730 dumpBigPtrArray(bparr); in test_for_some3()
733 bparr.ForEach(0, 0, AddToCount, &addCount); in test_for_some3()
740 static_cast<BigPtrEntryMock*>(bparr[i])->getCount() == i in test_for_some3()
743 releaseBigPtrArrayContent(bparr); in test_for_some3()
844 BigPtrArray bparr; in test_insert_at_end() local
846 bparr.Insert(new BigPtrEntryMock(i), bparr.Count()); in test_insert_at_end()
848 releaseBigPtrArrayContent(bparr); in test_insert_at_end()
858 BigPtrArray bparr; in test_insert_at_front() local
860 bparr.Insert(new BigPtrEntryMock(i), 0); in test_insert_at_front()
862 releaseBigPtrArrayContent(bparr); in test_insert_at_front()