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.

47 lines
1.1KB

  1. #include "LFN.h"
  2. #include "asserts.h"
  3. #include "CHB.h"
  4. #include "FunVCOComposite.h"
  5. #include "Gray.h"
  6. #include "Shaper.h"
  7. #include "TestComposite.h"
  8. #include "VocalFilter.h"
  9. #include <set>
  10. template <class Comp>
  11. inline static void test()
  12. {
  13. std::shared_ptr<IComposite> comp = Comp::getDescription();
  14. std::set<std::string> names;
  15. assertEQ(comp->getNumParams(), Comp::NUM_PARAMS);
  16. assertGT(comp->getNumParams(), 0);
  17. for (int i = 0; i < comp->getNumParams(); ++i)
  18. {
  19. auto config = comp->getParam(i);
  20. assertLT(config.min, config.max);
  21. assertLE(config.def, config.max);
  22. assertGE(config.def, config.min);
  23. assert(config.name);
  24. std::string name = config.name;
  25. assert(!name.empty());
  26. // make sure they are unique
  27. assert(names.find(name) == names.end());
  28. names.insert(name);
  29. }
  30. }
  31. void testIComposite()
  32. {
  33. test<FunVCOComposite<TestComposite>>();
  34. test<LFN<TestComposite>>();
  35. test<VocalFilter<TestComposite>>();
  36. test<Shaper<TestComposite>>();
  37. test<CHB<TestComposite>>();
  38. test<Gray<TestComposite>>();
  39. }