diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2010-05-26 05:35:02 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2010-05-26 05:35:02 +0000 |
| commit | b1522d279d22725a731cb8db93ec2d077028374c (patch) | |
| tree | 9ad5f2471fdac3a9bbaddaf513ede562d87b8438 /src/unit | |
| parent | 24ab24777d7cd72b7ff35a9d02cb43e26f006b0d (diff) | |
| download | libbu++-b1522d279d22725a731cb8db93ec2d077028374c.tar.gz libbu++-b1522d279d22725a731cb8db93ec2d077028374c.tar.bz2 libbu++-b1522d279d22725a731cb8db93ec2d077028374c.tar.xz libbu++-b1522d279d22725a731cb8db93ec2d077028374c.zip | |
More tweaks and informational functions.
Diffstat (limited to '')
| -rw-r--r-- | src/unit/array.unit | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/unit/array.unit b/src/unit/array.unit index 1493033..f3fdeda 100644 --- a/src/unit/array.unit +++ b/src/unit/array.unit | |||
| @@ -9,6 +9,9 @@ | |||
| 9 | #include "bu/hash.h" | 9 | #include "bu/hash.h" |
| 10 | #include "bu/array.h" | 10 | #include "bu/array.h" |
| 11 | 11 | ||
| 12 | #include "bu/sio.h" | ||
| 13 | using Bu::sio; | ||
| 14 | |||
| 12 | suite Array | 15 | suite Array |
| 13 | { | 16 | { |
| 14 | test general | 17 | test general |
| @@ -82,4 +85,20 @@ suite Array | |||
| 82 | unitTest( a3[1].get("Test") == "Bloop" ); | 85 | unitTest( a3[1].get("Test") == "Bloop" ); |
| 83 | unitTest( a3[1].get("Foo") == "ooF" ); | 86 | unitTest( a3[1].get("Foo") == "ooF" ); |
| 84 | } | 87 | } |
| 88 | |||
| 89 | test insert | ||
| 90 | { | ||
| 91 | Bu::Array<int> aInts; | ||
| 92 | aInts.insert( aInts.end(), 4 ); | ||
| 93 | aInts.insert( aInts.begin(), 1 ); | ||
| 94 | aInts.insert( aInts.end(), 5 ); | ||
| 95 | aInts.insert( aInts.begin()+1, 3 ); | ||
| 96 | aInts.insert( aInts.begin()+1, 2 ); | ||
| 97 | aInts.insert( aInts.begin(), 0 ); | ||
| 98 | |||
| 99 | for( int j = 0; j < 6; j++ ) | ||
| 100 | { | ||
| 101 | unitTest( aInts[j] == j ); | ||
| 102 | } | ||
| 103 | } | ||
| 85 | } | 104 | } |
