Fix test setup and add test for new error log function