From ec05778d5718a7912e506764d443a78d6a6179e3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 5 Nov 2012 22:41:51 +0000 Subject: Converted tabs to spaces with tabconv. --- src/unit/list.unit | 264 ++++++++++++++++++++++++++--------------------------- 1 file changed, 132 insertions(+), 132 deletions(-) (limited to 'src/unit/list.unit') diff --git a/src/unit/list.unit b/src/unit/list.unit index ec92fd5..0b60e43 100644 --- a/src/unit/list.unit +++ b/src/unit/list.unit @@ -13,136 +13,136 @@ typedef Bu::List IntList; suite List { - test append - { - IntList lst; - for( int j = 0; j < 50; j++ ) - { - lst.append( j ); - } - int j = 0; - for( IntList::iterator i = lst.begin(); i; i++, j++ ) - { - unitTest( *i == j ); - } - } - - test prepend - { - IntList lst; - for( int j = 0; j < 50; j++ ) - { - lst.prepend( j ); - } - int j = 49; - for( IntList::iterator i = lst.begin(); i; i++, j-- ) - { - unitTest( *i == j ); - } - } - - test copy - { - IntList lst; - int j; - for( j = 0; j < 50; j++ ) - { - lst.append( j ); - } - IntList lst2 = lst; - - j = 0; - for( IntList::iterator i = lst2.begin(); i; i++, j++ ) - { - unitTest( *i == j ); - } - lst2.clear(); - lst2 = lst; - - j = 0; - for( IntList::iterator i = lst2.begin(); i; i++, j++ ) - { - unitTest( *i == j ); - } - } - - test sort1 - { - IntList lst; - - lst.insertSorted( 5 ); - lst.insertSorted( 1 ); - lst.insertSorted( 10 ); - lst.insertSorted( 3 ); - - unitTest( lst == IntList(1).append(3).append(5).append(10) ); - } - - test sort2 - { - IntList lst; - - lst.insertSorted >( 5 ); - lst.insertSorted >( 1 ); - lst.insertSorted >( 10 ); - lst.insertSorted >( 3 ); - - unitTest( lst == IntList(10).append(5).append(3).append(1) ); - } - - test sort3 - { - IntList lst; - Bu::__basicGTCmp cmp; - - lst.insertSorted( cmp, 5 ); - lst.insertSorted( cmp, 1 ); - lst.insertSorted( cmp, 10 ); - lst.insertSorted( cmp, 3 ); - - unitTest( lst == IntList(10).append(5).append(3).append(1) ); - } - - test sort4 - { - IntList lst; - - lst.append( 5 ); - lst.append( 1 ); - lst.append( 10 ); - lst.append( 3 ); - - lst.sort(); - - unitTest( lst == IntList(1).append(3).append(5).append(10) ); - } - - test sort5 - { - IntList lst; - - lst.append( 5 ); - lst.append( 1 ); - lst.append( 10 ); - lst.append( 3 ); - - lst.sort >(); - - unitTest( lst == IntList(10).append(5).append(3).append(1) ); - } - - test sort6 - { - IntList lst; - - lst.append( 5 ); - lst.append( 1 ); - lst.append( 10 ); - lst.append( 3 ); - - Bu::__basicGTCmp x; - lst.sort( x ); - - unitTest( lst == IntList(10).append(5).append(3).append(1) ); - } + test append + { + IntList lst; + for( int j = 0; j < 50; j++ ) + { + lst.append( j ); + } + int j = 0; + for( IntList::iterator i = lst.begin(); i; i++, j++ ) + { + unitTest( *i == j ); + } + } + + test prepend + { + IntList lst; + for( int j = 0; j < 50; j++ ) + { + lst.prepend( j ); + } + int j = 49; + for( IntList::iterator i = lst.begin(); i; i++, j-- ) + { + unitTest( *i == j ); + } + } + + test copy + { + IntList lst; + int j; + for( j = 0; j < 50; j++ ) + { + lst.append( j ); + } + IntList lst2 = lst; + + j = 0; + for( IntList::iterator i = lst2.begin(); i; i++, j++ ) + { + unitTest( *i == j ); + } + lst2.clear(); + lst2 = lst; + + j = 0; + for( IntList::iterator i = lst2.begin(); i; i++, j++ ) + { + unitTest( *i == j ); + } + } + + test sort1 + { + IntList lst; + + lst.insertSorted( 5 ); + lst.insertSorted( 1 ); + lst.insertSorted( 10 ); + lst.insertSorted( 3 ); + + unitTest( lst == IntList(1).append(3).append(5).append(10) ); + } + + test sort2 + { + IntList lst; + + lst.insertSorted >( 5 ); + lst.insertSorted >( 1 ); + lst.insertSorted >( 10 ); + lst.insertSorted >( 3 ); + + unitTest( lst == IntList(10).append(5).append(3).append(1) ); + } + + test sort3 + { + IntList lst; + Bu::__basicGTCmp cmp; + + lst.insertSorted( cmp, 5 ); + lst.insertSorted( cmp, 1 ); + lst.insertSorted( cmp, 10 ); + lst.insertSorted( cmp, 3 ); + + unitTest( lst == IntList(10).append(5).append(3).append(1) ); + } + + test sort4 + { + IntList lst; + + lst.append( 5 ); + lst.append( 1 ); + lst.append( 10 ); + lst.append( 3 ); + + lst.sort(); + + unitTest( lst == IntList(1).append(3).append(5).append(10) ); + } + + test sort5 + { + IntList lst; + + lst.append( 5 ); + lst.append( 1 ); + lst.append( 10 ); + lst.append( 3 ); + + lst.sort >(); + + unitTest( lst == IntList(10).append(5).append(3).append(1) ); + } + + test sort6 + { + IntList lst; + + lst.append( 5 ); + lst.append( 1 ); + lst.append( 10 ); + lst.append( 3 ); + + Bu::__basicGTCmp x; + lst.sort( x ); + + unitTest( lst == IntList(10).append(5).append(3).append(1) ); + } } -- cgit v1.2.3