Changeset 270


Ignore:
Timestamp:
Aug 23, 2011, 10:04:27 AM (13 years ago)
Author:
george
Message:
  • Added: Test of method EqualTo in demo for TListInteger.
Location:
Generics/TemplateGenerics
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Generics/TemplateGenerics/Demo/Demo.lpi

    r220 r270  
    5757        <EditorIndex Value="0"/>
    5858        <WindowIndex Value="0"/>
    59         <TopLine Value="624"/>
    60         <CursorPos X="39" Y="628"/>
     59        <TopLine Value="71"/>
     60        <CursorPos X="22" Y="90"/>
    6161        <UsageCount Value="233"/>
    6262        <Bookmarks Count="1">
    63           <Item0 X="65" Y="224" ID="2"/>
     63          <Item0 X="65" Y="233" ID="2"/>
    6464        </Bookmarks>
    6565        <Loaded Value="True"/>
     
    312312      <Unit32>
    313313        <Filename Value="../Generic/GenericList.inc"/>
     314        <IsVisibleTab Value="True"/>
    314315        <EditorIndex Value="2"/>
    315316        <WindowIndex Value="0"/>
    316         <TopLine Value="227"/>
    317         <CursorPos X="29" Y="238"/>
     317        <TopLine Value="359"/>
     318        <CursorPos X="62" Y="376"/>
    318319        <UsageCount Value="107"/>
    319320        <Loaded Value="True"/>
     
    418419      <Unit46>
    419420        <Filename Value="../Generic/GenericMatrix.inc"/>
    420         <IsVisibleTab Value="True"/>
    421         <EditorIndex Value="7"/>
     421        <EditorIndex Value="3"/>
    422422        <WindowIndex Value="0"/>
    423423        <TopLine Value="9"/>
    424         <CursorPos X="31" Y="19"/>
     424        <CursorPos X="28" Y="23"/>
    425425        <UsageCount Value="103"/>
    426426        <Loaded Value="True"/>
    427427      </Unit46>
    428428      <Unit47>
    429         <Filename Value="../../../../../lazarus/trunk/lcl/graphics.pp"/>
     429        <Filename Value="../../../../lazarus/trunk/lcl/graphics.pp"/>
    430430        <UnitName Value="Graphics"/>
    431431        <WindowIndex Value="0"/>
     
    436436      </Unit47>
    437437      <Unit48>
    438         <Filename Value="../../../../../lazarus/trunk/lcl/interfaces/carbon/issues.xml"/>
     438        <Filename Value="../../../../lazarus/trunk/lcl/interfaces/carbon/issues.xml"/>
    439439        <WindowIndex Value="0"/>
    440440        <TopLine Value="94"/>
     
    492492      </Unit54>
    493493      <Unit55>
    494         <Filename Value="../../../../../lazarus/trunk/lcl/include/control.inc"/>
     494        <Filename Value="../../../../lazarus/trunk/lcl/include/control.inc"/>
    495495        <WindowIndex Value="0"/>
    496496        <TopLine Value="2270"/>
     
    502502        <Filename Value="../Specialized/SpecializedMatrix.pas"/>
    503503        <UnitName Value="SpecializedMatrix"/>
    504         <EditorIndex Value="8"/>
     504        <EditorIndex Value="4"/>
    505505        <WindowIndex Value="0"/>
    506506        <TopLine Value="1"/>
     
    518518      </Unit57>
    519519      <Unit58>
    520         <Filename Value="../../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/objpas/dateutil.inc"/>
     520        <Filename Value="../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/objpas/dateutil.inc"/>
    521521        <WindowIndex Value="0"/>
    522522        <TopLine Value="38"/>
     
    526526      </Unit58>
    527527      <Unit59>
    528         <Filename Value="../../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/objpas/classes/classesh.inc"/>
     528        <Filename Value="../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/objpas/classes/classesh.inc"/>
    529529        <WindowIndex Value="0"/>
    530530        <TopLine Value="649"/>
     
    534534      </Unit59>
    535535      <Unit60>
    536         <Filename Value="../../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/objpas/classes/stringl.inc"/>
     536        <Filename Value="../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/objpas/classes/stringl.inc"/>
    537537        <WindowIndex Value="0"/>
    538538        <TopLine Value="1185"/>
     
    542542      </Unit60>
    543543      <Unit61>
    544         <Filename Value="../../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/objpas/types.pp"/>
     544        <Filename Value="../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/objpas/types.pp"/>
    545545        <UnitName Value="types"/>
    546546        <WindowIndex Value="0"/>
     
    551551      </Unit61>
    552552      <Unit62>
    553         <Filename Value="../../../../../Projekty2/FreePascalManager/trunk/Instance/1/FPC/rtl/objpas/sysutils/sysstrh.inc"/>
    554         <EditorIndex Value="3"/>
     553        <Filename Value="../../../../Projekty2/FreePascalManager/trunk/Instance/1/FPC/rtl/objpas/sysutils/sysstrh.inc"/>
    555554        <WindowIndex Value="0"/>
    556555        <TopLine Value="71"/>
    557556        <CursorPos X="10" Y="84"/>
    558557        <UsageCount Value="10"/>
    559         <Loaded Value="True"/>
    560558      </Unit62>
    561559      <Unit63>
    562         <Filename Value="../../../../../Projekty2/FreePascalManager/trunk/Instance/1/FPC/rtl/objpas/sysutils/sysstr.inc"/>
    563         <EditorIndex Value="4"/>
     560        <Filename Value="../../../../Projekty2/FreePascalManager/trunk/Instance/1/FPC/rtl/objpas/sysutils/sysstr.inc"/>
    564561        <WindowIndex Value="0"/>
    565562        <TopLine Value="148"/>
    566563        <CursorPos X="11" Y="169"/>
    567564        <UsageCount Value="10"/>
    568         <Loaded Value="True"/>
    569565      </Unit63>
    570566      <Unit64>
    571         <Filename Value="../../../../../Projekty2/FreePascalManager/trunk/Instance/1/FPC/rtl/inc/systemh.inc"/>
    572         <EditorIndex Value="5"/>
     567        <Filename Value="../../../../Projekty2/FreePascalManager/trunk/Instance/1/FPC/rtl/inc/systemh.inc"/>
    573568        <WindowIndex Value="0"/>
    574569        <TopLine Value="511"/>
    575570        <CursorPos X="11" Y="524"/>
    576571        <UsageCount Value="10"/>
    577         <Loaded Value="True"/>
    578572      </Unit64>
    579573      <Unit65>
    580         <Filename Value="../../../../../Projekty2/FreePascalManager/trunk/Instance/1/FPC/rtl/i386/i386.inc"/>
    581         <EditorIndex Value="6"/>
     574        <Filename Value="../../../../Projekty2/FreePascalManager/trunk/Instance/1/FPC/rtl/i386/i386.inc"/>
    582575        <WindowIndex Value="0"/>
    583576        <TopLine Value="411"/>
    584577        <CursorPos X="10" Y="424"/>
    585578        <UsageCount Value="10"/>
    586         <Loaded Value="True"/>
    587579      </Unit65>
    588580    </Units>
    589581    <JumpHistory Count="30" HistoryIndex="27">
    590582      <Position1>
    591         <Filename Value="UMainForm.pas"/>
    592         <Caret Line="617" Column="1" TopLine="593"/>
     583        <Filename Value="../Generic/GenericList.inc"/>
     584        <Caret Line="468" Column="70" TopLine="462"/>
    593585      </Position1>
    594586      <Position2>
    595         <Filename Value="UMainForm.pas"/>
    596         <Caret Line="260" Column="25" TopLine="230"/>
     587        <Filename Value="../Generic/GenericList.inc"/>
     588        <Caret Line="469" Column="1" TopLine="462"/>
    597589      </Position2>
    598590      <Position3>
    599         <Filename Value="UMainForm.pas"/>
    600         <Caret Line="246" Column="21" TopLine="233"/>
     591        <Filename Value="../Generic/GenericList.inc"/>
     592        <Caret Line="470" Column="1" TopLine="462"/>
    601593      </Position3>
    602594      <Position4>
    603         <Filename Value="UMainForm.pas"/>
    604         <Caret Line="364" Column="25" TopLine="358"/>
     595        <Filename Value="../Generic/GenericList.inc"/>
     596        <Caret Line="471" Column="1" TopLine="462"/>
    605597      </Position4>
    606598      <Position5>
    607         <Filename Value="UMainForm.pas"/>
    608         <Caret Line="596" Column="33" TopLine="586"/>
     599        <Filename Value="../Generic/GenericList.inc"/>
     600        <Caret Line="470" Column="5" TopLine="462"/>
    609601      </Position5>
    610602      <Position6>
     
    613605      </Position6>
    614606      <Position7>
    615         <Filename Value="../Generic/GenericList.inc"/>
    616         <Caret Line="468" Column="70" TopLine="462"/>
     607        <Filename Value="UMainForm.pas"/>
     608        <Caret Line="237" Column="19" TopLine="232"/>
    617609      </Position7>
    618610      <Position8>
    619         <Filename Value="../Generic/GenericList.inc"/>
    620         <Caret Line="469" Column="1" TopLine="462"/>
     611        <Filename Value="UMainForm.pas"/>
     612        <Caret Line="495" Column="26" TopLine="482"/>
    621613      </Position8>
    622614      <Position9>
    623         <Filename Value="../Generic/GenericList.inc"/>
    624         <Caret Line="470" Column="1" TopLine="462"/>
     615        <Filename Value="UMainForm.pas"/>
     616        <Caret Line="503" Column="9" TopLine="490"/>
    625617      </Position9>
    626618      <Position10>
    627         <Filename Value="../Generic/GenericList.inc"/>
    628         <Caret Line="471" Column="1" TopLine="462"/>
     619        <Filename Value="UMainForm.pas"/>
     620        <Caret Line="480" Column="3" TopLine="467"/>
    629621      </Position10>
    630622      <Position11>
    631         <Filename Value="../Generic/GenericList.inc"/>
    632         <Caret Line="470" Column="5" TopLine="462"/>
     623        <Filename Value="UMainForm.pas"/>
     624        <Caret Line="511" Column="32" TopLine="498"/>
    633625      </Position11>
    634626      <Position12>
    635627        <Filename Value="UMainForm.pas"/>
    636         <Caret Line="237" Column="19" TopLine="232"/>
     628        <Caret Line="519" Column="33" TopLine="506"/>
    637629      </Position12>
    638630      <Position13>
    639631        <Filename Value="UMainForm.pas"/>
    640         <Caret Line="237" Column="19" TopLine="232"/>
     632        <Caret Line="526" Column="26" TopLine="513"/>
    641633      </Position13>
    642634      <Position14>
    643635        <Filename Value="UMainForm.pas"/>
    644         <Caret Line="495" Column="26" TopLine="482"/>
     636        <Caret Line="538" Column="27" TopLine="525"/>
    645637      </Position14>
    646638      <Position15>
    647639        <Filename Value="UMainForm.pas"/>
    648         <Caret Line="503" Column="9" TopLine="490"/>
     640        <Caret Line="549" Column="26" TopLine="536"/>
    649641      </Position15>
    650642      <Position16>
    651643        <Filename Value="UMainForm.pas"/>
    652         <Caret Line="480" Column="3" TopLine="467"/>
     644        <Caret Line="561" Column="25" TopLine="548"/>
    653645      </Position16>
    654646      <Position17>
    655647        <Filename Value="UMainForm.pas"/>
    656         <Caret Line="511" Column="32" TopLine="498"/>
     648        <Caret Line="572" Column="16" TopLine="559"/>
    657649      </Position17>
    658650      <Position18>
    659651        <Filename Value="UMainForm.pas"/>
    660         <Caret Line="519" Column="33" TopLine="506"/>
     652        <Caret Line="584" Column="25" TopLine="571"/>
    661653      </Position18>
    662654      <Position19>
    663655        <Filename Value="UMainForm.pas"/>
    664         <Caret Line="526" Column="26" TopLine="513"/>
     656        <Caret Line="595" Column="26" TopLine="582"/>
    665657      </Position19>
    666658      <Position20>
    667         <Filename Value="UMainForm.pas"/>
    668         <Caret Line="538" Column="27" TopLine="525"/>
     659        <Filename Value="../Generic/GenericList.inc"/>
     660        <Caret Line="214" Column="12" TopLine="201"/>
    669661      </Position20>
    670662      <Position21>
    671         <Filename Value="UMainForm.pas"/>
    672         <Caret Line="549" Column="26" TopLine="536"/>
     663        <Filename Value="../Generic/GenericList.inc"/>
     664        <Caret Line="231" Column="16" TopLine="218"/>
    673665      </Position21>
    674666      <Position22>
    675667        <Filename Value="UMainForm.pas"/>
    676         <Caret Line="561" Column="25" TopLine="548"/>
     668        <Caret Line="634" Column="11" TopLine="614"/>
    677669      </Position22>
    678670      <Position23>
    679671        <Filename Value="UMainForm.pas"/>
    680         <Caret Line="572" Column="16" TopLine="559"/>
     672        <Caret Line="628" Column="39" TopLine="624"/>
    681673      </Position23>
    682674      <Position24>
    683675        <Filename Value="UMainForm.pas"/>
    684         <Caret Line="584" Column="25" TopLine="571"/>
     676        <Caret Line="91" Column="5" TopLine="77"/>
    685677      </Position24>
    686678      <Position25>
    687679        <Filename Value="UMainForm.pas"/>
    688         <Caret Line="595" Column="26" TopLine="582"/>
     680        <Caret Line="92" Column="61" TopLine="77"/>
    689681      </Position25>
    690682      <Position26>
    691         <Filename Value="../Generic/GenericList.inc"/>
    692         <Caret Line="214" Column="12" TopLine="201"/>
     683        <Filename Value="UMainForm.pas"/>
     684        <Caret Line="91" Column="52" TopLine="74"/>
    693685      </Position26>
    694686      <Position27>
    695687        <Filename Value="../Generic/GenericList.inc"/>
    696         <Caret Line="231" Column="16" TopLine="218"/>
     688        <Caret Line="3" Column="69" TopLine="1"/>
    697689      </Position27>
    698690      <Position28>
    699         <Filename Value="UMainForm.pas"/>
    700         <Caret Line="634" Column="11" TopLine="614"/>
     691        <Filename Value="../Generic/GenericList.inc"/>
     692        <Caret Line="27" Column="24" TopLine="7"/>
    701693      </Position28>
    702694      <Position29>
    703         <Filename Value="UMainForm.pas"/>
    704         <Caret Line="479" Column="12" TopLine="467"/>
     695        <Filename Value="../Generic/GenericList.inc"/>
     696        <Caret Line="217" Column="27" TopLine="209"/>
    705697      </Position29>
    706698      <Position30>
    707699        <Filename Value="../Generic/GenericList.inc"/>
    708         <Caret Line="23" Column="58" TopLine="9"/>
     700        <Caret Line="237" Column="18" TopLine="223"/>
    709701      </Position30>
    710702    </JumpHistory>
  • Generics/TemplateGenerics/Demo/UMainForm.lfm

    r257 r270  
    125125    Height = 14
    126126    Top = 408
    127     Width = 72
     127    Width = 62
    128128    Anchors = [akLeft, akBottom]
    129129    Caption = 'Benchmarks:'
  • Generics/TemplateGenerics/Demo/UMainForm.pas

    r219 r270  
    6565var
    6666  List: TListInteger;
     67  List2: TListInteger;
    6768  I: Integer;
    6869begin
     
    7071  LabelTestName.Caption := 'TListInteger test';
    7172  List := TListInteger.Create;
     73  List2 := TListInteger.Create;
    7274  with List do try
    7375    AddArray([10, 20, 30, 40]);
     
    8688    Insert(5, 11);
    8789    WriteOutput('Insert(5, 11)', Implode(',', IntToStr));
     90    DeleteItems(0, 10);
     91    WriteOutput('Delete(0, 10)', Implode(',', IntToStr));
     92    List2.SetArray([1, 0]);
     93    WriteOutput('EqualTo([6, 11])', BoolToStr(EqualTo(List2)));
     94    List2.SetArray([2, 0]);
     95    WriteOutput('EqualTo([7, 11])', BoolToStr(EqualTo(List2)));
    8896  finally
    8997    Free;
     98    List2.Free;
    9099  end;
    91100end;
  • Generics/TemplateGenerics/Generic/GenericList.inc

    r251 r270  
    374374    I := 0;
    375375    while I < Count do begin
    376       if not CompareMem(Addr(FItems[I]), Addr(List.FItems[I]), SizeOf(TGListItem)) then begin
     376      if not CompareMem(@FItems[I], @List.FItems[I], SizeOf(TGListItem)) then begin
    377377        Result := False;
    378378        Break;
Note: See TracChangeset for help on using the changeset viewer.