test2.cc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "source2.h"
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6. Triehard2 * test = new Triehard2();
  7. cout << "success! Created test" << endl;
  8. int x[3] = {0,1,0};
  9. int y[5] = {1,0,1,1,0};
  10. int z[1] = {0};
  11. int a[7] = {1,0,1,1,0,0,0};
  12. int b[7] = {0,1,1,0,0,1,1};
  13. test->insert(x, 3);
  14. cout << "success! inserted x" << endl;
  15. test->insert(a, 7);
  16. cout << "success! inserted a" << endl;
  17. test->insert(y, 5);
  18. cout << "success! inserted y" << endl;
  19. test->insert(y, 5);
  20. cout << "success! inserted y" << endl;
  21. test->insert(y, 5);
  22. cout << "success! inserted y" << endl;
  23. test->insert(z, 1);
  24. cout << "success! inserted z" << endl;
  25. test->insert(b, 7);
  26. cout << "success! inserted b" << endl;
  27. test->myPrintIsBetterThanYoursLogan();
  28. cout << "Print Done!" << endl;
  29. cout << "Search result for 10110: " << test->search(y, 5) << endl;
  30. test->cut(y, 5);
  31. cout << "success! cut y" << endl;
  32. test->myPrintIsBetterThanYoursLogan();
  33. cout << "Search result for 10110: " << test->search(y, 5) << endl;
  34. test->cut(y, 5);
  35. cout << "success! cut y" << endl;
  36. test->cut(y, 5);
  37. cout << "success! cut y" << endl;
  38. test->myPrintIsBetterThanYoursLogan();
  39. cout << "Search result for 10110: " << test->search(y, 5) << endl;
  40. delete test;
  41. cout << "success! Completed test" << endl;
  42. //while(1);
  43. }