Changeset 116


Ignore:
Timestamp:
Feb 15, 2022, 5:09:10 PM (2 years ago)
Author:
chronos
Message:
  • Fixed: Fully disable automatic max. line width detection.
  • Added: More tests.
  • Added: Show number of passing and failing tests in test window.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormTest.lfm

    r91 r116  
    4848    TabOrder = 1
    4949  end
     50  object LabelResult: TLabel
     51    Left = 22
     52    Height = 27
     53    Top = 607
     54    Width = 15
     55    Anchors = [akLeft, akBottom]
     56    Caption = '   '
     57  end
    5058  object ActionList1: TActionList
    5159    Left = 537
  • trunk/Forms/UFormTest.lrj

    r91 r116  
    44{"hash":93105204,"name":"tformtest.listviewtestcases.columns[1].caption","sourcebytes":[82,101,115,117,108,116],"value":"Result"},
    55{"hash":22974,"name":"tformtest.buttonrun.caption","sourcebytes":[82,117,110],"value":"Run"},
     6{"hash":8736,"name":"tformtest.labelresult.caption","sourcebytes":[32,32,32],"value":"   "},
    67{"hash":368487,"name":"tformtest.ashow.caption","sourcebytes":[83,104,111,119],"value":"Show"},
    78{"hash":22974,"name":"tformtest.arun.caption","sourcebytes":[82,117,110],"value":"Run"}
  • trunk/Forms/UFormTest.pas

    r104 r116  
    1818    ActionList1: TActionList;
    1919    ButtonRun: TButton;
     20    LabelResult: TLabel;
    2021    ListViewTestCases: TListView;
    2122    MenuItem1: TMenuItem;
     
    5152  UCore, UFormTestCase, UContact;
    5253
     54resourcestring
     55  SPassed = 'Passed';
     56  SFailed = 'Failed';
     57
    5358{ TFormTest }
    5459
     
    7883var
    7984  Selected: Boolean;
     85  Passed: Integer;
     86  Failed: Integer;
     87  I: Integer;
    8088begin
    8189  Selected := Assigned(ListViewTestCases.Selected);
    8290  ARun.Enabled := Selected;
    8391  AShow.Enabled := Selected;
     92
     93  Passed := 0;
     94  Failed := 0;
     95  for I := 0 to TestCases.Count - 1 do begin
     96    case TestCases[I].Result of
     97      trPassed: Inc(Passed);
     98      trFailed: Inc(Failed);
     99    end;
     100  end;
     101  LabelResult.Caption := SPassed + ' ' + IntToStr(Passed) + ', ' +
     102    SFailed + ' ' + IntToStr(Failed);
    84103end;
    85104
     
    101120      Input := VCardBegin + LineEnding +
    102121        VCardVersion + LineEnding +
    103         'NOTE:This is some long test which is really multi-lined each line is on d' + LineEnding +
    104         ' ifferent line so it is on multiple lines.' + LineEnding +
     122        'NOTE:This is some long test which is really multi-lined each line is on dif' + LineEnding +
     123        ' ferent line so it is on multiple lines.' + LineEnding +
    105124        VCardEnd + LineEnding;
    106125      Output := Input;
     
    123142      Input := VCardBegin + LineEnding +
    124143        VCardVersion + LineEnding +
    125         'FN;ENCODING=QUOTED-PRINTABLE:Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=AD=' + LineEnding +
    126         'Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=AD' + LineEnding +
    127         VCardEnd + LineEnding;
    128       Output := Input;
    129     end;
    130     //AddNew('Encoding base64', TTestCaseLoadSave);
    131     //AddNew('Encoding quoted-printable', TTestCaseLoadSave);
     144        'FN;ENCODING=QUOTED-PRINTABLE:Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=ADJm=C3=A9n=' + LineEnding +
     145        'o=20P=C5=99=C3=ADjmen=C3=AD' + LineEnding +
     146        VCardEnd + LineEnding;
     147      Output := Input;
     148    end;
     149    with TTestCaseLoadSave(AddNew('Base64 load-save (encoding=base64)', TTestCaseLoadSave)) do begin
     150      Input := VCardBegin + LineEnding +
     151        VCardVersion + LineEnding +
     152        'FN;ENCODING=BASE64:VGVzdCBzdHJpbmc=' + LineEnding +
     153        VCardEnd + LineEnding;
     154      Output := Input;
     155    end;
     156    with TTestCaseLoadSave(AddNew('Base64 load-save (base64)', TTestCaseLoadSave)) do begin
     157      Input := VCardBegin + LineEnding +
     158        VCardVersion + LineEnding +
     159        'FN;BASE64:VGVzdCBzdHJpbmc=' + LineEnding +
     160        VCardEnd + LineEnding;
     161      Output := Input;
     162    end;
     163    with TTestCaseLoadSave(AddNew('Base64 load-save (encoding=b)', TTestCaseLoadSave)) do begin
     164      Input := VCardBegin + LineEnding +
     165        VCardVersion + LineEnding +
     166        'FN;ENCODING=B:VGVzdCBzdHJpbmc=' + LineEnding +
     167        VCardEnd + LineEnding;
     168      Output := Input;
     169    end;
     170    with TTestCaseLoadSave(AddNew('Base64 load-save multi-line', TTestCaseLoadSave)) do begin
     171      Input := VCardBegin + LineEnding +
     172        VCardVersion + LineEnding +
     173        'FN;ENCODING=BASE64:U29tZSB2ZXJ5IGxvbmcgc3RyaW5nIFNvbWUgdmVyeSBsb25nIHN0cmlu' + LineEnding +
     174        ' ZyBTb21lIHZlcnkgbG9uZyBzdHJpbmcgU29tZSB2ZXJ5IGxvbmcgc3RyaW5n' + LineEnding +
     175        VCardEnd + LineEnding;
     176      Output := Input;
     177    end;
    132178    //AddNew('Image format', TTestCaseLoadSave);
    133179    with TTestCaseLoadSave(AddNew('Empty', TTestCaseLoadSave)) do begin
     
    153199      Output := '';
    154200    end;
    155     with TTestCaseCheckProperty(AddNew('Propery FN', TTestCaseCheckProperty)) do begin
     201    with TTestCaseCheckProperty(AddNew('Property FN', TTestCaseCheckProperty)) do begin
    156202      Index := cfFullName;
    157203      Value := 'Name Surname';
     
    185231        VCardEnd + LineEnding;
    186232    end;
     233    with TTestCaseCheckProperty(AddNew('Base64 special symbols', TTestCaseCheckProperty)) do begin
     234      Index := cfFullName;
     235      Value := 'Jméno Příjmení';
     236      Input := VCardBegin + LineEnding +
     237        VCardVersion + LineEnding +
     238        'FN;ENCODING=BASE64:Sm3DqW5vIFDFmcOtam1lbsOt' + LineEnding +
     239        VCardEnd + LineEnding;
     240    end;
    187241  end;
    188242end;
     
    200254    TestCases[I].Run;
    201255  ReloadList;
     256  UpdateInterface;
    202257end;
    203258
     
    219274    TTestCase(ListViewTestCases.Selected.Data).Run;
    220275    ReloadList;
     276    UpdateInterface;
    221277  end;
    222278end;
  • trunk/Languages/vCardStudio.cs.po

    r115 r116  
    10121012msgstr "Testování"
    10131013
     1014#: tformtest.labelresult.caption
     1015msgid "   "
     1016msgstr "   "
     1017
    10141018#: tformtest.listviewtestcases.columns[0].caption
    10151019msgctxt "tformtest.listviewtestcases.columns[0].caption"
     
    15171521msgstr "Hodnota"
    15181522
     1523#: uformtest.sfailed
     1524msgid "Failed"
     1525msgstr "Selhalo"
     1526
     1527#: uformtest.spassed
     1528msgid "Passed"
     1529msgstr "Prošlo"
     1530
    15191531#: uquotedprintable.sdecodeerror
    15201532msgid "Decode error"
  • trunk/Languages/vCardStudio.pot

    r115 r116  
    986986msgstr ""
    987987
     988#: tformtest.labelresult.caption
     989msgid "   "
     990msgstr ""
     991
    988992#: tformtest.listviewtestcases.columns[0].caption
    989993msgctxt "tformtest.listviewtestcases.columns[0].caption"
     
    14891493msgstr ""
    14901494
     1495#: uformtest.sfailed
     1496msgid "Failed"
     1497msgstr ""
     1498
     1499#: uformtest.spassed
     1500msgid "Passed"
     1501msgstr ""
     1502
    14911503#: uquotedprintable.sdecodeerror
    14921504msgid "Decode error"
  • trunk/UContact.pas

    r115 r116  
    16231623  while I < Lines.Count do begin
    16241624    Line := Lines[I];
    1625     DetectMaxLineLength(Line);
     1625    //DetectMaxLineLength(Line);
    16261626
    16271627    if Line = '' then begin
     
    16521652          if I >= Lines.Count then Break;
    16531653          Line2 := Lines[I];
    1654           DetectMaxLineLength(Line2);
     1654          //DetectMaxLineLength(Line2);
    16551655          if (Length(Line2) > 0) and (Line2[1] = ' ') then begin
    16561656            Value := Value + Copy(Line2, 2, MaxInt);
  • trunk/UCore.pas

    r115 r116  
    196196    end;
    197197    ModalResult := MessageDlg(SFileSplit,
    198      Format(SFileSplitFinishedOpenDirectory, [C,
    199      SelectDirectoryDialog1.FileName]), mtConfirmation, [mbYes, mbNo], 0);
     198      Format(SFileSplitFinishedOpenDirectory, [C,
     199      SelectDirectoryDialog1.FileName]), mtConfirmation, [mbYes, mbNo], 0);
    200200    if ModalResult = mrYes then begin
    201201      {$IFDEF WINDOWS}
Note: See TracChangeset for help on using the changeset viewer.