fixed test/main.cpp file overwrite behavior