[liblouis-liblouisxml] SV: Re: C tests, faulty logic?

  • From: "Bue Vester-Andersen" <bue@xxxxxxxxxxxxxxxxxx>
  • To: <liblouis-liblouisxml@xxxxxxxxxxxxx>
  • Date: Sat, 14 Oct 2017 20:28:31 +0200

You are right, of course. I missed the | when browsing with speech. Everything 
is clear now. 

 

Bue

 

Fra: liblouis-liblouisxml-bounce@xxxxxxxxxxxxx 
[mailto:liblouis-liblouisxml-bounce@xxxxxxxxxxxxx] På vegne af Anthony Tibbs
Sendt: 14. oktober 2017 20:02
Til: liblouis-liblouisxml@xxxxxxxxxxxxx
Emne: [liblouis-liblouisxml] Re: C tests, faulty logic?

 

Bue,

 

I took a quick look at one set of C tests and found lines like this:

 

rst |= check_translation(table, ...

 

The “|=“ operator is a bitwise “or” operator, and not a straight assignment.  
It is equivalent to

 

rst = rst | check_translation(...)

 

 

check_translation() returns 1 if there is a mismatch, so the effect of each of 
those statements is to set “rst” to 1 if any of those tests fail.  

 

Of course, if the first test fails, all the rest are effectively moot because 
even if they all pass, the final result will be a failure.   

 

Regards,

Anthony Tibbs

(Sent from my iPhone)


On Oct 14, 2017, at 1:40 PM, Bue Vester-Andersen <bue@xxxxxxxxxxxxxxxxxx 
<mailto:bue@xxxxxxxxxxxxxxxxxx> > wrote:

Hi,

 

In my work to understand the current inpos and cursor tests, I have stumbled 
upon a curious thing:

 

Not only those tests, but also other tests have the following form.

 

Result = …;

Result = …;

Result = …;

 



 

Return result;

 

To me, it looks like only the very last result reaches a place where it could 
possibly be tested.

 

This is the case with a lot of the C tests, so, there must be some obvious 
explanation that I am just missing.

 

Could someone please enlighten me?

 

Bue

 

 

Other related posts:

  • » [liblouis-liblouisxml] SV: Re: C tests, faulty logic? - Bue Vester-Andersen