From 5f8bc839e89ea6efa7f48ebcec8939861024649f Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 23 Feb 2021 13:25:00 +0100 Subject: score: Add _IO_Base64url() Update #4267. --- testsuites/sptests/spprintk/init.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'testsuites') diff --git a/testsuites/sptests/spprintk/init.c b/testsuites/sptests/spprintk/init.c index 0c0e4c7fb8..ffabb9ae91 100644 --- a/testsuites/sptests/spprintk/init.c +++ b/testsuites/sptests/spprintk/init.c @@ -242,6 +242,17 @@ static void test_io_base64( test_context *ctx ) rtems_test_assert( n == 0 ); } +static void test_io_base64url( test_context *ctx ) +{ + unsigned char buf[] = { 0, 0, 62, 0, 0, 63 }; + int n; + + clear( ctx ); + n = _IO_Base64url( put_char, ctx, buf, sizeof( buf ), "\n", 0 ); + rtems_test_assert( n == 9 ); + rtems_test_assert( strcmp( ctx->buf, "AAA-\nAAA_" ) == 0 ); +} + static rtems_task Init( rtems_task_argument argument ) @@ -257,6 +268,7 @@ static rtems_task Init( do_getchark(); test_io_printf(&test_instance); test_io_base64(&test_instance); + test_io_base64url(&test_instance); TEST_END(); rtems_test_exit( 0 ); -- cgit v1.2.3