summaryrefslogtreecommitdiff
path: root/src/unit/array.unit
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-04-02 15:00:14 +0000
committerMike Buland <eichlan@xagasoft.com>2009-04-02 15:00:14 +0000
commitaaeaa599a14642e916bbd8a32a208ee96a26eaac (patch)
treedd96f81051b43e398059c9463cfd1997e08d217a /src/unit/array.unit
parente9e5da32b2e154698482b7ec6b7ab2098cd849c8 (diff)
downloadlibbu++-aaeaa599a14642e916bbd8a32a208ee96a26eaac.tar.gz
libbu++-aaeaa599a14642e916bbd8a32a208ee96a26eaac.tar.bz2
libbu++-aaeaa599a14642e916bbd8a32a208ee96a26eaac.tar.xz
libbu++-aaeaa599a14642e916bbd8a32a208ee96a26eaac.zip
Array iterators' validity testing was actually reversed. That was a serious
problem. Also, arrays now have a formatter.
Diffstat (limited to 'src/unit/array.unit')
-rw-r--r--src/unit/array.unit2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/unit/array.unit b/src/unit/array.unit
index d5fc573..3a777d3 100644
--- a/src/unit/array.unit
+++ b/src/unit/array.unit
@@ -32,11 +32,13 @@
32 int j = 0; 32 int j = 0;
33 for( Bu::Array<int>::iterator i = ai.begin(); i != ai.end(); i++ ) 33 for( Bu::Array<int>::iterator i = ai.begin(); i != ai.end(); i++ )
34 unitTest( (*i) == j++ ); 34 unitTest( (*i) == j++ );
35 unitTest( j == 10 );
35 36
36 const Bu::Array<int> &ci = ai; 37 const Bu::Array<int> &ci = ai;
37 j = 0; 38 j = 0;
38 for( Bu::Array<int>::const_iterator i = ci.begin(); i != ci.end(); i++ ) 39 for( Bu::Array<int>::const_iterator i = ci.begin(); i != ci.end(); i++ )
39 unitTest( (*i) == j++ ); 40 unitTest( (*i) == j++ );
41 unitTest( j == 10 );
40} 42}
41 43
42{%iterate2} 44{%iterate2}