// 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;
 }
  // Launch unit test.
  EUnitTestResult test()
  { CALL
    CArray<Tsint> a;
    CArray<Tsint> b;
    UT_ASSERT_ZERO(a.getSize());
    UT_ASSERT_ZERO(b.getSize());

    // Fill the first array.
    UT_ASSERT_CHECK_FILL(a, true);
    UT_ASSERT_EQUAL(a.getSize(), 6);
    // Fill the second array.
    UT_ASSERT_CHECK_FILL(b, false);
    UT_ASSERT_EQUAL(b.getSize(), 6);

    // Show the first array.
    UT_ASSERT_CHECK_SHOW(a, true);
    // Show the second array.
    UT_ASSERT_CHECK_SHOW(b, false);

    // Copy arrays.
    CArray<Tsint> c(a);
    CArray<Tsint> d(b);
    UT_ASSERT_EQUAL(c.getSize(), 6);
    UT_ASSERT_EQUAL(d.getSize(), 6);

    // Reverse arrays.
    c.reverse();
    d.reverse();

    // Show the first reversed array.
    UT_ASSERT_CHECK_SHOW_REVERSED(c, true);
    // Show the last reversed array.
    UT_ASSERT_CHECK_SHOW_REVERSED(d, false);

    // Remove items from the first array.
    UT_ASSERT_CHECK_REMOVE(a, true);
    UT_ASSERT_ZERO(a.getSize());
    // Remove items from the second array.
    UT_ASSERT_CHECK_REMOVE(b, false);
    UT_ASSERT_ZERO(b.getSize());

    // Clear the first reversed array.
    UT_ASSERT(c.clear());
    UT_ASSERT_ZERO(c.getSize());
    // Clear the second reversed array.
    UT_ASSERT(d.clear());
    UT_ASSERT_ZERO(d.getSize());

    // Check serialization functionality.
    UT_ASSERT_CHECK_SERIALIZATION();

    UT_ACCEPT;
  }