capture: state the bounds tolerance as empirical, refuse unmeasurable renders, keep refused ones for diagnosis
The one-frame bound is not provable for a per-edge renderer; the test now shows where it breaks. Refused renders move out of the bank instead of being deleted, so the DAW experiment has something to read.
This commit is contained in:
@@ -64,26 +64,49 @@ static void testRealtimeIsUnsupportedOffline() {
|
||||
CHECK(!renderSettingsFor(SourceMode::Realtime, 1.0).supported);
|
||||
}
|
||||
|
||||
static void testEveryRenderSourceIsNameable() {
|
||||
// The bounds refusal quotes this label to say WHICH render source missed the
|
||||
// window, so every mode must name itself and no two may read alike.
|
||||
const SourceMode all[] = {
|
||||
SourceMode::MasterMix, SourceMode::TimeSelection, SourceMode::SelectedTracks,
|
||||
SourceMode::SelectedItems, SourceMode::RazorArea, SourceMode::Realtime,
|
||||
};
|
||||
for (std::size_t i = 0; i < sizeof(all) / sizeof(all[0]); ++i) {
|
||||
const char* label = renderSourceLabel(all[i]);
|
||||
CHECK(label != nullptr && label[0] != '\0');
|
||||
CHECK(std::strcmp(label, "unknown") != 0);
|
||||
for (std::size_t j = i + 1; j < sizeof(all) / sizeof(all[0]); ++j)
|
||||
CHECK(std::strcmp(label, renderSourceLabel(all[j])) != 0);
|
||||
}
|
||||
// The two the refusal must tell apart: a source that derives its own bounds vs
|
||||
// the time-bounded render.
|
||||
CHECK(std::strcmp(renderSourceLabel(SourceMode::SelectedItems),
|
||||
"selected media items") == 0);
|
||||
static void testEveryRenderSourceLabelIsPinnedVerbatim() {
|
||||
// docs/VERIFICATION.md asks Daniel to report the refusal's `Render source:` line
|
||||
// back verbatim, so every label is pinned to its literal — a typo in any of them
|
||||
// breaks the report that quotes it, and only a literal catches that.
|
||||
CHECK(std::strcmp(renderSourceLabel(SourceMode::MasterMix), "master mix") == 0);
|
||||
CHECK(std::strcmp(renderSourceLabel(SourceMode::TimeSelection), "master mix") == 0);
|
||||
CHECK(std::strcmp(renderSourceLabel(SourceMode::SelectedTracks),
|
||||
"selected tracks via master") == 0);
|
||||
CHECK(std::strcmp(renderSourceLabel(SourceMode::SelectedItems),
|
||||
"selected media items") == 0);
|
||||
CHECK(std::strcmp(renderSourceLabel(SourceMode::RazorArea), "razor edits") == 0);
|
||||
CHECK(std::strcmp(renderSourceLabel(SourceMode::Realtime), "realtime record") == 0);
|
||||
}
|
||||
|
||||
static void testLabelsSeparateExactlyWhatTheRenderSeparates() {
|
||||
// The labels partition the offline modes the way RENDER_SETTINGS does, and no
|
||||
// finer: same bits => same words (MasterMix/TimeSelection both render the master
|
||||
// mix, custom-time-bounded), different bits => different words. Naming two modes
|
||||
// apart that render identically would put a distinction in a bug report that does
|
||||
// not exist in the render.
|
||||
const SourceMode offline[] = {
|
||||
SourceMode::MasterMix, SourceMode::TimeSelection, SourceMode::SelectedTracks,
|
||||
SourceMode::SelectedItems, SourceMode::RazorArea,
|
||||
};
|
||||
constexpr std::size_t n = sizeof(offline) / sizeof(offline[0]);
|
||||
for (std::size_t i = 0; i < n; ++i) {
|
||||
const char* label = renderSourceLabel(offline[i]);
|
||||
CHECK(label != nullptr && label[0] != '\0');
|
||||
CHECK(std::strcmp(label, "unknown") != 0);
|
||||
CHECK(renderSettingsFor(offline[i], 1.0).supported);
|
||||
for (std::size_t j = i + 1; j < n; ++j) {
|
||||
const bool sameRender = renderSettingsFor(offline[i], 1.0).settings ==
|
||||
renderSettingsFor(offline[j], 1.0).settings;
|
||||
const bool sameLabel =
|
||||
std::strcmp(label, renderSourceLabel(offline[j])) == 0;
|
||||
CHECK(sameRender == sameLabel);
|
||||
}
|
||||
}
|
||||
// Realtime is not an offline render source at all, so it names its own mechanism
|
||||
// rather than a RENDER_SETTINGS value — outside the partition above by design.
|
||||
CHECK(!renderSettingsFor(SourceMode::Realtime, 1.0).supported);
|
||||
CHECK(std::strcmp(renderSourceLabel(SourceMode::Realtime),
|
||||
renderSourceLabel(SourceMode::MasterMix)) != 0);
|
||||
}
|
||||
|
||||
// --- tail: TailMode -> RENDER_* mapping (docs/product/capture-tail.md) --------
|
||||
@@ -418,7 +441,8 @@ int main() {
|
||||
testSelectedItemsSingleFile();
|
||||
testRazorSingleFile();
|
||||
testRealtimeIsUnsupportedOffline();
|
||||
testEveryRenderSourceIsNameable();
|
||||
testEveryRenderSourceLabelIsPinnedVerbatim();
|
||||
testLabelsSeparateExactlyWhatTheRenderSeparates();
|
||||
testTailNoneIsExactBounds();
|
||||
testTailAutoIsSurgicalTrim();
|
||||
testAutoTrimRatioDerivesFromDb();
|
||||
|
||||
Reference in New Issue
Block a user