1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +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")
{
String* str = bfModule->GetStringPoolString(field.mParam.mValue, typeInstance->mConstHolder);
testMethod.mName += "Name";
String* temp = new String(*str);
temp->Replace('\t', "\\t"); //Good enough for now
temp->Replace('\n', "\\n");
temp->Replace('\a', "\\a");
temp->Replace('\v', "\\v");
testMethod.mName += *temp;
testMethod.mName += "\a";
if (str != NULL)
{
testMethod.mName += "Name";
testMethod.mName += SlashString(*str, true, true, true);;
testMethod.mName += '\a';
}
}
}
}