Improve I2C test by using new APIs