Layers and shared pointers and unittests

Adrian Page adrian at pagenet.plus.com
Fri Jan 6 00:01:09 CET 2006


Boudewijn Rempt wrote:
> Btw, I've fixed the krita/core unittests. Two things:
> 
>     Unexpected failures:
>         /home/boud/koffice/krita/core/tests/kis_integer_maths_tester.cpp[55]: 
> failed on "(int)UINT8_BLEND(255, 0, 128)" result = '127' expected = '128'
>         /home/boud/koffice/krita/core/tests/kis_integer_maths_tester.cpp[56]: 
> failed on "(int)UINT8_BLEND(255, 128, 128)" result = '191' expected = '192'
>         /home/boud/koffice/krita/core/tests/kis_integer_maths_tester.cpp[57]: 
> failed on "(int)UINT8_BLEND(128, 64, 255)" result = '127' expected = '128'
>         /home/boud/koffice/krita/core/tests/kis_integer_maths_tester.cpp[78]: 
> failed on "(int)UINT16_BLEND(65535, 0, 32768)" result = '32767' expected = 
> '32768'
>         /home/boud/koffice/krita/core/tests/kis_integer_maths_tester.cpp[79]: 
> failed on "(int)UINT16_BLEND(65535, 32768, 32768)" result = '49151' expected 
> = '49152'
>         /home/boud/koffice/krita/core/tests/kis_integer_maths_tester.cpp[80]: 
> failed on "(int)UINT16_BLEND(32768, 16384, 65535)" result = '32767' expected 
> = '32768'

Some changes were made to some of the maths functions to fix what 
appeared to be problems, but they weren't necessary as they produced the 
correct results, even though it might not be obvious that they would. I 
can add some unit tests that demonstrate that.

> 
> And I wish I could get the unittests at least compiled, but preferably run as 
> part of an ordinary targetless (unser)make run. Anyone an idea?

Not sure on that one. I have to say I haven't found the current 
kunittest system very nice to work with, which is one reason for not 
writing more tests. Using it to test anything other than the simplest of 
modules has been too much hassle to persevere with. I'm hoping that the 
QTestLib that comes with Qt 4 will be much better and will encourage 
more use of unit tests.

Adrian


More information about the kimageshop mailing list