Make unit tests for GetTypeSize more completes

Issue #15 wontfix
Jeroen Wiert Pluimers created an issue

Document the RTTI TTypeKind anomalies.

Then research to see if these checks can be actually implemented:

//{$IFOPT REALCOMPATIBILITY}
//procedure TTestSpringEventsMethods.Test_GetTypeSize_Real48();
//begin
//  MatchType(TypeInfo(Real48), tkFloat, 6);
//end;
//{$ENDIF REALCOMPATIBILITY}

procedure TTestSpringEventsMethods.Test_GetTypeSize_File();
begin
//  MatchType(TypeInfo(File), tkFloat, 0);
  FailUnsupportedTypeForTypeInfo('File');
end;

procedure TTestSpringEventsMethods.Test_GetTypeSize_OpenString();
begin
// http://www.codexterity.com/delphistrings.htm
//  MatchType(TypeInfo(OpenString), tkInteger, 4);
  FailUnsupportedTypeForTypeInfo('OpenString');
end;

procedure TTestSpringEventsMethods.Test_GetTypeSize_Text();
begin
//  MatchType(TypeInfo(Text), tkFloat, 0);
  FailUnsupportedTypeForTypeInfo('Text');
end;

procedure TTestSpringEventsMethods.Test_GetTypeSize_TextFile();
begin
//  MatchType(TypeInfo(TextFile), tkFloat, 0);
  FailUnsupportedTypeForTypeInfo('TextFile');
end;

Comments (3)

  1. Stefan Glienke repo owner

    Types without type info are not supported. by the RTTI. They will raise an exception inside the TEvent<T> (which is where the GetTypeSize routine is used)

  2. Log in to comment