1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Test name leak and slash fix

This commit is contained in:
Brian Fiete 2024-08-14 06:37:47 -04:00
parent c3b8fdf794
commit d53613c303

View file

@ -968,14 +968,12 @@ void BfCompiler::EmitTestMethod(BfVDataModule* bfModule, Array<TestMethod>& test
if (fieldDef->mName == "Name") if (fieldDef->mName == "Name")
{ {
String* str = bfModule->GetStringPoolString(field.mParam.mValue, typeInstance->mConstHolder); String* str = bfModule->GetStringPoolString(field.mParam.mValue, typeInstance->mConstHolder);
testMethod.mName += "Name"; if (str != NULL)
String* temp = new String(*str); {
temp->Replace('\t', "\\t"); //Good enough for now testMethod.mName += "Name";
temp->Replace('\n', "\\n"); testMethod.mName += SlashString(*str, true, true, true);;
temp->Replace('\a', "\\a"); testMethod.mName += '\a';
temp->Replace('\v', "\\v"); }
testMethod.mName += *temp;
testMethod.mName += "\a";
} }
} }
} }