Fixed printf() usage in test program.
Found by Cppcheck.
Removed unused variable and not needed assignment in test program.
Found by Cppcheck.
Added missing fclose() in test program.
Found by Cppcheck.
Fixed compiler warnings in test programs.