diff options
author | Mike Buland <eichlan@xagasoft.com> | 2008-09-24 19:31:37 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2008-09-24 19:31:37 +0000 |
commit | 1ca201c4151ce6e4ac4921c641fec7d21d64752c (patch) | |
tree | c8e6a63ec39a979fa8706284b43efd5b2d69e17f /src/unit | |
parent | dea750e9470f1be61f8afd3eb0ee45a57ed4976a (diff) | |
download | libbu++-1ca201c4151ce6e4ac4921c641fec7d21d64752c.tar.gz libbu++-1ca201c4151ce6e4ac4921c641fec7d21d64752c.tar.bz2 libbu++-1ca201c4151ce6e4ac4921c641fec7d21d64752c.tar.xz libbu++-1ca201c4151ce6e4ac4921c641fec7d21d64752c.zip |
Something may be wrong.
Diffstat (limited to '')
-rw-r--r-- | src/unit/array.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/unit/array.cpp b/src/unit/array.cpp index db29882..57d6c03 100644 --- a/src/unit/array.cpp +++ b/src/unit/array.cpp | |||
@@ -15,7 +15,8 @@ public: | |||
15 | { | 15 | { |
16 | setName("Array"); | 16 | setName("Array"); |
17 | addTest( Unit::general ); | 17 | addTest( Unit::general ); |
18 | addTest( Unit::iterate ); | 18 | addTest( Unit::iterate1 ); |
19 | addTest( Unit::iterate2 ); | ||
19 | } | 20 | } |
20 | 21 | ||
21 | virtual ~Unit() | 22 | virtual ~Unit() |
@@ -34,7 +35,7 @@ public: | |||
34 | unitTest( ai[1] == 10 ); | 35 | unitTest( ai[1] == 10 ); |
35 | } | 36 | } |
36 | 37 | ||
37 | void iterate() | 38 | void iterate1() |
38 | { | 39 | { |
39 | Bu::Array<int> ai; | 40 | Bu::Array<int> ai; |
40 | for( int j = 0; j < 10; j++ ) | 41 | for( int j = 0; j < 10; j++ ) |
@@ -49,7 +50,13 @@ public: | |||
49 | for( Bu::Array<int>::const_iterator i = ci.begin(); i != ci.end(); i++ ) | 50 | for( Bu::Array<int>::const_iterator i = ci.begin(); i != ci.end(); i++ ) |
50 | unitTest( (*i) == j++ ); | 51 | unitTest( (*i) == j++ ); |
51 | } | 52 | } |
52 | 53 | ||
54 | void iterate2() | ||
55 | { | ||
56 | Bu::Array<int> ai; | ||
57 | for( Bu::Array<int>::iterator i = ai.begin(); i != ai.end(); i++ ) | ||
58 | unitFailed("Empty lists shouldn't be iterated through."); | ||
59 | } | ||
53 | }; | 60 | }; |
54 | 61 | ||
55 | int main( int argc, char *argv[] ) | 62 | int main( int argc, char *argv[] ) |