From 916b0f301ce7751182207fada77cf659503fcb98 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 31 Jan 2008 17:30:40 +0000 Subject: 2008-01-31 Joel Sherrill * sp43/init.c, sp43/sp43.scn: Add test case for unprintable names. --- testsuites/sptests/ChangeLog | 4 ++++ testsuites/sptests/sp43/init.c | 37 ++++++++++++++++++++++++++++++------- testsuites/sptests/sp43/sp43.scn | Bin 3429 -> 3643 bytes 3 files changed, 34 insertions(+), 7 deletions(-) (limited to 'testsuites/sptests') diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index 38816aab22..57f993ffe2 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,3 +1,7 @@ +2008-01-31 Joel Sherrill + + * sp43/init.c, sp43/sp43.scn: Add test case for unprintable names. + 2008-01-31 Joel Sherrill * sp09/screen01.c, sp09/sp09.scn: Add more bad thread Id cases. diff --git a/testsuites/sptests/sp43/init.c b/testsuites/sptests/sp43/init.c index 56950945ae..2c73088515 100644 --- a/testsuites/sptests/sp43/init.c +++ b/testsuites/sptests/sp43/init.c @@ -48,14 +48,30 @@ void print_class_info( } void change_name( - const char *newName + const char *newName, + boolean printable ) { rtems_status_code status; char name[ 5 ]; char *ptr; + const char *c; + + printf( "rtems_object_set_name - change name of init task to " ); + if ( printable ) + printf( "(%s)\n", newName ); + else { + printf( "(" ); + for (c=newName ; *c ; ) { + if (isprint(*ptr)) printf( "%c", *c ); + else printf( "0x%02x", *c ); + c++; + if ( *c ) + printf( "-" ); + } + printf( ")\n" ); + } - puts( "rtems_object_set_name - change name of init task" ); status = rtems_object_set_name( main_task, newName ); directive_failed( status, "rtems_object_set_name" ); @@ -79,6 +95,7 @@ rtems_task Init( char name[5]; char *ptr; const char newName[5] = "New1"; + char tmpNameString[5]; uint32_t part; rtems_object_api_class_information info; @@ -183,11 +200,17 @@ rtems_task Init( * This is strange but pushes the SuperCore code to do different things. */ - change_name( "New1" ); - change_name( "Ne1" ); - change_name( "N1" ); - change_name( "N" ); - change_name( "" ); + change_name( "New1", TRUE ); + change_name( "Ne1", TRUE ); + change_name( "N1", TRUE ); + change_name( "N", TRUE ); + change_name( "", TRUE ); + tmpNameString[0] = 'N'; + tmpNameString[1] = 0x07; + tmpNameString[2] = 0x09; + tmpNameString[3] = '1'; + tmpNameString[4] = '\0'; + change_name( tmpNameString, FALSE ); /* * Exercise id build and extraction routines diff --git a/testsuites/sptests/sp43/sp43.scn b/testsuites/sptests/sp43/sp43.scn index 96de196d4a..865ba9571e 100644 Binary files a/testsuites/sptests/sp43/sp43.scn and b/testsuites/sptests/sp43/sp43.scn differ -- cgit v1.2.3