int main() { int all = 0; if (sortTest()){all++;} else{std::cout<<"sortTest failed\n";} if(reverseSortTest()){all++;} else{std::cout<<"reverseSortTest failed\n";} if(bogoSortTest()){all++;} else{std::cout<<"bogoSortTest failed\n";} if(findTest()){all++;} else{std::cout<<"findTest failed\n";} if(replaceTest()){all++;} else{std::cout<<"replaceTest failed\n";} if(all == 5){std::cout<<"All Tests Passed! :)\n";} }
int main(){ Vector<int> v(200); v.pushback(1); v.pushback(2); v.pushback(3); v.pushback(4); v.pushback(5); v.pushback(6); v.pushfront(0); Vector<int> u(v); //v.pushback(7); //u.pushfront(65); int i, last; bool pop_back = v.pop_back(i); bool last_pop_back = v.pop_back(last); //Methods todo /* empty() DONE clean() DONE size() capacity() pop_back() DONE shirnk_to_fit() DONE at() -->method like operator[] without assert */ i = v[5]; bool empty_v = v.empty(); bool empty_u = u.empty(); Vector<int> sortTest(6); sortTest.pushback(1); sortTest.pushback(8); sortTest.pushback(5); sortTest.pushback(3); sortTest.pushback(4); sortTest.pushback(2); int timesSwaped = sortTest.bubblesort(); Vector<int> thousandsort(1001); for (int i = 0; i < 1000; i++){ int push; push = rand(); thousandsort.pushback(push); } int bignum = thousandsort.bubblesort(); return 0; }
bool PokerTest::test() { bool ret = true; sortTest(); std::cout << std::endl << std::endl; if (!straightFlushTest()) { std::cout << "straight flush test failed" << std::endl; ret = false; } std::cout << std::endl << std::endl; if (!fourOfKindTest()) { std::cout << "four of kind test failed" << std::endl; ret = false; } std::cout << std::endl << std::endl; if (!fullHouseTest()) { std::cout << "full house test failed" << std::endl; ret = false; } std::cout << std::endl << std::endl; if (!flushTest()) { std::cout << "flush test failed" << std::endl; ret = false; } std::cout << std::endl << std::endl; if (!straightTest()) { std::cout << "straight test failed" << std::endl; ret = false; } std::cout << std::endl << std::endl; if (!threeOfKindTest()) { std::cout << "three of a kind test failed" << std::endl; ret = false; } std::cout << std::endl << std::endl; if (!twoPairTest()) { std::cout << "two pair test failed" << std::endl; ret = false; } std::cout << std::endl << std::endl; if (!onePairTest()) { std::cout << "one pair test failed" << std::endl; ret = false; } std::cout << std::endl << std::endl; if (!highCardTest()) { std::cout << "high card test failed" << std::endl; ret = false; } return ret; }