added unit test for packetwriter