Coding style fixes + Remove duplicated code from test_convert_endian.cpp