test msginit: share common code