Incorporate tests/test_* application into tests/unittests if it makes sense
Identified candidates so far:
- [x] tests/test_bloom
- [ ] tests/test_bloom_bytes
- [x] tests/test_netif
- [ ] tests/test_posix_semaphore
- [x] tests/test_sha256
@phiros, we postpone this until the next release, right?
@OlegHahm : yes definitely. It is quite hard to transform the remaining tests into unit tests (at least with our current test setup). The main reasons for this are:
- test_bloom_bytes: this test is designed to test the performance of the bloom module. It should therefore become a performance test instead of a unit test.
- tests/net_if: I think this could be transformed into a unit test BUT we need some kind of mocking mechanism in order to do so (we could also do it without but I think that would consume to much development time)
- tests/posix_semaphore: I think we could test some properties of the posix semaphores module with proper mocking support, however we shouldn't only rely on tests when it comes to code which is inherently concurrent.
@authmillenon : So what are the part's that can be currently worked upon , Although the previous comment does explain the reason for shifting it to next release , however since it has been recently tagged as Newbie-Task-CandidateI think there might be some areas on which I could work upon , can you point out a few.
It would be great if I could get some sort of direction to start the work.
I think in the current version this applies only tests/libfixmath_unittests and tests/net_if. tests/libfixmath_unittests is notorious for having problems to download from the repository (which caused a lot of false positives on Travis e.g. yesterday and why it should remain seperated from the other unittests) and tests/net_if is on its way of being obsolete. But if you want to, you can go through the current sys modules and see if there are modules where no unittests are implemented at tests/unittests.
(and where it makes sense. modules that involve a lot of threading or timers usually can't be tested this way for now for example)
A quick evaluation later the following modules seem like suitable candidates:
hasheshash_stringtmutlist
Thanks for having a look , working on the these now ;)
I think along with the tests there needs to be some change in the code itself , for instance current hash string function
has no check to ensure that the value of variable hash does not exceed size of unsigned long,
so I am changing it by breaking the loop if size is greater than unsigned long size limit . So I am changing the code too.
That is good, if errors like this surface :-), but please do the fixes in a seperate PR than the tests (or do the fixes + the tests for the module in module-wise).
@authmillenon I think the list is not up to date, right?
Not really, no. But don't hesitate to update it ;-)
As far as I see it there are some unittests fot the new netif. There are still no unittests for the semaphores. I don't get why you listed bloom and bloom_bytes separately.
Because those were seperate test applications in the tests/ directory at the time I opened the issue.
Somehow this was reaaaally forgotten... moving for the next release.
To be honest, reevaluating this issue I would say it is fixed. Except bloom_bytes and posix_semaphore they are all ported to unittests, but the two tests use threads and timers respectively, so they are less suitable for unittests anyway.