Fix 'scope of var can be reduced' cppcheck warnings in check_heap_stats
authorIvan Maidanski <ivmai@mail.ru>
Fri, 8 Jun 2018 20:21:38 +0000 (23:21 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 8 Jun 2018 20:23:21 +0000 (23:23 +0300)
commit8568ff0dcd9ce59bd6f6b1a8b0cd33a4cc36f325
tree3f8affe76b898654758f4a842cce4553390eebaf
parentad5116fa16fc3e91155ed605028a4f0ec77ee81d
Fix 'scope of var can be reduced' cppcheck warnings in check_heap_stats
(fix of commit 4e909d2)

Also, print the message about the leak-find mode just once per gctest
execution.

* tests/test.c (INIT_FIND_LEAK): Define macro.
* tests/test.c (GC_COND_INIT): Invoke INIT_FIND_LEAK.
* tests/test.c (run_one_test): Remove print about leak-find mode.
* tests/test.c [!GC_NO_FINALIZATION] (check_heap_stats): Move
still_live and still_long_live local variables to the block of their
usage.
tests/test.c