unit tests for gptwrite.c