No Description

main.cpp 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #include <QApplication>
  2. #include "mainwindow.h"
  3. #include <cstdlib>
  4. #include <ctime>
  5. #include "functions.h"
  6. #include <cassert>
  7. #include <QDebug>
  8. void testSort() {
  9. QString a = "AAA" , b = "BBB" , c = "CCC";
  10. mySortBeta(a,b,c);
  11. assert( a < b && b < c);
  12. a = "AAA", b = "CCC", c = "BBB";
  13. mySortBeta(a,b,c);
  14. assert( a < b && b < c);
  15. a = "BBB", b = "AAA", c = "CCC";
  16. mySortBeta(a,b,c);
  17. assert( a < b && b < c);
  18. a = "BBB", b = "CCC", c = "AAA";
  19. mySortBeta(a,b,c);
  20. assert( a < b && b < c);
  21. a = "CCC", b = "AAA", c = "BBB";
  22. mySortBeta(a,b,c);
  23. //qDebug() << a << b << c;
  24. assert( a < b && b < c);
  25. a = "CCC", b = "BBB", c = "AAA";
  26. mySortBeta(a,b,c);
  27. assert( a < b && b < c);
  28. qDebug() << "Passed Test for Sort!!!!";
  29. }
  30. void testCheck() {
  31. assert( checkWAlpha(91) == QString("ninety one"));
  32. assert( checkWAlpha(891) == QString("eight hundred ninety one"));
  33. assert( checkWAlpha(100) == QString("one hundred"));
  34. assert( checkWAlpha(59123) == QString("fifty nine thousand one hundred twenty three"));
  35. assert( checkWAlpha(100001) == QString("one hundred thousand one"));
  36. assert( checkWAlpha(100000) == QString("one hundred thousand"));
  37. assert( checkWAlpha(100000000) == QString("one hundred million"));
  38. qDebug() << "Passed Test for Check Word!!!!";
  39. }
  40. int main(int argc, char *argv[])
  41. {
  42. // testSort();
  43. initCheckWMaps(); /*** DONT FORGET ***/
  44. // testCheck();
  45. // qDebug() << checkWAlpha(91);
  46. // qDebug() << checkWAlpha(891);
  47. // qDebug() << checkWAlpha(801);
  48. srand(time(NULL));
  49. QApplication a(argc, argv);
  50. MainWindow w;
  51. w.show();
  52. return a.exec();
  53. }