unit-tests added for valgrind check