fix
This commit is contained in:
@@ -3,7 +3,7 @@ unit Unit1;
|
||||
interface
|
||||
|
||||
uses
|
||||
System.SysUtils,DUnitX.TestFramework,RuntimeBuilder,RuntimeBuilder.Fasm,RuntimeBuilder.Types;
|
||||
System.SysUtils,DUnitX.TestFramework,RuntimeBuilder,RuntimeBuilder.Fasm;
|
||||
|
||||
type
|
||||
[TestFixture]
|
||||
@@ -11,6 +11,8 @@ type
|
||||
public
|
||||
[TestCase]
|
||||
procedure Test1();
|
||||
[TestCase]
|
||||
procedure Test2();
|
||||
end;
|
||||
|
||||
implementation
|
||||
@@ -34,6 +36,28 @@ FreeAndNil(Src);
|
||||
FreeAndNil(Fasm);
|
||||
end;
|
||||
|
||||
procedure TRuntimeBuilderTestObject.Test2();
|
||||
var
|
||||
Fasm:TRTBFasmCompiler;
|
||||
Src:TRTBSource;
|
||||
lib:TRTBLib;
|
||||
Func1:TRTBFunc;
|
||||
begin
|
||||
Fasm:=TRTBFasmCompiler.Create('..\..\..\FasmOnDelphi\fasmw172\fasm');
|
||||
Src:=Fasm.GenNewSrc;
|
||||
Src.LoadFromFile('..\..\testlib.fasm');
|
||||
Fasm.LoadLib('W:\RuntimeBuilder\FasmOnDelphi\fasmw172\INCLUDE\win32a.inc');
|
||||
lib:=Src.CompilateAsLib;
|
||||
Func1:=lib.Funtion['MyEcho'];
|
||||
if 234665<>Func1.Call(TypeInfo(integer),[234665],CRTBCallTypeStdCall).AsInteger then
|
||||
begin
|
||||
raise Exception.Create('Error in test2');
|
||||
end;
|
||||
FreeAndNil(Func1);
|
||||
FreeAndNil(Src);
|
||||
FreeAndNil(Fasm);
|
||||
end;
|
||||
|
||||
initialization
|
||||
TDUnitX.RegisterTestFixture(TRuntimeBuilderTestObject);
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user