| 636 | |
| 637 | |
| 638 | void ScriptUserPresetHandler::runTest() |
| 639 | { |
| 640 | auto content = getScriptProcessor()->getScriptingContent(); |
| 641 | auto& uph = getMainController()->getUserPresetHandler(); |
| 642 | |
| 643 | String report = "\n"; |
| 644 | |
| 645 | auto addLine = [&](const String& s) |
| 646 | { |
| 647 | report << s << "\n"; |
| 648 | }; |
| 649 | |
| 650 | auto addLineFromTokens = [&](const StringArray& s) |
| 651 | { |
| 652 | for (auto& t : s) |
| 653 | report << t; |
| 654 | |
| 655 | report << "\n"; |
| 656 | }; |
| 657 | |
| 658 | auto addWarning = [&](const String& s) |
| 659 | { |
| 660 | report << "WARNING: " << s << "\n"; |
| 661 | }; |
| 662 | |
| 663 | auto boolString = [](bool v) |
| 664 | { |
| 665 | return String(v ? "true" : "false"); |
| 666 | }; |
| 667 | |
| 668 | auto getNumElements = [&](const String& type) |
| 669 | { |
| 670 | if (type == "allComponents") |
| 671 | { |
| 672 | return String(content->getNumComponents()); |
| 673 | } |
| 674 | if (type == "saveInPreset") |
| 675 | { |
| 676 | int counter = 0; |
| 677 | |
| 678 | for (int i = 0; i < content->getNumComponents(); i++) |
| 679 | { |
| 680 | if (content->getComponent(i)->getScriptObjectProperty("saveInPreset")) |
| 681 | counter++; |
| 682 | } |
| 683 | |
| 684 | return String(counter); |
| 685 | } |
| 686 | if (type == "automationID") |
| 687 | { |
| 688 | return String(uph.getNumCustomAutomationData()); |
| 689 | } |
| 690 | if (type == "moduleStates") |
| 691 | { |
| 692 | return String(getScriptProcessor()->getMainController_()->getModuleStateManager().modules.size()); |
| 693 | } |
| 694 | |
| 695 | return String("unknown"); |
nothing calls this directly
no test coverage detected