Issue85Tests.inc 1.1 KB

12345678910111213141516171819
  1. // Issue #85: every start described all LV2 plugins again (25 min for 510), because nothing told the scan that an LV2
  2. // plugin had not changed. The stamp of the LV2 folders is that answer: same stamp, no child process.
  3. #include "core/PluginScanPolicy.h"
  4. TEST (lv2_stamp_changes_only_when_a_bundle_does)
  5. {
  6. using lynx::scanpolicy::lv2Stamp;
  7. const auto stamp = lv2Stamp ({ { "/usr/lib/lv2/a.lv2", 100 }, { "/usr/lib/lv2/b.lv2", 200 } });
  8. // nothing changed, even if the disk lists the folders in another order: a stamp that moves rescans everything
  9. CHECK (lv2Stamp ({ { "/usr/lib/lv2/b.lv2", 200 }, { "/usr/lib/lv2/a.lv2", 100 } }) == stamp);
  10. CHECK (lv2Stamp ({ { "/usr/lib/lv2/a.lv2", 100 }, { "/usr/lib/lv2/b.lv2", 201 } }) != stamp); // updated
  11. CHECK (lv2Stamp ({ { "/usr/lib/lv2/a.lv2", 100 } }) != stamp); // removed
  12. CHECK (lv2Stamp ({ { "/usr/lib/lv2/a.lv2", 100 }, { "/usr/lib/lv2/b.lv2", 200 }, { "/usr/lib/lv2/c.lv2", 1 } }) != stamp); // installed
  13. CHECK (lv2Stamp ({}).empty()); // no LV2 plugins: nothing to describe, and no difference from no stamp at all
  14. }