Ignore:
Timestamp:
Feb 18, 2013, 9:31:05 PM (7 years ago)
Author:
sam
Message:

base: add Array::Swap() method and the corresponding unit test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/array.cpp

    r2230 r2435  
    101101    }
    102102
     103    LOLUNIT_TEST(ArraySwap)
     104    {
     105        Array<int, int> a;
     106        a.Push(10, 20);
     107        a.Push(30, 40);
     108        a.Swap(0, 1);
     109
     110        LOLUNIT_ASSERT_EQUAL(30, a[0].m1);
     111        LOLUNIT_ASSERT_EQUAL(40, a[0].m2);
     112        LOLUNIT_ASSERT_EQUAL(10, a[1].m1);
     113        LOLUNIT_ASSERT_EQUAL(20, a[1].m2);
     114    }
     115
    103116    LOLUNIT_TEST(ArrayConcat)
    104117    {
Note: See TracChangeset for help on using the changeset viewer.