KDU Improvements: add unit tests for llkdu
Review Request #63 - Created Dec. 22, 2010 and submitted
Merov Linden | Reviewers | ||
https://bitbucket.org/merov_linden/viewer-development-storm-151 | viewer | ||
STORM-744 | |||
None | viewer-development |
Unit tests addition: - add tests for llkdu - turned back on and fix unit tests for llimage - turned back on and fix unit tests for llworldmap and llworldmipmap
No reason not to submit. :-)
-
indra/llkdu/llimagej2ckdu.h (Diff revision 1) -
Please add a comment that these methods aren't actually public, i.e. were made public only to be called from unit tests.
-
indra/llkdu/tests/llimagej2ckdu_test.cpp (Diff revision 1) -
What about calling protected methods via inheritance?
-
indra/llkdu/tests/llimagej2ckdu_test.cpp (Diff revision 1) -
I suppose unit tests should verify something more substantial than not raising exceptions for empty data.
Posted (Dec. 23, 2010, 5:29 p.m.)
Huh - I wrote this a long time ago (before the others commented)... apparently I forgot to click on "Publish Review"!
-
indra/llkdu/llimagej2ckdu.h (Diff revision 1) -
This feels wrong. Those functions are implementations of the base class interface, they are called by the base class: if they need to be called directly, something is wrong. If this is made public because the unit test needs access, then instead add a friend for the unit test class.
Review request changed
Updated (Dec. 24, 2010, 11:46 a.m.)
-
- added Diff r2
Took comments into account and some more: - Reverted making methods public to protected. Actually, I even made some methods private as they should. - Declared some public methods in the derived test class to test the protected methods - Fixed code so assert() work in debug mode (stub empty class was too inconsistent) - Moved one generic function out of llimagej2coj to clean things up there
Posted (Dec. 27, 2010, 5:35 a.m.)
Thanks, Merov. I have no more objections.
-
indra/llimagej2coj/llimagej2coj.cpp (Diff revision 2) -
Please add the "static" modifier to indicate that the function is not supposed to be used outside of the file.
Review request changed
Updated (Dec. 28, 2010, 10:45 p.m.)
-
- added Diff r3
Here's a new diff that changes a bit the llimagej2ckdu.cpp code so that it works consistently for unit tests on all build options on all platforms. I added extra comments in the llimagej2ckdu_test.cpp to explain the result. Clearly, we also need to create integration tests for this but that should be another JIRA.
Other reviews