瀏覽代碼

Add counter for tissurrogatepair2 test

Pierre Muller 1 月之前
父節點
當前提交
b790ea1a86
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. 1 1
      compiler/llvm/agllvm.pas
  2. 5 1
      tests/test/units/character/tissurrogatepair2.pp

+ 1 - 1
compiler/llvm/agllvm.pas

@@ -1789,7 +1789,7 @@ implementation
           idtxt  : 'CLANG-LLVM';
           idtxt  : 'CLANG-LLVM';
           asmbin : 'clang';
           asmbin : 'clang';
           asmcmd: '-x ir $OPT -target $TRIPLET -c -o $OBJ $ASM $EXTRAOPT';
           asmcmd: '-x ir $OPT -target $TRIPLET -c -o $OBJ $ASM $EXTRAOPT';
-          supported_targets : [system_x86_64_linux,system_aarch64_linux,system_arm_linux,system_x86_64_openbsd];
+          supported_targets : [system_x86_64_linux,system_aarch64_linux,system_arm_linux,system_x86_64_openbsd,system_x86_64_freebsd];
           flags : [af_smartlink_sections,af_llvm];
           flags : [af_smartlink_sections,af_llvm];
           labelprefix : '.L';
           labelprefix : '.L';
           labelmaxlen : -1;
           labelmaxlen : -1;

+ 5 - 1
tests/test/units/character/tissurrogatepair2.pp

@@ -34,16 +34,19 @@ end;
 
 
 var
 var
   e, i , j: Integer;
   e, i , j: Integer;
+  count : int64;
   s : UnicodeString;
   s : UnicodeString;
 begin
 begin
   s := 'azerty12345';
   s := 'azerty12345';
   e := 1;
   e := 1;
+  count:=0;
   for i := HIGH_SURROGATE_BEGIN to HIGH_SURROGATE_END do begin
   for i := HIGH_SURROGATE_BEGIN to HIGH_SURROGATE_END do begin
     for j := LOW_SURROGATE_BEGIN to LOW_SURROGATE_END do begin
     for j := LOW_SURROGATE_BEGIN to LOW_SURROGATE_END do begin
       s[3] := UnicodeChar(i);
       s[3] := UnicodeChar(i);
       s[4] := UnicodeChar(j);
       s[4] := UnicodeChar(j);
       if not TCharacter.IsSurrogatePair(s,3) then
       if not TCharacter.IsSurrogatePair(s,3) then
         DoError(e,i,j);
         DoError(e,i,j);
+      inc(count);
     end;
     end;
   end;
   end;
 
 
@@ -56,10 +59,11 @@ begin
           s[6] := UnicodeChar(j*dist);
           s[6] := UnicodeChar(j*dist);
           if TCharacter.IsSurrogatePair(s,5) then
           if TCharacter.IsSurrogatePair(s,5) then
             DoError(e,i*dist,j*dist);
             DoError(e,i*dist,j*dist);
+          inc(count);
         end;
         end;
       end;
       end;
     end;
     end;
   end;
   end;
 
 
-  WriteLn('ok');
+  WriteLn('ok, count=',count);
 end.
 end.