// Check the remove functionality of the CArray<Tsint>. void UT_ASSERT_CHECK_REMOVE(CArray<Tsint>& a_rArray, Tbool a_cDirectOrder, const Tbool a_cReversed = false) { CALL Tsint value = (a_cDirectOrder || a_cReversed) ? 1 : 6; CArray<Tsint>::TIterator it = (a_cDirectOrder ? a_rArray.getItFirst() : a_rArray.getItLast()); while (it.isValid()) { UT_ASSERT_EQUAL(*it, value); (a_cDirectOrder || a_cReversed) ? ++value : --value; UT_ASSERT(a_cDirectOrder ? it.removeForward() : it.removeBackward()); } UT_ASSERT_EQUAL(value, ((a_cDirectOrder || a_cReversed) ? 7 : 0)); }
// Check the remove functionality of the CArray<Tbool>. void UT_ASSERT_CHECK_REMOVE(CArray<Tbool>& a_rArray, Tbool a_cDirectOrder, const Tbool a_cReversed = false) { CALL Tbool value = (a_cDirectOrder || a_cReversed) ? true : false; CArray<Tbool>::TIterator it = (a_cDirectOrder ? a_rArray.getItFirst() : a_rArray.getItLast()); while (it.isValid()) { UT_ASSERT_EQUAL(*it, value); value = !value; UT_ASSERT(a_cDirectOrder ? it.removeForward() : it.removeBackward()); } UT_ASSERT((a_cDirectOrder || a_cReversed) ? (value == true) : (value == false)); }
// Remove all items from the instance of the CArray<Tbool> class. static void remove(IWriter& writer, CArray<Tbool>& a_rArray, const Tbool a_cDirectOrder) { CALL writer << STR("CArray<Tbool>(") << STR("size = ") << a_rArray.getSize() << STR(")") << ln; CArray<Tbool>::TIterator it = (a_cDirectOrder ? a_rArray.getItFirst() : a_rArray.getItLast()); writer << STR("{") << ln; while (it.isValid()) { writer << STR(" removed item = ") << *it << ln; a_cDirectOrder ? it.removeForward() : it.removeBackward(); } writer << STR("}") << ln; }
// Check the show reversed functionality of the CArray<Tsint>. void UT_ASSERT_CHECK_SHOW_REVERSED(const CArray<Tsint>& a_crArray, const Tbool a_cDirectOrder) { CALL Tsint value = (a_cDirectOrder ? 6 : 1); CArray<Tsint>::TIteratorConst it = (a_cDirectOrder ? a_crArray.getItFirst() : a_crArray.getItLast()); if (it.isValid()) { do { UT_ASSERT_EQUAL(*it, value); (a_cDirectOrder) ? --value : ++value; } while ((a_cDirectOrder ? it.stepForward() : it.stepBackward()) == 1); } UT_ASSERT_EQUAL(value, (a_cDirectOrder ? 0 : 7)); }
// Check the show reversed functionality of the CArray<Tbool>. void UT_ASSERT_CHECK_SHOW_REVERSED(const CArray<Tbool>& a_crArray, const Tbool a_cDirectOrder) { CALL Tbool value = (a_cDirectOrder ? false : true); CArray<Tbool>::TIteratorConst it = (a_cDirectOrder ? a_crArray.getItFirst() : a_crArray.getItLast()); if (it.isValid()) { do { UT_ASSERT_EQUAL(*it, value); value = !value; } while ((a_cDirectOrder ? it.stepForward() : it.stepBackward()) == 1); } UT_ASSERT((a_cDirectOrder) ? !value : value); }