diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-07-29 20:29:13 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-07-29 20:29:13 +0000 |
commit | 7920a24c6e24721b32a1c125923801a23da28634 (patch) | |
tree | 8b5d3b4d0a4ab945556971120c800b8a27b87b85 /testsuites/libtests/stringto01/stringto_test_template.h | |
parent | 2011-07-29 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff) | |
download | rtems-7920a24c6e24721b32a1c125923801a23da28634.tar.bz2 |
2011-07-29 Pawel Zagorski <pzagor@agh.edu.pl>
PR 1865/tests
* stringto01/Makefile.am, stringto01/init.c, stringto01/stringto01.doc,
stringto01/stringto01.scn, stringto01/stringto_test_template.h:
Improve coverage of string conversion routines.
Diffstat (limited to '')
-rw-r--r-- | testsuites/libtests/stringto01/stringto_test_template.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuites/libtests/stringto01/stringto_test_template.h b/testsuites/libtests/stringto01/stringto_test_template.h index a69284448c..6cd51f4782 100644 --- a/testsuites/libtests/stringto01/stringto_test_template.h +++ b/testsuites/libtests/stringto01/stringto_test_template.h @@ -139,6 +139,23 @@ void TEST_STRING_TO_NAME(void) rtems_test_assert( endptr ); #endif + + /* Conversion of number that is too large for unsigned char */ + #if defined(TEST_TOO_LARGE_FOR_UCHAR) + endptr = NULL; + value = 0; + puts( + STRING_TO_NAME_METHOD_STRING " - overflow - RTEMS_INVALID_NUMBER" ); + #if defined(STRING_TO_INTEGER) + status = STRING_TO_NAME_METHOD( + TEST_TOO_LARGE_FOR_UCHAR, &value, &endptr, 10 ); + #endif + if ( status != RTEMS_INVALID_NUMBER ) + printf( "ERROR = %s\n", rtems_status_text(status) ); + rtems_test_assert( status == RTEMS_INVALID_NUMBER ); + rtems_test_assert( endptr ); + #endif + /* Conversion of number that is too small */ #if defined(TEST_TOO_SMALL_STRING) endptr = NULL; @@ -170,3 +187,4 @@ void TEST_STRING_TO_NAME(void) #undef BAD_VALUE_STRING #undef TEST_TOO_LARGE_STRING #undef TEST_TOO_SMALL_STRING +#undef TEST_TOO_LARGE_FOR_UCHAR |