add more error_code tests
replace virtual call with a function pointer call