tests: printf_encode unit test for bounds checking