Ψ-W2-T1 remediation: scrim the card name over the waveform, hedge two SDK claims, fix a UTF-8-truncation empty-label bug, file the legibility DAW deferral
This commit is contained in:
@@ -103,6 +103,26 @@ static void testEmptyNameAndEmptyFallbackStillYieldALegalStem() {
|
||||
CHECK(sanitizeStem(n.stemBase) == "capture");
|
||||
}
|
||||
|
||||
static void testAllWhitespaceNameFallsBackToTheScopeLiteral() {
|
||||
// Distinct path from an empty name: trimmed() is what empties it, before truncation
|
||||
// ever runs.
|
||||
const CaptureName n = composeCaptureName(inputsFor({" "}, 0, "item"));
|
||||
CHECK(n.label == "item 08-01 1432");
|
||||
CHECK(sanitizeStem(n.stemBase) == "item");
|
||||
}
|
||||
|
||||
static void testNameThatTruncatesToNothingFallsBackToCapture() {
|
||||
// Over-length and made entirely of a UTF-8 continuation byte (0x80-0xBF): not empty
|
||||
// pre-truncation, so it survives trimmed()/the fallback chain as a real name — but
|
||||
// truncateUtf8 backs off over continuation bytes and walks all the way to 0 (every byte
|
||||
// in the first kMaxSourceNameBytes is a continuation byte), which used to leave an
|
||||
// empty label.
|
||||
const std::string allContinuation(kMaxSourceNameBytes + 10, '\x80');
|
||||
const CaptureName n = composeCaptureName(inputsFor({allContinuation}));
|
||||
CHECK(n.label == "capture 08-01 1432");
|
||||
CHECK(sanitizeStem(n.stemBase) == "capture");
|
||||
}
|
||||
|
||||
static void testUnnamedTrackUsesReaperTrackNConvention() {
|
||||
// What GetTrackName actually hands back for an unnamed track — the deterministic
|
||||
// fallback rides in as an ordinary name, no special case in the composer.
|
||||
@@ -231,6 +251,8 @@ int main() {
|
||||
testEmptyNameFallsBackToTheScopeLiteral();
|
||||
testNoSourceAtAllFallsBackToTheScopeLiteral();
|
||||
testEmptyNameAndEmptyFallbackStillYieldALegalStem();
|
||||
testAllWhitespaceNameFallsBackToTheScopeLiteral();
|
||||
testNameThatTruncatesToNothingFallsBackToCapture();
|
||||
testUnnamedTrackUsesReaperTrackNConvention();
|
||||
testAllPunctuationNameKeepsTheLabelAndCollapsesTheStem();
|
||||
testNonAsciiNameKeepsTheLabelAndCollapsesTheStem();
|
||||
|
||||
Reference in New Issue
Block a user