소스 검색

Update BfCompiler.cpp

Added name attribute
Jannis 1 년 전
부모
커밋
288eb9eaad
1개의 변경된 파일15개의 추가작업 그리고 3개의 파일을 삭제
  1. 15 3
      IDEHelper/Compiler/BfCompiler.cpp

+ 15 - 3
IDEHelper/Compiler/BfCompiler.cpp

@@ -961,9 +961,21 @@ void BfCompiler::EmitTestMethod(BfVDataModule* bfModule, Array<TestMethod>& test
 				{
 					testMethod.mName += "Ig";
 				}
-				else if (fieldDef->mName == "Name")
-				{
-					testMethod.mName += "Ovwn";
+			}
+			else if ((constant != NULL) && (constant->mTypeCode == BfTypeCode_StringId))
+			{
+				BfFieldDef* fieldDef = field.mFieldRef;
+				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";
 				}
 			}
 		}