Test suite : fix memory leaks.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@914 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2009-07-16 17:41:03 +00:00
parent 3e3ace6710
commit 5089c12136
2 changed files with 22 additions and 14 deletions

View File

@ -899,7 +899,7 @@ begin
f.BeginObject('Root',TypeInfo(TClass_Int));
f.PutScopeInnerValue(TypeInfo(AnsiChar),xVal_1);
f.EndScope();
s := TMemoryStream.Create();
s.Clear();
f.SaveToStream(s);
xVal_1 := #0;
@ -991,7 +991,7 @@ begin
f.BeginObject('Root',TypeInfo(TClass_Int));
f.PutScopeInnerValue(TypeInfo(WideChar),xVal_1);
f.EndScope();
s := TMemoryStream.Create();
s.Clear();
f.SaveToStream(s);
xVal_1 := #0;
@ -1179,7 +1179,7 @@ begin
f.PutScopeInnerValue(TypeInfo(ShortInt),intVal_S);
f.EndScope();
s := TMemoryStream.Create();
s.Clear();
f.SaveToStream(s);
intVal_S := 0;
@ -1273,7 +1273,7 @@ begin
f.PutScopeInnerValue(TypeInfo(SmallInt),intVal_S);
f.EndScope();
s := TMemoryStream.Create();
s.Clear();
f.SaveToStream(s);
intVal_S := 0;
@ -1367,7 +1367,7 @@ begin
f.PutScopeInnerValue(TypeInfo(LongInt),intVal_S);
f.EndScope();
s := TMemoryStream.Create();
s.Clear();
f.SaveToStream(s);
intVal_S := 0;
@ -1486,7 +1486,7 @@ begin
f.PutScopeInnerValue(TypeInfo(Int64),intVal_S);
f.EndScope();
s := TMemoryStream.Create();
s.Clear();
f.SaveToStream(s);
intVal_S := 0;
@ -2072,7 +2072,7 @@ begin
f.PutScopeInnerValue(TypeInfo(Boolean),locVal_1);
f.EndScope();
s := TMemoryStream.Create();
s.Clear();
f.SaveToStream(s);
locVal_1 := not locVal_1;
@ -4744,8 +4744,8 @@ begin
Check(CompareNodes(a,b^.ObjectData^.Head^.Data));
finally
strm.Free();
ClearObj(a);
ClearObj(b);
FreeObjectBuffer(a);
FreeObjectBuffer(b);
end;
end;
@ -5555,7 +5555,14 @@ begin
FreeAndNil(FVal_CplxInt16U);
FreeAndNil(FVal_CplxInt16S);
FreeAndNil(FVal_CplxInt8U);
FreeAndNil(FVal_CplxInt8S);
FreeAndNil(FVal_CplxInt8S);
FreeAndNil(FVal_CplxDouble);
FreeAndNil(FVal_CplxExtended);
FreeAndNil(FVal_CplxString);
FreeAndNil(FVal_CplxWideString);
{$IFDEF WST_UNICODESTRING}
FreeAndNil(FVal_CplxUnicodeString);
{$ENDIF WST_UNICODESTRING}
inherited FreeObjectProperties();
end;
@ -6212,7 +6219,7 @@ begin
CheckEquals(VAL_MSG,excpt_msg,'faultString');
finally
FreeAndNil(strm);
ClearObj(root);
FreeObjectBuffer(root);
end;
end;
@ -6257,7 +6264,7 @@ begin
FreeAndNil(strm);
end;
finally
ClearObj(root);
FreeObjectBuffer(root);
end;
end;

View File

@ -76,10 +76,11 @@ function TTestMetadata.CreateSymbolTable(): TwstPasTreeContainer;
AContainer : TwstPasTreeContainer
) : TPasArgument ;
begin
Result := TPasArgument(AContainer.CreateElement(TPasArgument,AName,AProc,visDefault,'',0));
Result := TPasArgument(AContainer.CreateElement(TPasArgument,AName,AProc.ProcType,visDefault,'',0));
Result.ArgType := AContainer.FindElement(ATypeName) as TPasType;
Result.ArgType.AddRef();
Result.Access := AAccess;
AProc.ProcType.Args.Add(Result);
end;
var
@ -89,7 +90,7 @@ var
begin
Result := TwstPasTreeContainer.Create();
CreateWstInterfaceSymbolTable(Result);
Result.CreateElement(TPasModule,'test_unit_name',Result.Package,visDefault,'',0);
Result.Package.Modules.Add(Result.CreateElement(TPasModule,'test_unit_name',Result.Package,visDefault,'',0));
sct := TPasSection(Result.CreateElement(TPasSection,'',Result.CurrentModule,visDefault,'',0));
Result.CurrentModule.InterfaceSection := sct;