test.cc 953 B

12345678910111213141516171819202122232425262728293031323334
  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. 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(z, 1);
  20. cout << "success! inserted z" << endl;
  21. test->insert(b, 7);
  22. cout << "success! inserted b" << endl;
  23. test->myPrintIsBetterThanYoursLogan();
  24. cout << "Print Done!" << endl;
  25. cout << "Search result for 10110: " << test->search(y, 5) << endl;
  26. test->cut(y, 5);
  27. cout << "success! cut y" << endl;
  28. test->myPrintIsBetterThanYoursLogan();
  29. cout << "Search result for 10110: " << test->search(y, 5) << endl;
  30. delete test;
  31. cout << "success! Completed test" << endl;
  32. //while(1);
  33. }