core: replace for (auto... by for (... : ...) ; db_test: fix fstream usage, fix the loading of function and data label