Updated PCI IDs to latest snapshot.
[tangerine.git] / test / clib / strtoul.c
blob8bb0bf26031b097ed5565d33bdf6246167f198a4
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include "test.h"
5 int main(void)
7 TEST((strtoul("0xff", NULL, 0) == 255UL))
8 TEST((strtoul("0xff", NULL, 16) == 255UL))
9 TEST((strtoul("0x0", NULL, 0) == 0UL))
10 TEST((strtoul("0x0", NULL, 16) == 0UL))
11 TEST((strtoul("0", NULL, 0) == 0UL))
12 TEST((strtoul("0", NULL, 16) == 0UL))
13 TEST((strtoul("0x0 ", NULL, 0) == 0UL))
14 TEST((strtoul("0x0 ", NULL, 16) == 0UL))
15 TEST((strtoul("0 ", NULL, 0) == 0UL))
16 TEST((strtoul("0 ", NULL, 16) == 0UL))
17 TEST((strtoul("0377", NULL, 0) == 255UL))
18 TEST((strtoul("255", NULL, 0) == 255UL))
19 TEST((strtoul("-1", NULL, 0) == -1UL))
20 TEST((strtoul("-0xff", NULL, 0) == -255UL))
21 TEST((strtoul("-0xff", NULL, 16) == -255UL))
22 TEST((strtoul("-ff", NULL, 16) == -255UL))
23 TEST((strtoul("-0377", NULL, 0) == -255UL))
24 TEST((strtoul("-377", NULL, 8) == -255UL))
25 return OK;
28 void cleanup(void)