summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/stringto01/stringto_test_template.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-29 20:29:13 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-29 20:29:13 +0000
commit7920a24c6e24721b32a1c125923801a23da28634 (patch)
tree8b5d3b4d0a4ab945556971120c800b8a27b87b85 /testsuites/libtests/stringto01/stringto_test_template.h
parent2011-07-29 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-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.h18
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