test.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* Copyright (C) 2014 Mamadou DIOP.
  2. *
  3. * This file is part of Open Source Doubango Framework.
  4. *
  5. * DOUBANGO is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * DOUBANGO is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with DOUBANGO.
  17. *
  18. */
  19. #include "stdafx.h"
  20. #include <string.h>
  21. #include <stdlib.h>
  22. #include <assert.h>
  23. #include "tinynet.h"
  24. #include "tsk.h"
  25. #define kConfId 1927375685
  26. #define kTransacId 32871
  27. #define kUserId 18177
  28. #define kFloorId 10665
  29. #define kFloorReqId 2
  30. #define kReqStatus 3 // Granted
  31. #define kQueuePosition 0
  32. #define kUserDisplayName "Mamadou DIOP"
  33. #define kUserUri "Mamadou DIOP@TEST.COM"
  34. #define kRemoteIP "192.168.0.28"
  35. #define kRemotePort 5060
  36. #define kLocalIP "192.168.0.37"
  37. #define kLocalPort 5060
  38. #define kNullOctetStringPtr 0
  39. #define BAIL_IF_ERR(expr) { int _ret_; if ((_ret_) = (expr)) { TSK_DEBUG_ERROR("Error %d", (_ret_)); goto bail; } }
  40. #define LOOP 0
  41. #define RUN_TEST_ALL 0
  42. #define RUN_TEST_PARSER 0
  43. #define RUN_TEST_SESSION 1
  44. #include "test_parser.h"
  45. #include "test_session.h"
  46. #ifdef _WIN32_WCE
  47. int _tmain(int argc, _TCHAR* argv[])
  48. #else
  49. int main()
  50. #endif
  51. {
  52. tnet_startup();
  53. do {
  54. /* Print copyright information */
  55. printf("Doubango Project\nCopyright (C) 2014 Mamadou Diop \n\n");
  56. #if RUN_TEST_PARSER || RUN_TEST_ALL
  57. test_parser();
  58. #endif
  59. #if RUN_TEST_SESSION || RUN_TEST_ALL
  60. test_session();
  61. #endif
  62. }
  63. while(LOOP);
  64. tnet_cleanup();
  65. getchar();
  66. return 0;
  67. }