Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include <QCoreApplication>
  2. #include <QStringList>
  3. #include <iostream>
  4. #include "test.h"
  5. #include "bctest.h"
  6. int main(int argc, char *argv[])
  7. {
  8. #ifdef PT_DEBUG
  9. std::cout<<"Debug mode"<<std::endl;
  10. #else
  11. std::cout<<"Release mode"<<std::endl;
  12. #warning PTSocket is not in debug mode
  13. #endif
  14. QCoreApplication a(argc, argv);
  15. bool pt = false, bc = false;
  16. if(qApp->arguments().size() >= 2)
  17. {
  18. if(qApp->arguments().at(1) == "-bc")
  19. bc = true;
  20. else if(qApp->arguments().at(1) == "-pt")
  21. pt = true;
  22. else
  23. {
  24. std::cout<<"Usage: tests -bc|-pt"<<std::endl;
  25. return 1;
  26. }
  27. }
  28. else
  29. {
  30. std::cout<<"Usage: tests -bc|-pt"<<std::endl;
  31. return 1;
  32. }
  33. BcTest bct;
  34. Test t;
  35. if(bc)
  36. {
  37. bct.test();
  38. }
  39. else if(pt)
  40. {
  41. t.testListen(6950);
  42. t.test0IntConvert();
  43. }
  44. return a.exec();
  45. }