virtual void SetUp() { myArray->push( 80 ); myArray->push( 4 ); myArray1->push( 80 ); myArray1->push( 2 ); myArray1->popFront(); myArray1->push( 5 ); myArray1->push( 4 ); myArray1->push( 100 ); myArray1->push( 8 ); myArray1->push( 3 ); for( int i = 0; i < 12; i++ ) { myArray2->pushFront( i ); } for( int i = 0; i < 11; i++ ) { myArray3->push( 2 ); } //myArray4=myArray; // this functionality mostly works, but has memory leaks }
TEST( DynamicArray, pushFront ) { StevensDev::sgdc::DynamicArray<int> array; array.pushFront(0); array.pushFront(1); array.pushFront(2); array.pushFront(3); array.pushFront(4); array.pushFront(5); array.pushFront(6); array.pushFront(7); array.pushFront(8); array.pushFront(9); array.pushFront(10); EXPECT_EQ( 10, array.at( 0 ) ); EXPECT_EQ( 9 , array.at( 1 ) ); EXPECT_EQ( 8 , array.at( 2 ) ); EXPECT_EQ( 1, array.at( 9 ) ); }