unit test of readFrame