Changeset dd0502ae in mainline
- Timestamp:
- 2019-05-27T16:18:02Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1c9bf292
- Parents:
- 0260034
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-05-27 15:58:34)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-05-27 16:18:02)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/test/strtol.c
r0260034 rdd0502ae 38 38 #include <stdlib.h> 39 39 #include <str.h> 40 #include <limits.h> 40 41 41 42 PCUT_INIT; … … 249 250 } 250 251 252 PCUT_TEST(strtoul_negative_wraparound) 253 { 254 long output; 255 char *endp; 256 char *endp_unchanged = (char *) "endp_unchanged unique pointer"; 257 int errno_unchanged = -1; 258 const char *input; 259 int base; 260 261 /* 262 * N2176 7.22.1.4 The strtol, strtoll, strtoul, and strtoull functions 263 * 264 * "If the subject sequence begins with a minus sign, the value 265 * resulting from the conversion is negated (in the return type)." 266 */ 267 268 endp = endp_unchanged; 269 errno = errno_unchanged; 270 output = strtoul(input = "-10", &endp, base = 0); 271 PCUT_ASSERT_INT_EQUALS(errno_unchanged, errno); 272 PCUT_ASSERT_PTR_EQUALS(input + 3, endp); 273 PCUT_ASSERT_UINT_EQUALS(-(10ul), output); 274 } 275 251 276 PCUT_TEST(strtol_fringe) 252 277 {
Note:
See TracChangeset
for help on using the changeset viewer.