Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 12/24/23 in all areas

  1. Perpetual license is not perpetual support. That means if your support expires you are on your own as far as keeping a copy of your installer files and what to do when you need to install again, etc. Not really a big deal when you can download the ISOs, and if you didn't do that when you bought it intending not to subscribe, that is 100% on you. As to installation limits, my understanding is that you can get that taken care of by contacting sales. Personally I really, really dislike this policy on the part of Embarcadero, but I do understand their interest in preventing licenses from being abused. Now, if they refuse to bump your activation limit, you have something worth complaining about...
  2. The point is that if you want to test for invalid parameters, you have to pass them inside another test method instead of a separate test case. Currently we have one test method procedure TestAdd(Value1, Value2, _Result: Int64); Unfortunately we don't have the implementation, so I have to do a bit of guessing here: procedure TMyTestClass.TestAdd(Value1, Value2, _Result: Int64); begin Assert.AreEqual(_Result, Add(Value1, Value2)); end; Whatever is passed to the TestAdd method, the parameters given to the Add method are always valid types. To test some invalid parameter we need another test method TestAddInvalidParams passing invalid parameters to the Add method. procedure TMyTestClass.TestAddInvalidParams; begin // call Add with some invalid params and chec if it fails end; Passing invalid parameters to TestAdd via a TestCase attribute only tests the capability of DUnitX to detect invalid parameters in a TestCase attribute. It does not test Add to fail with invalid parameters. BTW, whether you even can pass invalid parameters to Add depends on the declaration of Add which we cannot see.
  3. Dave Nottage

    Multiplatform Hello World error [PAClient Error] Error: E7688

    Looks like you may be using a project created with an older version of Delphi. Please refer to: https://github.com/DelphiWorlds/HowTo/tree/main/Solutions/AndroidLibraries
  4. Looks like a compiler defect - when changing this declaration: TOnMyIntfItemSelected<T: IMyIntfItem> = procedure(AItem: IMyIntfItem) of object; the code for TMyIntfItemA<T>.Select looks like this: List.Intf.pas.82: begin 007083E4 53 push ebx List.Intf.pas.83: if Assigned(FOnItemSelected) then 007083E5 6683781200 cmp word ptr [eax+$12],$00 007083EA 7411 jz $007083fd List.Intf.pas.84: FOnItemSelected(Self); 007083EC 8BD0 mov edx,eax 007083EE 85D2 test edx,edx 007083F0 7403 jz $007083f5 007083F2 83EAE8 sub edx,-$18 // this is where it turns Self into an IMyIntfItem, $18 is the offset where the interface method table pointer sits inside the object 007083F5 8BD8 mov ebx,eax 007083F7 8B4314 mov eax,[ebx+$14] 007083FA FF5310 call dword ptr [ebx+$10] List.Intf.pas.85: end; 007083FD 5B pop ebx 007083FE C3 ret but when it has the generic T parameter it looks like this: List.Intf.pas.82: begin 007083E4 53 push ebx List.Intf.pas.83: if Assigned(FOnItemSelected) then 007083E5 6683781200 cmp word ptr [eax+$12],$00 007083EA 740A jz $007083f6 List.Intf.pas.84: FOnItemSelected(Self); 007083EC 8BD8 mov ebx,eax 007083EE 8BD0 mov edx,eax // here it simply passes Self 007083F0 8B4314 mov eax,[ebx+$14] 007083F3 FF5310 call dword ptr [ebx+$10] List.Intf.pas.85: end; 007083F6 5B pop ebx 007083F7 C3 ret To explain this a bit more: when putting an interface type as generic type constraint this means for the compiler that the type you put for the generic type argument not only has to be that interface type but also that it can be a class that implements this interface. TMyIntfItemA<T> does this and thus satisfies the compiler when passing it to the argument of that event handler. However, inside the event handler, it is being treated as an interface and due to the lacking const parameter the compiler inserted an IntfAddRef call which blows up as the parameter that was passed was not really an interface reference but an object reference. Putting the const parameter makes it blow up a bit later though, namely when accessing Caption.
  5. Looking at my unrelsolved issues from 10.4.2 and earlier.. 12 might be optimistic 🙄
×