Talk:CRC-32: Difference between revisions
Content added Content deleted
Walterpachl (talk | contribs) (→REXX: Regina seems to be 'wrong' here!) |
Walterpachl (talk | contribs) (→REXX: Extended the test program to show how it works and commented on the questions) |
||
Line 81: | Line 81: | ||
* 18.08.2013 Walter Pachl Test c2d behavior |
* 18.08.2013 Walter Pachl Test c2d behavior |
||
**********************************************************************/ |
**********************************************************************/ |
||
Parse Version v |
|||
Say v |
|||
cnt.=0 |
cnt.=0 |
||
c=d2c(999999999) |
c=d2c(999999999) |
||
id='001' |
|||
If c2x(c)='3B9AC9FF' Then |
If c2x(c)='3B9AC9FF' Then |
||
Call cnt 'ok' |
|||
d=c2d(c) |
d=c2d(c) |
||
Signal on Syntax |
Signal on Syntax |
||
id='S001' |
|||
d1=d2c(d+1) |
d1=d2c(d+1) |
||
cnt.0err=cnt.0err+1 |
cnt.0err=cnt.0err+1 |
||
BS001: |
|||
back: |
|||
Signal on Syntax |
|||
id='002' |
|||
rec=c2d('ffffffff'x) |
|||
B002: |
|||
id='003' |
|||
Numeric Digits 10 |
|||
say c2d('ffffffff'x) |
|||
B003: |
|||
id='004' |
|||
Numeric Digits 20 |
|||
say c2d('ffffffffffff'x) |
|||
B004: |
|||
Say cnt.0ok 'Tests ok' |
Say cnt.0ok 'Tests ok' |
||
Say cnt.0err 'Tests failed' |
Say cnt.0err 'Tests failed' |
||
Exit |
Exit |
||
cnt: |
|||
Parse Arg x |
|||
If x='ok' Then |
|||
⚫ | |||
Else Do |
|||
cnt.0err=cnt.0err+1 |
|||
Say 'Test' id 'failed' |
|||
End |
|||
Return |
|||
syntax: |
syntax: |
||
If left(id,1)='S' Then |
|||
⚫ | |||
Call cnt 'ok' |
|||
⚫ | |||
Else |
|||
Call cnt id |
|||
⚫ | |||
--[[User:Walterpachl|Walterpachl]] ([[User talk:Walterpachl|talk]]) 05:53, 18 August 2013 (UTC) |
--[[User:Walterpachl|Walterpachl]] ([[User talk:Walterpachl|talk]]) 05:53, 18 August 2013 (UTC) |
||
Line 101: | Line 132: | ||
I don't quite understand the reasoning/logic behind the test program: |
I don't quite understand the reasoning/logic behind the test program: |
||
: if the program gets a SYNTAX error ''anywhere'', it counts as OK. |
: if the program gets a SYNTAX error ''anywhere'', it counts as OK. |
||
:: not anymore |
|||
: if the program successfully does the two '''D2C'''s, it counts as an error in one case, but not the other. |
: if the program successfully does the two '''D2C'''s, it counts as an error in one case, but not the other. |
||
: if the program successfully does the 2nd '''D2C''', it is counted as an error. |
: if the program successfully does the 2nd '''D2C''', it is counted as an error. |
||
:: that's because it should not do it successfully |
|||
: no check is made to verify that the value of '''D''' matches the value of the 1st argument (999999999). |
: no check is made to verify that the value of '''D''' matches the value of the 1st argument (999999999). |
||
:: the result is compared with the value that should be there |
|||
A '''parse version x; say x''' was added after the 1st statement. |
A '''parse version x; say x''' was added after the 1st statement. |
||
<br>A '''say 'digits=' digits()''' would be a nice addition. |
<br>A '''say 'digits=' digits()''' would be a nice addition. |