Browse Source

* if the creation of the method implementation raises ENotImplemented we ignore the test as not all calling conventions might be supported currently (e.g. on i386 only "register" is for now)

git-svn-id: trunk@42151 -
svenbarth 6 years ago
parent
commit
601f0bd6b1
1 changed files with 18 additions and 3 deletions
  1. 18 3
      packages/rtl-objpas/tests/tests.rtti.impl.pas

+ 18 - 3
packages/rtl-objpas/tests/tests.rtti.impl.pas

@@ -426,7 +426,12 @@ begin
         InputUntypedTypes[i + 1] := Nil;
         InputUntypedTypes[i + 1] := Nil;
     end;
     end;
 
 
-    impl := method.CreateImplementation({$ifdef fpc}@{$endif}OnHandleInvokable);
+    try
+      impl := method.CreateImplementation({$ifdef fpc}@{$endif}OnHandleInvokable);
+    except
+      on e: ENotImplemented do
+        Exit;
+    end;
     CheckNotNull(impl, 'Method implementation is Nil');
     CheckNotNull(impl, 'Method implementation is Nil');
 
 
     mrec.Data := Self;
     mrec.Data := Self;
@@ -501,7 +506,12 @@ begin
         InputUntypedTypes[i] := Nil;
         InputUntypedTypes[i] := Nil;
     end;
     end;
 
 
-    impl := proc.CreateImplementation({$ifdef fpc}@{$endif}OnHandleInvokable);
+    try
+      impl := proc.CreateImplementation({$ifdef fpc}@{$endif}OnHandleInvokable);
+    except
+      on e: ENotImplemented do
+        Exit;
+    end;
     CheckNotNull(impl, 'Method implementation is Nil');
     CheckNotNull(impl, 'Method implementation is Nil');
 
 
     cp := impl.CodeAddress;
     cp := impl.CodeAddress;
@@ -555,7 +565,12 @@ procedure TTestImpl.TestIntfMethods;
 var
 var
   intf: ITestInterface;
   intf: ITestInterface;
 begin
 begin
-  intf := TVirtualInterface.Create(PTypeInfo(TypeInfo(ITestInterface)), {$ifdef fpc}@{$endif}OnHandleIntfMethod) as ITestInterface;
+  try
+    intf := TVirtualInterface.Create(PTypeInfo(TypeInfo(ITestInterface)), {$ifdef fpc}@{$endif}OnHandleIntfMethod) as ITestInterface;
+  except
+    on e: ENotImplemented do
+      Exit;
+  end;
   Check(Assigned(intf), 'ITestInterface instance is Nil');
   Check(Assigned(intf), 'ITestInterface instance is Nil');
 
 
   {$ifdef fpc}specialize{$endif}GenDoIntfImpl<ITestInterface>(intf, 1, [], [], [], TValue.Empty);
   {$ifdef fpc}specialize{$endif}GenDoIntfImpl<ITestInterface>(intf, 1, [], [], [], TValue.Empty);