Extras190amTests.inc 3.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Round 190am: the list behind Settings > LYNX extras (core/LynxExtras.h).
  2. #include "core/LynxExtras.h"
  3. #include "core/Preferences.h"
  4. TEST (extras190am_extras_list)
  5. {
  6. using namespace lynx;
  7. std::set<std::string_view> ids, keys;
  8. int count = 0;
  9. for (const auto& item : extras::items)
  10. {
  11. ++count;
  12. CHECK (! item.id.empty() && ! item.section.empty() && ! item.title.empty() && ! item.note.empty());
  13. CHECK (ids.insert (item.id).second); // one line per extra
  14. CHECK (keys.insert (item.settingsKey).second); // one preference per line: nothing is stored twice
  15. // "file:key" of the preference the feature already has
  16. const auto colon = item.settingsKey.find (':');
  17. CHECK (colon != std::string_view::npos && colon > 0 && colon + 1 < item.settingsKey.size());
  18. CHECK (item.settingsKey.substr (0, colon) == "ui-options.txt" || item.settingsKey.substr (0, colon) == "midi-settings.txt"
  19. || item.settingsKey.substr (0, colon) == "theme.lynxtheme"); // (round 190qw: the Soft look lives in the theme)
  20. CHECK (item.note.back() == '.'); // one line of explanation, a sentence
  21. // ... that names the switch's own place (rollup 0.1.32 step 3: round 190qi's lists have no other switch, and say so)
  22. CHECK (item.note.find ("Also ") != std::string_view::npos || item.note.find ("Its only switch is here.") != std::string_view::npos);
  23. }
  24. CHECK (count == 61); // (rollup 0.1.32 step 3: theme.tracksFromAccent, plugins.recent, plugins.oneRow, browser.midiPreview, browser.tabCompletes listed; round 190qw: theme.softLook; round 190qu: simple.dropStrip; rollup 0.1.32 step 2: mixer.peakValues, mixer.correlation, audioEditor.wheelScrolls, toolbar.grouped listed; round 190qk: general.stretchedClipsLoop, listed; round 190qr: editing.zoomAtSongPosition, playlist.gainHandleFollowsView, export.doneSound, export.doneWindow; round 190qo: file.alwaysCollect, export.noDialog; round 190qm: playlist.darkenMutedTracks, PR #268, on by default; round 190qj: playlist.dimUnselectedTracks, PR #267, on by default; round 190pm: simple.touchMode; round 190pf: playlist.chordLane, pianoRoll.chordHighlight; round 190pe: playlist.trackVersions; round 190pa: playlist.rangeEdits; round 190oq: editing.muteKeyToggles, general.startPage; round 190op: playlist.trackStates; round 190on: pianoRoll.stackedLanes; round 190ol: playlist.sectionsLane; round 190oo: playlist.shadeFadedAudio, project.clipLaunchStrips, simple.projectName, playlist.clipLanesFolded, controlBar.liveScale; round 190nq: playlist.rulerSeeksAnyTool; round 190ng: general.escCloses; round 190lo: polyEdit.prepareOnOpen; round 190kx: simple.loopDetect; round 190gz: project.linkTracks; round 190ht: playlist.trackInserts; round 190io: mixer.stripInserts; round 190iu: wheel zones, temporary tools, MIDI drop, Track-only; round 190jq: header width, pointer click, clip lanes; round 190jz: transport.wToStart)
  25. for (const auto* id : { "mixer.loudness", "mixer.usedOnly", "mixer.keepLostLinks", "mixer.followPlaylist", "playlist.automationLanes",
  26. "pianoRoll.songBarsRuler", "general.hoverValues", "playlist.trackInserts", "mixer.stripInserts", "playlist.dimUnselectedTracks" })
  27. CHECK (ids.count (id) == 1);
  28. // the one kept in the MIDI settings is off in a fresh profile and round-trips under the key the list names
  29. prefs::MidiPrefs midi;
  30. CHECK (! midi.gamepad);
  31. midi.gamepad = true;
  32. CHECK (midi.toText().find ("gamepad=1") != std::string::npos && prefs::MidiPrefs::fromText (midi.toText()).gamepad);
  33. }