Forum Discussion

Sariali's avatar
Sariali
Contributor
14 years ago

Bug: CompareProperty








 

procedure Test;

var

  Count, CountDiff;

begin

  

  Count := 0;

  CountDiff := 0;





  log.message('cmpLess');

  aqObject.CompareProperty(Count, cmpLess, CountDiff, true, lmError);

  

  log.message('cmpLessOrEqual');

  aqObject.CompareProperty(Count, cmpLessOrEqual, CountDiff, true, lmError);





  log.message('cmpGreater');

  aqObject.CompareProperty(Count, cmpGreater, CountDiff, true, lmError);





  log.message('cmpGreaterOrEqual');

  aqObject.CompareProperty(Count, cmpGreaterOrEqual, CountDiff, true, lmError);

end;

 









Messages

=======

cmpLess 11:33:18 Normal

[error] The property value "0" is greater than the baseline value "0" or equals it. 11:33:18 Normal

cmpLessOrEqual 11:33:18 Normal

[error] The property value "0" is greater than the baseline value "0". 11:33:18 Normal

cmpGreater 11:33:18 Normal

[error] The property value "0" is less than the baseline value "0" or equals it. 11:33:18 Normal

cmpGreaterOrEqual 11:33:18 Normal

[error] The property value "0" is less than the baseline value "0". 11:33:18 Normal





4 Errors!!!

  • Clipped from manual "CompareProperty": 

    "If the verification succeeds, the method posts a success message to the test
    log; otherwise it posts a failure message."(...)



    how can i work-around this bug?



    if Count >= CountDiff then

       aqObject.SendError;        // or something in that way to simulate CompareProperty error-handling



  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    I tried a little something.



    It seems that the aqObject.CompareProperty primarily expects the property and the value for comparison to be strings, not integers.  If  change the code to



      Count := '0'; 

      CountDiff := '0';




    Then I get 








    cmpLess 9:19:23 Normal

    [error]The property value "0" is greater than the baseline value "0" or equals it. 9:19:23 Normal

    cmpLessOrEqual 9:19:23 Normal

    [normal]The property value "0" is less than the baseline value "0" or equals it. 9:19:23 Normal

    cmpGreater 9:19:23 Normal

    [error]The property value "0" is less than the baseline value "0" or equals it. 9:19:24 Normal

    cmpGreaterOrEqual 9:19:24 Normal

    [normal]The property value "0" is greater than the baseline value "0" or equals it. 9:19:24 Normal


    So, I'd suggest making sure, for now, that the values you're comparing to (your CountDiff variable) are converted to strings using aqConvert.VartoStr.