Skip to content

Commit

Permalink
check SOA transmission of RawUtf8 fields as ""
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Bouchez committed Feb 3, 2024
1 parent da37c84 commit 0de80c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/mormot.commit.inc
@@ -1 +1 @@
'2.2.6985'
'2.2.6986'
14 changes: 12 additions & 2 deletions test/test.soa.core.pas
Expand Up @@ -648,6 +648,8 @@ function TServiceComplexCalculator.GetCustomer(CustomerId: Integer;

procedure TServiceComplexCalculator.FillPeople(var People: TOrmPeople);
begin
if People.ID = 0 then
exit; // check transmission of LastName/FirstName as ""
People.LastName := FormatUtf8('Last %', [People.ID]);
People.FirstName := FormatUtf8('First %', [People.ID]);
end;
Expand Down Expand Up @@ -1002,8 +1004,16 @@ procedure TTestServiceOrientedArchitecture.Test(const Inst:
people.IDValue := c;
Inst.CC.FillPeople(people);
Check(people.ID = c);
Check(people.LastName = FormatUtf8('Last %', [c]));
Check(people.FirstName = FormatUtf8('First %', [c]));
if c = 0 then
begin
Check(people.LastName = '');
Check(people.FirstName = '');
end
else
begin
Check(people.LastName = FormatUtf8('Last %', [c]));
Check(people.FirstName = FormatUtf8('First %', [c]));
end;
finally
people.Free;
end;
Expand Down

0 comments on commit 0de80c3

Please sign in to comment.