You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.0KB

  1. /**
  2. * Unit test entry point
  3. */
  4. #include <stdio.h>
  5. #include <assert.h>
  6. #include <string>
  7. extern void testBiquad();
  8. extern void testTestSignal();
  9. extern void testSaw();
  10. extern void testLookupTable();
  11. extern void testSinOscillator();
  12. extern void testHilbert();
  13. extern void testAudioMath();
  14. extern void perfTest();
  15. extern void testFrequencyShifter();
  16. extern void testStateVariable();
  17. extern void testVocalAnimator();
  18. extern void testObjectCache();
  19. extern void testThread(bool exended);
  20. extern void testFFT();
  21. extern void testRingBuffer();
  22. extern void testManagedPool();
  23. extern void testColoredNoise();
  24. extern void testFFTCrossFader();
  25. extern void testFinalLeaks();
  26. extern void testClockMult();
  27. extern void testTremolo();
  28. extern void testGateTrigger();
  29. int main(int argc, char ** argv)
  30. {
  31. bool runPerf = false;
  32. bool extended = false;
  33. if (argc > 1) {
  34. std::string arg = argv[1];
  35. if (arg == "--ext") {
  36. extended = true;
  37. }
  38. }
  39. #ifdef _PERF
  40. runPerf = true;
  41. #ifndef NDEBUG
  42. #error asserts should be off for perf test
  43. #endif
  44. #endif
  45. // While this code may work in 32 bit applications, it's not tested for that.
  46. // Want to be sure we are testing the case we care about.
  47. assert(sizeof(size_t) == 8);
  48. testAudioMath();
  49. testRingBuffer();
  50. testGateTrigger();
  51. testManagedPool();
  52. testLookupTable();
  53. testObjectCache();
  54. testTestSignal();
  55. testBiquad();
  56. testSaw();
  57. testClockMult();
  58. testSinOscillator();
  59. testHilbert();
  60. testStateVariable();
  61. testFFT();
  62. testFFTCrossFader();
  63. testThread(extended);
  64. // after testing all the components, test composites.
  65. testTremolo();
  66. testColoredNoise();
  67. testFrequencyShifter();
  68. testVocalAnimator();
  69. if (runPerf) {
  70. perfTest();
  71. }
  72. testFinalLeaks();
  73. // When we run inside Visual Studio, don't exit debugger immediately
  74. #if defined(_MSC_VER)
  75. printf("Test passed. Press any key to continue...\n"); fflush(stdout);
  76. getchar();
  77. #else
  78. printf("Tests passed.\n");
  79. #endif
  80. }