From 58630dedc1c5ab5e0f091184d2b917aeae8f9e5b Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sat, 25 Jan 2020 19:59:17 -0600 Subject: [PATCH] Update test to reflect that strtol now sets errno to EINVAL for invalid input. --- Tests/Conformance/C15.8.0.2.CC | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Tests/Conformance/C15.8.0.2.CC b/Tests/Conformance/C15.8.0.2.CC index ab26e26..efd6f06 100644 --- a/Tests/Conformance/C15.8.0.2.CC +++ b/Tests/Conformance/C15.8.0.2.CC @@ -39,20 +39,24 @@ void main (void) if (strPtr != &string [36]) goto Fail; + errno = 0; L1 = strtol (strPtr, &strPtr, 16); if (errno != ERANGE) goto Fail; + errno = 0; UL1 = strtoul (strPtr, &strPtr, 16); - if (errno != ERANGE) + if (errno != EINVAL) goto Fail; + errno = 0; L1 = strtol ("zz", &strPtr, 0); - if (errno != ERANGE) + if (errno != EINVAL) goto Fail; + errno = 0; UL1 = strtoul ("xx", &strPtr, 0); - if (errno != ERANGE) + if (errno != EINVAL) goto Fail; printf ("Passed Conformance Test 15.8.0.2\n");