test.cc 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #include "source1.h"
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6. Triehard * test = new Triehard();
  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. cout << "Search result for searching 010: " << test->search(x, 3) << endl;
  14. test->insert(x, 3);
  15. cout << "success! inserted x" << endl;
  16. test->insert(a, 7);
  17. cout << "success! inserted a" << endl;
  18. test->insert(y, 5);
  19. cout << "success! inserted y" << endl;
  20. test->insert(z, 1);
  21. cout << "success! inserted z" << endl;
  22. test->insert(b, 7);
  23. cout << "success! inserted b" << endl;
  24. test->myPrintIsBetterThanYoursLogan();
  25. cout << "Print Done!" << endl;
  26. cout << "Search result for 10110: " << test->search(y, 5) << endl;
  27. test->cut(y, 5);
  28. cout << "success! cut y" << endl;
  29. test->myPrintIsBetterThanYoursLogan();
  30. cout << "Search result for 10110: " << test->search(y, 5) << endl;
  31. delete test;
  32. cout << "success! Completed test" << endl;
  33. //while(1);
  34. }